EncounterRecords ​
Inherits: RefCounted
What the editor needs to know about the encounters of a world. An encounter is a record (UniqueEncounterData) and an NPC belongs to it through the Encounter field of its unique data. These functions list the encounters of a world, make a new one, and find the NPCs of one in a scene.
Methods ​
Array[UniqueEncounterData] | list_for_world( world: WorldData ) static |
UniqueEncounterData | create_for_world( world: WorldData, encounter_name: String = "" ) static |
Array[NPC] | get_members( scene_root: Node, encounter_id: int ) static |
Vector3 | get_center( members: Array ) static |
PackedStringArray | member_names( encounter_id: int ) static |
void | delete_record( record: UniqueEncounterData ) static |
Method descriptions ​
Array[UniqueEncounterData] list_for_world( world: WorldData ) ​
The encounters of a world (the ones of WorldData.encounters that exist), in the order of the list.
UniqueEncounterData create_for_world( world: WorldData, encounter_name: String = "" ) ​
Makes an encounter in a world (named "Encounter 1", "Encounter 2" ... unless a name is given), saves it, and adds it to the list of the world. Returns it, or null when it could not be made.
Array[NPC] get_members( scene_root: Node, encounter_id: int ) ​
The NPCs of a scene that belong to an encounter (found anywhere in the scene).
Vector3 get_center( members: Array ) ​
The average position of some nodes (the centre of a group); the origin for none.
PackedStringArray member_names( encounter_id: int ) ​
The names of the NPCs that belong to an encounter, read from the records of the placed NPCs (every world): for the Uniques list.
void delete_record( record: UniqueEncounterData ) ​
Deletes an encounter: the NPCs that named it are let go (their unique data is saved), it leaves the list of its world, and the record is deleted.