Skip to content

UniqueInteractableData ​

Inherits: DatabaseResource < Resource

A placed object: what the world keeps about one interactable in one world. It holds the id of the definition, the world, the position and the overrides of this object (faction, lock item, interaction cooldown, targeting, stats, loot rules, interaction). The get_effective_* functions answer with the override when there is one and with the value of the definition otherwise.

Properties ​

Stringinteractable_type""
intdefinition_id
intmap_id0
intfaction_id0
intlocked_by_item_id-1
floatinteraction_cooldown_override-1.0
Array[int]added_ui_tags[]
Array[int]removed_ui_tags[]
floatdamaged_threshold0.7
boolobject_targetable_directlyfalse
boolobject_targetable_by_aoefalse
StatsDatastats_override
TemplateBaselinetemplate_baseline
Array[int]template_fixed_stats[]
Array[LootRule]loot_rules_override[]
Interactioninteractionnull
Vector3world_positionVector3.ZERO
Vector3world_rotationVector3.ZERO

Methods ​

intget_effective_locked_state( definition: InteractableDefinition = null )
floatget_effective_cooldown_duration( definition: InteractableDefinition = null )
Stringget_effective_display_name( definition: InteractableDefinition = null )
intget_effective_faction()
boolhas_loot_rules_override()
boolhas_interaction()
boolhas_stats_override()
StatsDataget_effective_stats( definition: InteractableDefinition = null )
voidset_stats_override_from_definition( definition: InteractableDefinition = null )
voidclear_stats_override()
boolshould_show_stats( definition: InteractableDefinition = null )
boolget_effective_targetable_directly( definition: InteractableDefinition = null )
boolget_effective_targetable_by_aoe( definition: InteractableDefinition = null )
voidupdate_position_from_node( interactable_node: Node3D )
boolsave_to_disk()
Stringget_file_path()

Property descriptions ​

String interactable_type = "" ​

Basic properties

int definition_id ​

The id of the interactable definition of the object.

int map_id = 0 ​

The id of the map the object is placed in.

Basic Properties

int faction_id = 0 ​

Override to be specific faction

int locked_by_item_id = -1 ​

If > -1, this item ID is required to unlock this object

float interaction_cooldown_override = -1.0 ​

Seconds this object waits after it was used before it can be used again (-1 = the wait of its definition)

Array[int] added_ui_tags = [] ​

Entity tags this placed object has besides the ones of its definition

Array[int] removed_ui_tags = [] ​

Entity tags of the definition that this placed object does not have

Targeting

float damaged_threshold = 0.7 ​

Damage threshold at which object becomes "damaged" (0.0-1.0)

bool object_targetable_directly = false ​

Can this object be targeted directly by single-target abilities?

bool object_targetable_by_aoe = false ​

Can this object be hit by area-of-effect abilities?

Stats

StatsData stats_override ​

Stats configuration for objects with combat capabilities Only shown and used if object_targetable_directly or object_targetable_by_aoe is true

TemplateBaseline template_baseline ​

What the definition was when the stats override last looked at it. The override follows its definition (and the template of the definition): what the definition gained since is added to it

Array[int] template_fixed_stats = [] ​

Stats of the override that keep their own value whatever the definition does

Loot

Array[LootRule] loot_rules_override = [] ​

Loot rules of this placed object: when it has any they REPLACE the loot rules of its definition (a chest with its own table)

Interactions

Interaction interaction = null ​

Interactions assigned to this specific interactable instance

Vector3 world_position = Vector3.ZERO ​

World positioning

Vector3 world_rotation = Vector3.ZERO ​

The rotation of the object in the world.

Method descriptions ​

int get_effective_locked_state( definition: InteractableDefinition = null ) ​

The id of the item that locks the object: the override, else the one of the definition.

float get_effective_cooldown_duration( definition: InteractableDefinition = null ) ​

The wait between two uses: the override of this object, else the one of its definition

String get_effective_display_name( definition: InteractableDefinition = null ) ​

The name of the object: the override, else the one of the definition.

int get_effective_faction() ​

The faction of the object: the override, else the one of the definition.

bool has_loot_rules_override() ​

Does this object have loot rules of its own?

bool has_interaction() ​

Does this object have an interaction of its own?

bool has_stats_override() ​

Check if this instance has stats override

StatsData get_effective_stats( definition: InteractableDefinition = null ) ​

Get effective stats - returns override if present, otherwise definition's stats

void set_stats_override_from_definition( definition: InteractableDefinition = null ) ​

Set stats override - duplicates from definition if available, otherwise creates new Call this when enabling stats override to get a proper starting point

void clear_stats_override() ​

Clear stats override

bool should_show_stats( definition: InteractableDefinition = null ) ​

Check if stats should be shown in inspector (based on targeting flags)

bool get_effective_targetable_directly( definition: InteractableDefinition = null ) ​

Get effective targeting flags from either override or definition

bool get_effective_targetable_by_aoe( definition: InteractableDefinition = null ) ​

Do area effects hit the object: the override, else the setting of the definition?

void update_position_from_node( interactable_node: Node3D ) ​

Copies the position and rotation of the node of the object into this record.

bool save_to_disk() ​

Save this unique interactable data to disk

String get_file_path() ​

The path of the file of this record.