Conversation ​
Inherits: DatabaseResource < Resource
A conversation containing multiple chats and responses Responses are stored in a flat array and referenced by ID
Description ​
All runtime state is managed by ConversationInstance.
Properties ​
Array[ConversationChat] | conversation_chats | [] |
Array[ConversationResponse] | conversation_responses | [] |
Array[ConversationDiceRoll] | conversation_dice_rolls | [] |
Array[Dictionary] | start_entries | [] |
Dictionary | conversation_layout | {} |
Array[Quest] | hand_in_quests | [] |
Array[Quest] | offer_quests | [] |
Methods ​
Array[Conversation] | find_handing_in( quest_id: int ) static |
int | get_id() |
ConversationChat | get_chat_by_id( chat_id: int ) |
ConversationChat | get_first_chat() |
void | add_chat( chat: ConversationChat ) |
bool | remove_chat( chat_id: int ) |
int | get_next_chat_id() |
ConversationResponse | get_response_by_id( response_id: int ) |
void | add_response( response: ConversationResponse ) |
bool | remove_response( response_id: int ) |
int | get_next_response_id() |
Array[ConversationResponse] | get_responses_for_chat( chat_id: int ) |
ConversationDiceRoll | get_dice_roll_by_id( dice_roll_id: int ) |
void | add_dice_roll( dice_roll: ConversationDiceRoll ) |
bool | remove_dice_roll( dice_roll_id: int ) |
int | get_next_dice_roll_id() |
int | get_starting_chat_id() |
Property descriptions ​
Array[ConversationChat] conversation_chats = [] ​
========== EXPORTED PROPERTIES ==========
Array[ConversationResponse] conversation_responses = [] ​
Flat array of all responses
Array[ConversationDiceRoll] conversation_dice_rolls = [] ​
Flat array of all dice rolls
Array[Dictionary] start_entries = [] ​
Starting chat options with requirements (priority order)
Dictionary conversation_layout = ​
Stores graph editor layout
Array[Quest] hand_in_quests = [] ​
Quests that can be handed in through this conversation
Array[Quest] offer_quests = [] ​
Quests that can be offered/accepted through this conversation Only shown if player meets the quest's requirements
Method descriptions ​
Array[Conversation] find_handing_in( quest_id: int ) ​
The conversations that take this quest in (it is in their hand-in list)
int get_id() ​
========== PUBLIC API - CHATS ==========
ConversationChat get_chat_by_id( chat_id: int ) ​
The chat with this id, or null.
ConversationChat get_first_chat() ​
The chat the conversation starts with.
void add_chat( chat: ConversationChat ) ​
Adds a chat.
bool remove_chat( chat_id: int ) ​
Removes a chat by id. False when it is not there.
int get_next_chat_id() ​
The next free chat id.
ConversationResponse get_response_by_id( response_id: int ) ​
========== PUBLIC API - RESPONSES ==========
void add_response( response: ConversationResponse ) ​
Adds a response.
bool remove_response( response_id: int ) ​
Removes a response by id. False when it is not there.
int get_next_response_id() ​
The next free response id.
Array[ConversationResponse] get_responses_for_chat( chat_id: int ) ​
The responses of a chat.
ConversationDiceRoll get_dice_roll_by_id( dice_roll_id: int ) ​
========== PUBLIC API - DICE ROLLS ==========
void add_dice_roll( dice_roll: ConversationDiceRoll ) ​
Adds a dice roll.
bool remove_dice_roll( dice_roll_id: int ) ​
Removes a dice roll by id. False when it is not there.
int get_next_dice_roll_id() ​
The next free dice roll id.
int get_starting_chat_id() ​
Get the starting chat ID (for editor use only) At runtime, use ConversationInstance._evaluate_start_entries() instead