Entity ​
Inherits: CharacterBody3D
Inherited by: NPC, Pet, Player
Entity is the base class for all characters and creatures in the game world. It provides core functionality for movement, combat, stats management, and interaction with the game's systems. This class serves as the foundation for both player-controlled characters and AI-driven entities.
Properties ​
UniqueEntityData | unique_data | |
EntityDefinition : | definition |
Variables ​
Methods ​
int | get_unique_id() |
void | initialize_entity( system_hub: GameHost.SystemHub ) |
void | update_movement_tracking( delta: float ) |
bool | is_moving() |
void | turn_by( delta_yaw: float ) |
bool | request_facing_yaw( yaw: float, speed: int = FaceTargetSpeed.INSTANT ) |
void | begin_direct_facing( block_auto_face: bool ) |
void | end_direct_facing() |
bool | is_auto_facing_blocked() |
bool | is_turning() |
bool | is_turn_in_progress() |
float | get_target_facing_yaw() |
void | stop_turning() |
void | apply_facing_yaw( yaw: float ) |
void | apply_velocity_facing_yaw( yaw: float ) |
void | set_active_state( system_hub: GameHost.SystemHub, active: bool ) |
void | resume_behavior_system() |
void | pause_behavior_system() |
GameplayConfig.LODLevel | get_lod_level() |
bool | is_high_detail() |
bool | is_lod_culled() |
GameplayConfig.FogState | get_fog_state() |
bool | is_fog_visible() |
bool | is_in_explored_fog() |
bool | is_in_shroud() |
int | get_current_level() |
int | get_max_level() |
void | set_entity_level( new_level: int ) |
void | level_up() |
float | get_stat( stat_id: int ) |
bool | has_stat( stat_id: int ) |
Array[int] | get_stat_ids_in_group( group_id: int ) |
bool | add_stat_bonus( stat_id: int, amount: float ) |
bool | add_stat_multiplier( stat_id: int, amount: float ) |
bool | set_stat_multiplier( stat_id: int, multiplier: float ) |
bool | is_hostile_to( other: Variant ) |
bool | is_neutral_to( other: Variant ) |
bool | can_attack( other: Variant ) |
void | make_hostile_to( other: Entity ) |
void | end_temporary_hostility() |
Array[int] | get_entity_tags() |
Array[int] | get_ui_tag_ids() |
Array[UITagDefinition] | get_ui_tags() |
bool | has_ui_tag( tag: Variant ) |
int | get_proficiency_level( proficiency_id: int ) |
int | get_spoken_language_id() |
bool | has_entity_tag( tag_id: int ) |
void | add_entity_tag( tag_id: int ) |
void | remove_entity_tag( tag_id: int ) |
void | sync_type_effects() |
Dictionary | entity_tags_to_save() |
void | entity_tags_from_save( data: Dictionary ) |
float | modify_gain( channel: String, amount: float ) |
int | modify_gain_int( channel: String, amount: int, probabilistic: bool = false ) |
bool | set_stat_base( stat_id: int, value: float ) |
void | set_custom_gravity( new_gravity: float ) |
void | reset_custom_gravity() |
float | get_custom_gravity() |
float | get_weapon_damage() |
float | roll_weapon_damage() |
bool | has_weapon_equipped() |
int | get_equipped_weapon_damage_type() |
bool | has_weapon_with_damage_type( damage_type: int ) |
float | get_current_health() |
float | get_max_health() |
float | get_health_percentage() |
bool | is_health_below( threshold: float ) |
bool | is_health_above( threshold: float ) |
float | get_pool_current( pool_id: int ) |
float | get_pool_max( pool_id: int ) |
float | get_pool_percentage( pool_id: int ) |
Dictionary | can_afford_resource( pool_id: int, amount: float ) |
bool | has_pool( pool_id: int ) |
bool | is_master_pool( pool_id: int ) |
PoolInstance | get_master_pool() |
float | add_pool_value( pool_id: int, amount: float ) |
bool | remove_pool_value( pool_id: int, amount: float ) |
bool | is_resource_pool( pool_id: int ) |
Array[int] | get_resource_pool_ids() |
AbilityInstance | get_ability_by_id( ability_id: int ) |
bool | has_ability_by_id( ability_id: int ) |
AbilityInstance | get_basic_attack() |
Array[AbilityInstance] | get_active_abilities() |
Array[AbilityInstance] | get_passive_abilities() |
bool | add_ability( ability: AbilityInstance ) |
bool | swap_basic_attack( ability: AbilityInstance ) |
bool | remove_basic_attack() |
bool | remove_ability_by_id( ability_id: int ) |
bool | move_to_position( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | move_keep_facing( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | backpedal_to( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | strafe_to( target_pos: Vector3, strafe_direction: int, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | follow_target( target_to_follow: Node3D, min_distance: float = 2.0, should_walk: bool = false ) |
bool | move_to_position_sync( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | move_keep_facing_sync( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | backpedal_to_sync( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) |
bool | strafe_to_sync( target_pos: Vector3, strafe_direction: int, should_walk: bool = false, min_distance: float = -1.0 ) |
void | stop_moving() |
void | jump() |
bool | is_free_moving() |
MovementClaim | get_active_movement_claim() |
void | add_movement_claim( claim: MovementClaim ) |
bool | remove_movement_claim( source: Object ) |
MovementClaim | get_movement_claim_of( source: Object ) |
Vector3 | get_flow_velocity() |
float | get_movement_speed_multiplier() |
void | suspend_movement_claims( seconds: float ) |
void | leap_out_of_water() |
bool | is_mounted() |
bool | is_ridden() |
bool | is_carried_by_mount() |
Entity | get_mount() |
Entity | get_rider() |
Array[Entity] | get_riders() |
bool | is_seat_taken( seat_index: int ) |
int | get_free_seat_index( seat_count: int ) |
MountSession | start_mount( definition: MountDefinition, mount_entity: Entity = null, drive_logic: DriveLogic = null, seat_index: int = -1, force: bool = false ) |
bool | dismount( reason: String = "" ) |
bool | uses_breath() |
bool | is_breath_exempt() |
void | hold_breath_exempt( hold: bool ) |
float | get_breath_maximum() |
float | get_breath() |
bool | is_drowning() |
void | set_submerged( value: bool ) |
void | restore_breath() |
int | get_navigation_domain() |
GameHost.SystemHub | get_system_hub() |
void | entity_face_direction( look_at_direction: Vector3, speed: int = FaceTargetSpeed.INSTANT ) |
void | entity_look_at_object( object: Node3D, speed: int = FaceTargetSpeed.INSTANT ) |
void | set_approach_distance( distance: float ) |
MovementState | get_movement_state() |
void | change_movement_state( state_name: MovementStateComponent.MovementStateName ) |
Dictionary | get_aim( max_range: float = 0.0 ) |
void | request_action_state_change( state_name: ModularCombatScript.ActionStateName, data: Dictionary = {} ) |
void | set_stealth_prevention( prevent: bool ) |
bool | is_stealth_prevented() |
bool | is_immobile() |
void | cast_interrupted() |
void | stop_cast() |
void | set_target( new_target: Variant ) |
void | enter_combat( target_entity: Entity = null ) |
void | exit_combat() |
void | change_combat_state( value: bool ) |
void | set_encounter( encounter: CombatSession ) |
void | leave_encounter() |
Node3D | get_attachment_point_node( location: VFXSelection.VfxLocation ) |
DamageResult | take_damage( result: DamageResult ) |
HealingResult | take_healing( result: HealingResult ) |
bool | can_apply_school_effect( school_id: int, source_entity: Variant = null, effect: EffectInstance = null ) |
String | get_weapon_animation_tag() |
EffectInstance | get_effect( effect_id: int ) |
EffectInstance | get_effect_from_caller( effect_id: int, originator: Entity ) |
void | reduce_effect_stacks( effect_instance: EffectInstance, stacks_to_remove: int ) |
Array[EffectInstance] | get_active_effects_by_type( effect_type: String ) |
Array[EffectInstance] | get_all_active_effects() |
void | remove_all_effects() |
Dictionary | apply_status_effect( status_effect: int, base_duration: float, source_entity: Variant = null, effect: EffectInstance = null ) |
bool | is_immune_to_status_effect( status_effect_id: int ) |
bool | is_immune_to_damage_type( damage_type: int ) |
bool | is_immune_to_school_type( school_id: int ) |
bool | activate_immunity( immunity_id: int, duration: float = -1.0 ) |
bool | deactivate_immunity( immunity_id: int ) |
bool | is_incapacitated() |
bool | is_silenced() |
bool | is_rooted() |
bool | is_crippled() |
bool | is_blinded() |
bool | is_fleeing() |
bool | is_disoriented() |
bool | is_disarmed() |
Dictionary | get_status_effect_summary() |
Array[String] | get_active_status_effects() |
bool | has_any_cc_effects() |
bool | has_movement_impairing_effects() |
bool | has_ability_blocking_effects() |
bool | can_use_weapon_abilities() |
InventoryComponent | get_inventory() |
bool | has_inventory() |
int | count_item( item_id: int ) |
bool | equip_item( item_instance: ItemInstance, forced: bool = false ) |
bool | equip_item_to_slot( item_instance: ItemInstance, slot_data: EquipmentSlotInstance, forced: bool = false ) |
ItemInstance | unequip_slot( slot_data: EquipmentSlotInstance ) |
bool | unequip_item( item_instance: ItemInstance ) |
bool | equip_item_instance( item_instance: ItemInstance ) |
bool | unequip_item_instance( item_instance: ItemInstance ) |
Array[ItemInstance] | get_equipped_items() |
void | clear_all_equipment() |
Array[EquipmentSlotInstance] | get_equipment_slots_by_definition( slot_def: EquipmentSlotDefinition ) |
bool | has_item_equipped_in_slot_definition( slot_def: EquipmentSlotDefinition ) |
ItemInstance | get_equipped_item_from_slot_definition( slot_def: EquipmentSlotDefinition ) |
Array[ItemInstance] | get_all_equipped_items_from_slot_definition( slot_def: EquipmentSlotDefinition ) |
ItemInstance | get_equipped_weapon_from_slot( slot_def: EquipmentSlotDefinition ) |
Array[ItemInstance] | get_equipped_weapons() |
bool | has_any_weapon_equipped() |
bool | has_weapon_equipped_in_slot( slot_def: EquipmentSlotDefinition ) |
void | sync_animation_state() |
Dictionary | get_animation_tags() |
String | get_stance_tag() |
String | get_attack_tag() |
Array[LootRule] | get_loot_rules() |
int | run_loot_rules( trigger: LootRule.Trigger, receiver: Entity = null ) |
bool | has_pending_loot() |
void | entity_death( announce: bool = true ) |
void | resurrect() |
void | set_pointer_over( over: bool ) |
void | set_current_target_hover() |
void | set_current_target_on() |
void | set_current_target_off() |
void | set_map_marker_icon( type: Entity.MapMarkerType ) |
String | get_footstep_swim_override() |
String | get_footstep_surface_override() |
String | get_current_surface_type() |
Dictionary | to_save_data() |
void | from_save_data( save_data: Dictionary, system_hub: GameHost.SystemHub ) |
Signals ​
entity_damage_incoming( damage_amount: float, damage_type: int, damage_source: Variant, effect: EffectInstance ) ​
Damage signals - forwarded from StatsComponent
entity_taken_damage( damage_amount: int, damage_source: Variant, effect: EffectInstance, damage_type: int ) ​
Emitted when the entity takes damage: the amount, who or what dealt it, the effect and the damage type.
entity_health_changed( new_health: int ) ​
Emitted when the health of the entity changes, with the new health.
entity_damage_absorbed_by_pool( pool_id: int, amount: float, damage_type: int, damage_source: Variant, effect: EffectInstance ) ​
Emitted when a pool other than health (a shield) absorbs damage: the pool, the amount, the damage type, the source and the effect.
entity_healing_applied( pool_id: int, amount: float, healing_source: Variant, effect: EffectInstance ) ​
Healing signals - forwarded from StatsComponent
entity_hit_dealt( result: DamageResult ) ​
Resolved hits and heals: ONE signal each carrying the typed result (see DamageResult / HealingResult). The result holds the outcome (hit, avoided, immune ...), every amount, and the trigger records (dodge, block, crit). Combat feedback, proc effects and event triggers all read these.
entity_hit_received( result: DamageResult ) ​
Emitted with the full result of a hit the entity received (see DamageResult).
entity_heal_dealt( result: HealingResult ) ​
Emitted with the result of a heal the entity gave to someone.
entity_heal_received( result: HealingResult ) ​
Emitted with the result of a heal the entity received.
entity_landed( fall_height: float ) ​
Death signal - forwarded from StatsComponent via mediator Emitted when the entity has just died, before its effects are removed: death procs (and a resurrection) run on it. entity_died follows The entity came down from a fall: how far it fell (metres)
entity_dying( entity: Entity ) ​
The entity is dying (its health reached 0)
entity_died( entity: Entity ) ​
Emitted when the entity dies.
entity_corpse_restored( entity: Entity ) ​
A saved corpse was put back on load: its death is not announced again (entity_died would count a kill, ask the party for a respawn ...), only what shows a corpse listens
damage_reflected( attacker: Variant, amount: float, effect: EffectInstance ) ​
The damage reflection of this entity hit an attacker (the attacker, the damage, the effect) and the damage reflection of someone else hit this entity (the bearer, the damage, the effect)
reflected_damage_taken( bearer: Variant, amount: float, effect: EffectInstance ) ​
Emitted when the entity takes damage that was reflected back by a target.
entity_resource_changed( new_resource: int ) ​
Resource signals - forwarded from StatsComponent
pool_added( pool_instance: PoolInstance, pool_type: String ) ​
Emitted when a pool is added to the entity (a health or a resource pool).
pool_removed( pool_id: int, pool_type: String ) ​
Emitted when a pool is removed from the entity.
entity_stat_changed( stat_id: int, old_value: float, new_value: float ) ​
Stat signals - forwarded from StatsComponent
target_update( new_target: Variant ) ​
Targeting signal - Entity-level emission
effect_gained( effect_instance: EffectInstance ) ​
Effect signals - forwarded from EffectsComponent
effect_updated( effect_instance: EffectInstance ) ​
Emitted when an effect on the entity changes (a new stack, a refreshed duration).
effect_lost( effect_instance: EffectInstance ) ​
Emitted when an effect on the entity ends or is removed.
immunity_activated( immunity_id: int, duration: float, immunity_type: ImmunityDefinition.ImmunityType, protected_targets: Array[int] ) ​
Immunity signals - forwarded from ImmunityComponent via StatsComponent
immunity_deactivated( immunity_id: int, immunity_type: ImmunityDefinition.ImmunityType, protected_targets: Array[int] ) ​
Emitted when a temporary immunity of the entity ends: the immunity, its type and what it protected against.
ability_cooldown_started( ability_name: String, duration: float ) ​
Ability cooldown signals - forwarded from AbilityComponent
global_cooldown_started() ​
Emitted when the global cooldown of the entity starts.
global_cooldown_ended() ​
Emitted when the global cooldown of the entity ends.
pet_gained( pet: Pet ) ​
Pet signals - forwarded from PetManagerComponent
pet_lost( pet: Pet ) ​
Emitted when a pet of the entity is lost (dies or is dismissed).
equipment_changed( item: ItemInstance, item_slot: EquipmentSlotDefinition, equipped: bool ) ​
Equipment signal - forwarded from EquipmentComponent
entity_item_received( item_instance: ItemInstance, slot_index: int ) ​
Inventory change signals - forwarded from InventoryComponent
entity_item_removed( item_instance: ItemInstance, quantity: int ) ​
Emitted when items leave the bag of the entity: the item and how many.
entity_dealt_damage( effect: EffectInstance, target: Variant ) ​
Entity action signals - Entity-level emissions (not from components)
entity_heal_cast( effect: EffectInstance, target: Variant ) ​
Emitted when the entity casts a heal on a target.
entity_cast_resurrection( target: Variant, healing_applied: float, effect: EffectInstance ) ​
Emitted on the caster of a resurrection (the revived entity, the health it came back with)
entity_resurrected( resurrector: Variant, healing_applied: float, effect: EffectInstance ) ​
Emitted on the entity that was brought back to life (who revived it, the health it came back with)
stat_active_state_changed( target: Variant, stat_ids: Array, is_active: bool ) ​
Emitted on the entity whose stats a SetStatActiveState effect switched on or off (the stats, the new state)
damage_redirected_away( guardian: Variant, amount: float, effect: EffectInstance ) ​
Damage redirection (a guardian takes hits for someone): on the protected entity, on the guardian, and on the attacker
damage_redirected_to_self( protected: Variant, attacker: Variant, amount: float, effect: EffectInstance ) ​
Emitted when damage meant for another entity is redirected to this one (a guardian ability).
damage_was_redirected( protected: Variant, guardian: Variant, amount: float, effect: EffectInstance ) ​
Emitted when damage that would hit this entity is redirected to its guardian.
entity_ability_cast( ability: AbilityInstance, target: Variant ) ​
Emitted when the entity casts an ability on a target.
entity_basic_attack_cast() ​
Emitted when the entity uses its basic attack.
entity_casting( ability: AbilityInstance ) ​
Emitted when the entity starts casting an ability that takes time.
entity_stop_casting() ​
Emitted when the entity stops casting, finished or not.
entity_interrupted() ​
Emitted when the cast of the entity is interrupted.
entity_activity_started( label: String, timer: Timer ) ​
The entity is busy with something that takes time and shows a progress bar (using an object): the timer runs it. The cast bars show it
entity_activity_ended( completed: bool ) ​
The activity ended: it was finished (true) or cancelled (false)
entity_gathered( node: InteractableObject ) ​
The entity gathered from a gathering node
entity_leveled_up( entity: Entity ) ​
Level progression signals - Player-specific
pointer_over_changed( target: Variant, over: bool ) ​
Emitted when the pointer starts or stops being over this (its body or its nameplate): what the entity tooltip follows
entity_xp_changed( player: Player, experience: int, experience_requirement: int ) ​
Emitted when the experience of a player changes: the player, the experience and what the next level needs.
entity_interacted() ​
Interaction signal - Entity-level emission
entity_was_interacted_with( by: Entity ) ​
Somebody interacted with this entity (an NPC that is talked to): the entity that did it. (entity_interacted is the one of the entity that interacts)
entity_combat_state_changed( entity: Entity, in_combat: bool ) ​
Combat state signal - Entity-level emission (routed TO mediator for component coordination)
entity_selection_state_changed( is_current: bool, is_selected: bool ) ​
Selection state signal - Entity-level emission for UI/camera systems
entity_item_used( item_instance: ItemInstance ) ​
Item usage signals - emitted directly from ItemInstance
entity_item_consumed( item_instance: ItemInstance, amount: int ) ​
Emitted when the entity uses up items (a potion): the item and how many.
entity_item_depleted( item_instance: ItemInstance ) ​
Emitted when the last item of a stack is used up.
ground_lock_changed( locked: bool ) ​
Emitted when the entity is frozen because there is no solid ground under it, or let go again.
movement_mode_changed( old_mode: MovementClaim.Mode, new_mode: MovementClaim.Mode ) ​
Emitted when the way the entity moves changes (it enters water, leaves it, starts flying ...)
breath_changed( current: float, maximum: float ) ​
Emitted when the breath changes (seconds left, seconds in all). Only while the entity holds its breath or recovers it
drowning_changed( is_drowning: bool ) ​
Emitted when the breath runs out (the entity starts to drown) and when it is back (it stops)
Enumerations ​
enum MapMarkerType ​
The kinds of mark an entity can have on the mini map.
- ENTITY =
0 - QUEST_NPC =
1 - QUEST_GIVER =
2 - TREASURE =
3 - INTERACTABLE_RESOURCE =
4 - INTERACTABLE_QUEST =
5 - RABBITHOLE =
6
enum FaceTargetSpeed ​
How fast the entity turns to look at something: instantly, or smoothly at one of the speeds.
- SLOW =
0 - AVERAGE =
1 - FAST =
2 - INSTANT =
3
enum TurnSource ​
What is turning the entity: its own navigation (it faces where it walks) or direct input (the mouse look of a player).
- NAVIGATION =
0 - DIRECT_INPUT =
1
Constants ​
floatHEAVY_HIT_SHARE =0.25- A hit that takes this share of the entity's health at once is a heavy hit (the voice call Hit, heavy)floatGROUND_CHECK_INTERVAL =0.25- How often the ground under the entity is looked at (seconds).floatMOVING_SPEED_THRESHOLD =0.1- Horizontal speed (units per second) above which the entity counts as movingintANIMATION_FOOTSTEP_GRACE_MSEC =2000- Seconds an animation call keeps the footsteps made from movement quiet (the animations make their own)floatLANDING_MIN_AIR_SECONDS =0.25- Seconds in the air before a landing is heard (a step off a kerb, or the drop at the spawn, makes no sound)floatJUMP_MIN_UP_SPEED =1.0- Upward speed (units per second) at which leaving the ground counts as a jumpStringSWIM_SURFACE ="water"- The kind of ground a swimmer's strokes sound like when the water does not say (the folder of the swim sounds)
Property descriptions ​
UniqueEntityData unique_data ​
The record of this entity in the world (a placed NPC): its overrides, position and spawn settings. Empty for an entity that is not placed.
EntityDefinition : definition ​
What kind of entity this is: the NPC, the character or the interactable definition it was made from.
Variable descriptions ​
float jump_velocity = 4.5 ​
Jump velocity applied when jump() is called
bool is_initialized = false ​
True once initialize_entity has run and the entity has its components.
String: display_name ​
The name shown above the entity and in the interface. The name of the entity. An entity that was named by hand keeps that name (the character a player made, which is a name the player typed and is never translated). Any other entity shows the name of its placed NPC or of its definition when the name is asked for, so it is in the language of the player and follows a change of language
Variant target ​
The entity or object this entity has targeted now (null when none).
int spawn_level_override = 0 ​
The level of the entity. Changing it recomputes the growth of its stats and pools. The level a spawner gave this NPC when it made it (0 = the level of its definition or its placed NPC). It is read when the NPC starts and keeps the level from then on.
int current_level = 0: ​
No description yet.
AbilityInstance casting_ability = null: ​
The ability the entity is casting now (null when it is not casting).
FactionDefinition faction ​
The faction of the entity. It decides who it attacks and who it helps.
Entity last_damage_source = null ​
Track last entity that damaged this entity (for kill credit)
Dictionary meta_data = ​
Free-form values behaviour tasks and conditions read and write (the Set Metadata task, the Metadata condition); saved with the entity
bool is_active = false ​
True while the entity is active in the world (an inactive one is hidden and does nothing).
bool is_dead = false ​
True when the entity is dead.
bool currently_moving = false ​
True while the entity is moving.
bool in_combat = false ​
True while the entity is in combat.
CombatSession current_encounter = null ​
The combat session the entity takes part in (null outside combat).
EffectInstance active_movement_effect = null ​
The movement effect (a charge, a leap) that is moving the entity now, if any.
bool immobile = false ​
True when something holds the entity still (it cannot move or turn on its own).
bool cast_immobile = false ​
True while the entity is casting an ability that does not let it move.
bool is_falling = false ​
True while the entity is in the air.
bool is_crouched = false ​
True while the entity is crouched.
bool: is_swimming ​
True while the entity moves freely in 3D (swimming or flying): it uses the swim animations. Set by what the entity is in (a movement volume), see add_movement_claim.
bool is_walking = false ​
True while the entity walks (instead of running).
bool: is_flying ​
True while the entity is flying (nothing pulls it down).
bool is_climbing = false ​
True while the entity is climbing a ladder.
bool fleeing = false ​
True while the entity runs away (afraid).
bool incapactiated = false ​
True while the entity is incapacitated (stunned or asleep): it cannot act.
bool disoriented = false ​
True while the entity is disoriented (it moves in a random direction).
bool is_stealthed = false: ​
True while the entity is hidden from others. Setting it tells the rig and the nameplate.
GameplayConfig.LODLevel lod_level = GameplayConfig.LODLevel.HIGH_DETAIL: ​
Current LOD level - managed by ObjectRegistry during batch optimization
GameplayConfig.FogState fog_state = GameplayConfig.FogState.VISIBLE: ​
Current fog state - managed by FogOfWarSystem
bool is_current_player = false: ​
Whether this Player is the currently selected player character
bool is_fog_hidden = false ​
Whether this entity is currently hidden due to fog
EntityComponentRegistry components ​
The components of the entity (stats, abilities, effects, inventory, equipment, rig, states ...), made when it is initialized.
CollisionShape3D entity_collision ​
The collision shape of the body of the entity.
Decal map_marker ​
The mark under the entity that shows on the mini map.
Nameplate: nameplate ​
Nameplate - delegated to EntityComponentRegistry for centralized lifecycle management
Marker3D: nameplate_marker ​
Nameplate marker - delegated to EntityComponentRegistry
ChronoManager chrono_manager ​
SystemRefs
WorldContainer world_container ​
TODO: it's just 1 method, we should be able to get data from collision
bool ground_locked = false ​
True while there is no solid ground under the entity (the terrain makes the ground solid only round the players): it stands still and does not fall. See Gameplay Config > NPC LOD System > Terrain Range.
float ground_locked_seconds = 0.0 ​
How long it has been frozen (seconds), for whatever works out where it would be by now (a later system).
float seconds_stationary = 0.0 ​
How long the entity has been standing still, in seconds (0 while it moves). For the Movement State condition
float seconds_moving = 0.0 ​
How long the entity has been moving without stopping, in seconds (0 while it stands still)
Array[Entity] temporarily_hostile_to = [] ​
Entities this one is hostile to for now, whatever its faction says (see make_hostile_to)
Array[int] runtime_entity_tags = [] ​
Tags added or removed while the game runs (an effect that makes a target Undead); the definition's tags are separate
Array[int] suppressed_entity_tags = [] ​
Tags removed while the game runs even though the definition has them
Array[MovementClaim] movement_claims = [] ​
What is asking something of the movement of the entity (see MovementClaim)
MovementClaim.Mode: movement_mode ​
How the entity moves now: on the ground, swimming or flying
MountSession mount_session = null ​
The ride this entity is in as a rider. Null when it is not riding
Array[MountSession] ridden_sessions = [] ​
The rides on this entity when it is a mount or a vehicle: one for each rider that sits on it
Array[MountSession] crew_sessions = [] ​
The seats of this entity that an AI crew acts for while nobody sits in them (see MountCrew)
bool mount_hijackable = false ​
A vehicle that is hostile to a character can be boarded by it and taken over (see MountDefinition.hijackable, which sets the first value). An event or an effect changes it
bool mount_hijackable_ready = false ​
True once the Mount of this entity has given its starting value to mount_hijackable (so a loaded value is not overwritten)
FactionDefinition faction_before_mount = null ​
The faction this entity had before the rider of its first seat gave it theirs (null when it has its own). The rider of seat 0 commands the vehicle: while it sits the vehicle is of its faction
Dictionary pending_mount_state = ​
What a save says about the ride of this entity as a rider, kept until the mounts are put back together (see MountSaves)
bool breath_exempt = false ​
An entity that never needs to hold its breath (a water creature: set it from a script). A WaterBreathingEffect holds it for a while instead, see hold_breath_exempt
bool leaves_footprints = true ​
Does this entity leave footprints where the ground takes them (turn it off for a ghost, a spirit, something that floats)
float breath = -1.0 ​
Seconds of breath left. -1 = full (the breath is not worked out until it is needed)
AimProvider aim_provider = null ​
Where this entity is aiming (see AimProvider). The controller of the player in control sets a CameraAimProvider; null = aim at the target
Array loot_rolled = [] ​
The numbers of the loot rules that have rolled (a rule on Initialize or First Access rolls once). Saved with the NPC
Method descriptions ​
int get_unique_id() ​
The id of the unique record of the entity (its place in the world), or -1 when it has none.
void initialize_entity( system_hub: GameHost.SystemHub ) ​
Builds the entity from its definition: resolves its template, makes its components, faction, abilities, bag and equipment, and sets it up. Called once when the entity is made.
void update_movement_tracking( delta: float ) ​
Counts how long the entity has been moving or standing still (called every physics frame)
bool is_moving() ​
True while the entity moves on the ground plane faster than MOVING_SPEED_THRESHOLD (falling alone is not moving)
void turn_by( delta_yaw: float ) ​
Direct turn for player mouse-look: applies delta_yaw (radians) immediately and re-bases target_rotation on the result, so the physics-step smoothing above has nothing left to "correct". The controller must be the only thing integrating mouse-look yaw (the camera reads rotation.y, it never writes it). NPCs and navigation keep using target_rotation / current_turning via NavigationController.command_look_at.
bool request_facing_yaw( yaw: float, speed: int = FaceTargetSpeed.INSTANT ) ​
Smooth/instant automatic facing (navigation, abilities, behaviour tasks, effects). This is the single entry point NavigationController.command_look_at and entity_face_direction go through. Returns false if a mouse-look lease is blocking automatic facing. NPCs never take a lease, so for them this behaves exactly as the old inline code did.
void begin_direct_facing( block_auto_face: bool ) ​
Mouse-look lease, held by the controller for the duration of an RMB look. block_auto_face = true: automatic facing (see request_facing_yaw and is_auto_facing_blocked) is ignored while held. block_auto_face = false: automatic facing still works, and turn_by() yields until that turn completes. Only the player's controller should call this.
void end_direct_facing() ​
Ends the mouse look: the entity turns on its own again.
bool is_auto_facing_blocked() ​
True while a mouse-look lease is ignoring automatic facing. Systems that rotate the entity directly (NavigationController velocity facing) check this before writing rotation.
bool is_turning() ​
True while the entity is turning: an automatic turn in progress, or a mouse-look turn within the last FacingMath.DIRECT_TURN_HOLD_MSEC. Movement-state transitions use this (not current_turning) so turn-in-place does not flap between mouse events and physics ticks.
bool is_turn_in_progress() ​
True while a smooth turn is still being applied (set by request_facing_yaw / turn_by, cleared when the turn reaches its target or stop_turning is called). Unlike is_turning it has no hold.
float get_target_facing_yaw() ​
The yaw the current smooth turn is heading for (equals rotation.y when not turning)
void stop_turning() ​
Ends any smooth turn in progress (the entity stays where it is facing now)
void apply_facing_yaw( yaw: float ) ​
Sets the facing directly and keeps the turn target in sync, without starting a turn. For controllers that already smooth the rotation themselves (e.g. lock-on turning every frame).
void apply_velocity_facing_yaw( yaw: float ) ​
Sets the facing to follow the direction of travel (NavigationController velocity facing). The caller does the smoothing; this marks navigation as the turn source and leaves any turn target alone.
void set_active_state( system_hub: GameHost.SystemHub, active: bool ) ​
Makes the entity active or inactive. An inactive entity is hidden, does not think and is not saved as alive.
void resume_behavior_system() ​
Resume the behavior system using the new architecture
void pause_behavior_system() ​
Pause the behavior system using the new architecture
GameplayConfig.LODLevel get_lod_level() ​
Get current LOD level
bool is_high_detail() ​
Check if entity is at high detail LOD
bool is_lod_culled() ​
Check if entity is culled (no updates)
GameplayConfig.FogState get_fog_state() ​
Get current fog state
bool is_fog_visible() ​
Check if entity is currently visible (not hidden by fog)
bool is_in_explored_fog() ​
Check if entity is in explored fog (seen before but not currently visible)
bool is_in_shroud() ​
Check if entity is in shroud (never seen)
int get_current_level() ​
Get current level
int get_max_level() ​
Get maximum level
void set_entity_level( new_level: int ) ​
Set entity level and apply rewards
void level_up() ​
Level up a specific player
float get_stat( stat_id: int ) ​
The current value of a stat, with every bonus and multiplier.
bool has_stat( stat_id: int ) ​
Does the entity have this stat?
Array[int] get_stat_ids_in_group( group_id: int ) ​
The ids of the stats the entity has in a stat group.
bool add_stat_bonus( stat_id: int, amount: float ) ​
Adds a flat amount to a stat (a negative amount takes away). False when the stat does not exist.
bool add_stat_multiplier( stat_id: int, amount: float ) ​
Adds to the multiplier of a stat (the percent change is added to what is there).
bool set_stat_multiplier( stat_id: int, multiplier: float ) ​
Sets the multiplier of a stat as a percent (100 = no change).
bool is_hostile_to( other: Variant ) ​
Is other an enemy of this entity: its faction is hostile to the other's, or the two are temporarily hostile
bool is_neutral_to( other: Variant ) ​
Neither friend nor foe: the factions are neutral to each other and there is no temporary hostility
bool can_attack( other: Variant ) ​
Can this entity attack other on purpose (aiming an ability or clicking): enemies, and neutrals and scenery for the player. Friends never
void make_hostile_to( other: Entity ) ​
From now on this entity and other are enemies, until one of them leaves combat (or dies)
void end_temporary_hostility() ​
Ends every temporary hostility this entity is part of (it left combat or died)
Array[int] get_entity_tags() ​
The type tags of this entity (EntityTagDefinition ids): its definition's, plus the ones added at runtime, minus the removed
Array[int] get_ui_tag_ids() ​
The ids of the entity tags of this entity: its definition's, plus the ones of its placed NPC, minus the ones the placed NPC takes away
Array[UITagDefinition] get_ui_tags() ​
The entity tags of this entity (what the interface reads to show it: Boss, Elite, Rare ...)
bool has_ui_tag( tag: Variant ) ​
Does the entity have this entity tag? By the key of the tag ("boss") or its id
int get_proficiency_level( proficiency_id: int ) ​
The level of a proficiency (swords, heavy armor, lockpicking). Only players train proficiencies; any other entity has the starting level of the proficiency. Player overrides this. Conditions and requirements ask this, and a UI can too
int get_spoken_language_id() ​
The language this entity speaks (the id of a language proficiency), 0 = none. An NPC speaks the language of its definition
bool has_entity_tag( tag_id: int ) ​
Does the entity have this entity type tag? A tag of the definition counts unless it was taken away at run time.
void add_entity_tag( tag_id: int ) ​
Gives the entity a tag at run time (it stays in the save).
void remove_entity_tag( tag_id: int ) ​
Takes a tag away at run time, even one the definition gives.
void sync_type_effects() ​
Puts the effects of the types the entity has on it, and takes off the ones of the types it no longer has. Called when the entity is made and when a type is added or taken away
Dictionary entity_tags_to_save() ​
The tags added or removed while playing (the definition's own tags come back from the definition)
void entity_tags_from_save( data: Dictionary ) ​
Restores the tags added and taken away at run time from a save.
float modify_gain( channel: String, amount: float ) ​
What this entity gains on a gain channel (see GainChannels): experience, currency, loot, threat ...
int modify_gain_int( channel: String, amount: int, probabilistic: bool = false ) ​
modify_gain for whole numbers; probabilistic turns a fraction into a chance of one more
bool set_stat_base( stat_id: int, value: float ) ​
Sets the base value of a stat (what the value is before bonuses).
void set_custom_gravity( new_gravity: float ) ​
Gives the entity a gravity of its own (a floating creature, a slow fall).
void reset_custom_gravity() ​
Gives the entity the gravity of the project again.
float get_custom_gravity() ​
The gravity of the entity: its own when set, else the project's.
float get_weapon_damage() ​
The weapon damage stat of the entity (what its weapon or its body hits for).
float roll_weapon_damage() ​
Rolls the weapon damage within its variance: the damage of one swing.
bool has_weapon_equipped() ​
Does the entity have weapon damage above zero?
int get_equipped_weapon_damage_type() ​
Get the damage type from the first equipped weapon, or empty string if none
bool has_weapon_with_damage_type( damage_type: int ) ​
Check if any equipped weapon deals a specific damage type
float get_current_health() ​
The current health (the current value of the master pool).
float get_max_health() ​
The maximum health (the maximum of the master pool).
float get_health_percentage() ​
The health as a percentage of the maximum.
bool is_health_below( threshold: float ) ​
Is the health percentage below the threshold?
bool is_health_above( threshold: float ) ​
Is the health percentage above the threshold?
float get_pool_current( pool_id: int ) ​
The current value of a pool.
float get_pool_max( pool_id: int ) ​
The maximum value of a pool.
float get_pool_percentage( pool_id: int ) ​
The value of a pool as a percentage of its maximum.
Dictionary can_afford_resource( pool_id: int, amount: float ) ​
Can the entity pay this amount from the pool? The answer says whether it can and, when it cannot, why.
bool has_pool( pool_id: int ) ​
Does the entity have this pool?
bool is_master_pool( pool_id: int ) ​
Is this the master pool of the entity (the one whose emptying kills it)?
PoolInstance get_master_pool() ​
The master pool of the entity (health).
float add_pool_value( pool_id: int, amount: float ) ​
Adds an amount to a pool, up to its maximum. Gives back what was added.
bool remove_pool_value( pool_id: int, amount: float ) ​
Takes an amount from a pool. False when the entity has no such pool.
bool is_resource_pool( pool_id: int ) ​
Is the pool a resource pool (mana, rage) and not a health pool?
Array[int] get_resource_pool_ids() ​
The ids of the resource pools of the entity.
AbilityInstance get_ability_by_id( ability_id: int ) ​
The ability instance of the entity with this ability id, or null.
bool has_ability_by_id( ability_id: int ) ​
Does the entity know this ability?
AbilityInstance get_basic_attack() ​
The basic attack of the entity.
Array[AbilityInstance] get_active_abilities() ​
The active abilities of the entity.
Array[AbilityInstance] get_passive_abilities() ​
The passive abilities of the entity.
bool add_ability( ability: AbilityInstance ) ​
Gives the entity an ability instance (an active or a passive one).
bool swap_basic_attack( ability: AbilityInstance ) ​
Replaces the basic attack of the entity.
bool remove_basic_attack() ​
Takes the basic attack away.
bool remove_ability_by_id( ability_id: int ) ​
Takes an ability away by its id.
bool move_to_position( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) ​
Moves the entity to a position and waits until it gets there (true) or the path fails (false). Stops a cast first. A minimum distance stops it short.
bool move_keep_facing( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) ​
Moves to a position without turning to the direction of the movement.
bool backpedal_to( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) ​
Moves to a position walking backward, facing the same way.
bool strafe_to( target_pos: Vector3, strafe_direction: int, should_walk: bool = false, min_distance: float = -1.0 ) ​
Moves to a position sideways (left or right), facing the same way.
bool follow_target( target_to_follow: Node3D, min_distance: float = 2.0, should_walk: bool = false ) ​
Follows a node at a distance until it is told to stop.
bool move_to_position_sync( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) ​
Synchronous movement to position (no await) - for behavior tasks
bool move_keep_facing_sync( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) ​
Synchronous movement keeping facing direction - for behavior tasks
bool backpedal_to_sync( target_pos: Vector3, should_walk: bool = false, min_distance: float = -1.0 ) ​
Synchronous backpedal movement - for behavior tasks
bool strafe_to_sync( target_pos: Vector3, strafe_direction: int, should_walk: bool = false, min_distance: float = -1.0 ) ​
Synchronous strafe movement - for behavior tasks
void stop_moving() ​
Stops the movement of the entity.
void jump() ​
Performs a jump if the entity is on the floor Uses the exported jump_velocity value
bool is_free_moving() ​
Is the entity moving freely in 3D (swimming or flying)? Gravity does not pull it and it can go up and down
MovementClaim get_active_movement_claim() ​
The claim that decides how the entity moves now: the one with the highest mode (the later of two equal ones), or null when it is on its own. A short suspension (a leap out of the water) ignores every claim
void add_movement_claim( claim: MovementClaim ) ​
Makes something a claim on the movement of the entity (a second claim of the same source replaces the first)
bool remove_movement_claim( source: Object ) ​
Takes the claim of a source away. True when it had one
MovementClaim get_movement_claim_of( source: Object ) ​
The claim a source has on this entity, or null
Vector3 get_flow_velocity() ​
How fast the water or the wind carries the entity now: the flows of all its claims added (a river and a gust). Nothing during a leap out of the water
float get_movement_speed_multiplier() ​
What the movement is multiplied by now (wading is slower, swimming too): 1 when nothing asks for it
void suspend_movement_claims( seconds: float ) ​
Ignores every movement claim for a moment (the leap out of the water must not be pulled back in at once)
void leap_out_of_water() ​
Swimming up at the surface and jumping: the entity leaps out of the water. Only where the claim allows it and the entity is near the surface
bool is_mounted() ​
Is this entity riding something?
bool is_ridden() ​
Is something riding this entity (it is a mount or a vehicle with a rider)?
bool is_carried_by_mount() ​
Is this entity carried by a creature or a vehicle (it does not move by itself)? False for a rider on a mount that is only a model
Entity get_mount() ​
The creature or vehicle this entity rides, or null
Entity get_rider() ​
The rider of the seat that steers this mount (or the first rider when no seat steers), or null
Array[Entity] get_riders() ​
Everybody who rides this entity
bool is_seat_taken( seat_index: int ) ​
Does somebody sit on this seat of the mount (0 is the first)?
int get_free_seat_index( seat_count: int ) ​
The first free seat of a mount that has seat_count seats, or -1 when it is full
MountSession start_mount( definition: MountDefinition, mount_entity: Entity = null, drive_logic: DriveLogic = null, seat_index: int = -1, force: bool = false ) ​
Gets on a mount. Without a mount entity the mount is a model and a speed (the Mount effect); with one, the entity sits on a seat of it (the first that is free, or the one you give) and, on a seat that steers, the player steers it (see MountSession). A DriveLogic of your own steers it instead of the one of the definition. A vehicle that is hostile to this entity and not hijackable refuses it, unless force is true. Returns the ride, or null when it cannot be done
bool dismount( reason: String = "" ) ​
Gets off the mount. False when this entity is not riding
bool uses_breath() ​
Does this entity hold its breath where a volume asks for it? The Gameplay Config says who (nobody, the players, everyone); an exempt entity never does
bool is_breath_exempt() ​
Does the entity breathe where there is no air: it is exempt for good (breath_exempt), or an effect holds it
void hold_breath_exempt( hold: bool ) ​
A WaterBreathingEffect takes (true) or gives back (false) the exemption. Taking it saves an entity that is drowning: its breath is full at once
float get_breath_maximum() ​
The seconds of breath the entity has in all (the Gameplay Config)
float get_breath() ​
The seconds of breath left
bool is_drowning() ​
True while the breath is run out and the drowning effect is on the entity
void set_submerged( value: bool ) ​
Tells the entity it is under water (or needs air) this frame: a movement volume calls it every physics frame it applies. When it stops, the breath comes back
void restore_breath() ​
Gives the breath back at once (a potion, a breath of air): nothing is left of the drowning
int get_navigation_domain() ​
Where this entity can go (EntityDefinition.NavigationDomain): the party members are always amphibious, an NPC goes by its definition
GameHost.SystemHub get_system_hub() ​
The hub of the game systems this entity was made with (or null before it was made)
void entity_face_direction( look_at_direction: Vector3, speed: int = FaceTargetSpeed.INSTANT ) ​
Turns the entity to a direction, at a speed (instantly by default).
void entity_look_at_object( object: Node3D, speed: int = FaceTargetSpeed.INSTANT ) ​
Turns the entity to look at a node, at a speed (instantly by default).
void set_approach_distance( distance: float ) ​
Sets how close the entity gets to its target before it stops moving.
MovementState get_movement_state() ​
The movement state of the entity now (idle, moving, falling, climbing ...).
void change_movement_state( state_name: MovementStateComponent.MovementStateName ) ​
Puts the entity in a movement state.
Dictionary get_aim( max_range: float = 0.0 ) ​
Where the entity aims now (a ray to a point or an entity), through its aim provider, up to a maximum range (0 = the ability's own).
void request_action_state_change( state_name: ModularCombatScript.ActionStateName, data: Dictionary = {} ) ​
Asks the combat script of the entity to go to an action state (attack, flee, dead ...) with data. A dead entity only accepts the dead state.
void set_stealth_prevention( prevent: bool ) ​
Stops the entity from being stealthed (true) or lets it again (false). It counts: two reasons need two releases.
bool is_stealth_prevented() ​
Does something stop the entity from being stealthed now?
bool is_immobile() ​
Can the entity not move now: held, casting in place or rooted?
void cast_interrupted() ​
Interrupts the cast of the entity.
void stop_cast() ​
Stops the cast of the entity.
void set_target( new_target: Variant ) ​
Targets an entity or object (or nothing). The marks and the target frame follow.
void enter_combat( target_entity: Entity = null ) ​
Puts the entity in combat, against a target when it has one. A dead entity cannot.
void exit_combat() ​
The fight is over for the entity: a neutral that was attacked is neutral again.
void change_combat_state( value: bool ) ​
Sets whether the entity is in combat and tells the components.
void set_encounter( encounter: CombatSession ) ​
Set the current encounter and notify all combat reactions
void leave_encounter() ​
Remove entity from current encounter
Node3D get_attachment_point_node( location: VFXSelection.VfxLocation ) ​
The node of the model where a visual effect attaches (a hand, the head, the feet).
DamageResult take_damage( result: DamageResult ) ​
Completes the DamageResult for a hit on this entity (see StatsComponent.take_damage). Returns null if it aborted
HealingResult take_healing( result: HealingResult ) ​
Completes the HealingResult for a heal on this entity (see StatsComponent.take_healing). Returns null if it aborted
bool can_apply_school_effect( school_id: int, source_entity: Variant = null, effect: EffectInstance = null ) ​
Can an effect of this school land on the entity (it is not immune and not locked)?
String get_weapon_animation_tag() ​
The animation tag of the weapon in hand (the attack tag of its weapon class, or of the NPC), "unarmed" without one
EffectInstance get_effect( effect_id: int ) ​
The effect of the entity with this effect id, or null.
EffectInstance get_effect_from_caller( effect_id: int, originator: Entity ) ​
The effect with this id that this originator put on the entity, or null.
void reduce_effect_stacks( effect_instance: EffectInstance, stacks_to_remove: int ) ​
Takes stacks off an effect (the effect ends when none is left).
Array[EffectInstance] get_active_effects_by_type( effect_type: String ) ​
The active effects of one effect type (the class name of the type).
Array[EffectInstance] get_all_active_effects() ​
A copy of the list of the active effects of the entity.
void remove_all_effects() ​
Removes every effect from the entity.
Dictionary apply_status_effect( status_effect: int, base_duration: float, source_entity: Variant = null, effect: EffectInstance = null ) ​
Asks the stat system whether a status lands and for how long (immunity, tenacity, diminishing returns): {can_apply, effective_duration, ...}
bool is_immune_to_status_effect( status_effect_id: int ) ​
Is the entity immune to this status effect?
bool is_immune_to_damage_type( damage_type: int ) ​
Is the entity immune to this damage type?
bool is_immune_to_school_type( school_id: int ) ​
Is the entity immune to this school?
bool activate_immunity( immunity_id: int, duration: float = -1.0 ) ​
Turns an immunity on, for a duration (a negative one lasts until it is turned off).
bool deactivate_immunity( immunity_id: int ) ​
Turns an immunity off.
bool is_incapacitated() ​
Crowd control is answered by the status types the effects component counts as active (see StatusEffect)
bool is_silenced() ​
Is the entity silenced (it cannot cast)?
bool is_rooted() ​
Is the entity rooted (held, rooted or incapacitated)?
bool is_crippled() ​
Is the entity crippled?
bool is_blinded() ​
Is the entity blinded?
bool is_fleeing() ​
Is the entity under a flee effect?
bool is_disoriented() ​
Is the entity disoriented?
bool is_disarmed() ​
Is the entity disarmed (it cannot use its weapon)?
Dictionary get_status_effect_summary() ​
A summary of the status effects on the entity.
Array[String] get_active_status_effects() ​
The names of the status types active on the entity.
bool has_any_cc_effects() ​
Is the entity under any crowd control?
bool has_movement_impairing_effects() ​
Does an effect or a hold keep the entity from moving freely?
bool has_ability_blocking_effects() ​
Does an effect keep the entity from using abilities?
bool can_use_weapon_abilities() ​
Can the entity use abilities that need a weapon (it is neither disarmed nor incapacitated)?
InventoryComponent get_inventory() ​
The inventory component of the entity.
bool has_inventory() ​
Does the entity have an inventory?
int count_item( item_id: int ) ​
How many of an item (by definition id) the entity carries in its inventory
bool equip_item( item_instance: ItemInstance, forced: bool = false ) ​
Equips an item in a fitting slot. Forced skips the requirements.
bool equip_item_to_slot( item_instance: ItemInstance, slot_data: EquipmentSlotInstance, forced: bool = false ) ​
Equips an item in a given slot.
ItemInstance unequip_slot( slot_data: EquipmentSlotInstance ) ​
Takes the item out of a slot and gives it back.
bool unequip_item( item_instance: ItemInstance ) ​
Takes an equipped item off.
bool equip_item_instance( item_instance: ItemInstance ) ​
The names the behaviour tasks use for the same two actions
bool unequip_item_instance( item_instance: ItemInstance ) ​
The same as unequip_item.
Array[ItemInstance] get_equipped_items() ​
Every item the entity wears.
void clear_all_equipment() ​
Takes everything off.
Array[EquipmentSlotInstance] get_equipment_slots_by_definition( slot_def: EquipmentSlotDefinition ) ​
The slots of a slot definition (an entity can have several slots of one kind).
bool has_item_equipped_in_slot_definition( slot_def: EquipmentSlotDefinition ) ​
Is something worn in a slot of this definition?
ItemInstance get_equipped_item_from_slot_definition( slot_def: EquipmentSlotDefinition ) ​
The item worn in the first slot of this definition, or null.
Array[ItemInstance] get_all_equipped_items_from_slot_definition( slot_def: EquipmentSlotDefinition ) ​
Every item worn in the slots of this definition.
ItemInstance get_equipped_weapon_from_slot( slot_def: EquipmentSlotDefinition ) ​
The weapon worn in the slot, or null when the item is not a weapon.
Array[ItemInstance] get_equipped_weapons() ​
Every weapon the entity wears.
bool has_any_weapon_equipped() ​
Does the entity wear a weapon?
bool has_weapon_equipped_in_slot( slot_def: EquipmentSlotDefinition ) ​
Is a weapon worn in this slot?
void sync_animation_state() ​
Synchronize animation state with current entity configuration Call this after equipment changes (Player) or on initialization (NPC)
Dictionary get_animation_tags() ​
Virtual method to get animation tags for this entity Override in subclasses (NPC, Player) to provide appropriate source Returns a Dictionary with keys: attack_tag, stance_tag, aim_tag, reload_tag, is_ranged Returns empty dictionary if no tags available (will use defaults)
String get_stance_tag() ​
Get the stance tag for combat idle animations Virtual method - override in subclasses for different sources
String get_attack_tag() ​
Get the attack tag for weapon animations Virtual method - override in subclasses for different sources
Array[LootRule] get_loot_rules() ​
The loot rules of the entity: the ones of its placed record when it has them, else the ones of its NPC definition. Empty for anything but an NPC.
int run_loot_rules( trigger: LootRule.Trigger, receiver: Entity = null ) ​
Rolls the loot rules of a trigger into the inventory of this NPC (see LootDispatcher). receiver is whoever gets the loot: it changes the amount and the quality by its loot gains and can give the item level. Returns how many rules rolled. Players and pets have no loot rules
bool has_pending_loot() ​
Is there a loot rule of this NPC that rolls the first time its inventory is opened (a pocket picked, a body looted) and has not rolled yet?
void entity_death( announce: bool = true ) ​
announce false puts a saved corpse back (loading): the entity becomes a corpse but nobody is told it died
void resurrect() ​
Brings the dead entity back to life (at full health) and restores its state.
void set_pointer_over( over: bool ) ​
The pointer went over this or left it. Several things can hold it (the body and the nameplate): the signal is emitted when it goes from nothing holding it to something
void set_current_target_hover() ​
Shows the hover mark on the entity (the mouse is over it).
void set_current_target_on() ​
Shows the target mark on the entity, in the color of its relation to the player.
void set_current_target_off() ​
Takes the target marks off the entity.
void set_map_marker_icon( type: Entity.MapMarkerType ) ​
Sets the picture of the mini map mark of the entity.
String get_footstep_swim_override() ​
What the water sounds like to a swimmer, when a movement volume it swims in says so (Footstep Swim): the kind of ground, or "" when nothing says
String get_footstep_surface_override() ​
What the ground sounds like where the entity is, when a movement volume it is in says so (a shallow water, a mud, see the Sound group of the volume): the kind of ground, or "" when nothing says. The volume with the highest priority wins, of two equal ones the later. Nothing during a leap out of the water.
String get_current_surface_type() ​
The kind of ground under the entity (for footsteps), from the terrain of the current world.
Dictionary to_save_data() ​
The state of the entity for a save (a dead entity saves a short record).
void from_save_data( save_data: Dictionary, system_hub: GameHost.SystemHub ) ​
Restores the entity from a save: position, health, effects, abilities, bag and equipment.