Skip to content

EntityDefinition ​

Inherits: DatabaseResource < Resource

Inherited by: CharacterDefinition, NPCDefinition

EntityDefinition contains all visual, audio, and display configuration for entities This serves as the base class for NPCDefinition and CharacterDefinition

Properties ​

PackedSceneentity_model
Vector3model_scaleVector3(1.0, 1.0, 1.0)
EntityCollisionShapeentity_collision_shapeEntityCollisionShape.NORMAL
NavigationDomainnavigation_domainNavigationDomain.AMPHIBIOUS
Texture2Dfootprint_texture
Stringanimation_type""
Array[String]animation_packages["core", "ability_animations", "transitions"]
Stringselected_voice_type""
Stringfootstep_entity_type""
Array[int]entity_tags[]
intspoken_language_id0
Array[int]ui_tags[]
booltemplatefalse

Methods ​

Vector3get_collision_size( shape: EntityCollisionShape ) static
voidset_entity_name( new_name: String )
Stringget_entity_name()
voidset_entity_id( new_id: int )
intget_entity_id()
voidset_animation_type( new_animation: String )
Stringget_animation_type()
voidset_animation_packages( new_animation_packages: Array[String] )
Array[String]get_animation_packages()
voidset_entity_model( new_model: PackedScene )
PackedSceneget_entity_model()
boolhas_entity_model()
voidset_model_scale( new_scale: Vector3 )
Vector3get_model_scale()
voidset_uniform_model_scale( scale: float )
voidset_collision_shape( new_shape: EntityCollisionShape )
EntityCollisionShapeget_collision_shape()
Stringget_collision_shape_name()
boolhas_voice_type_selection()
voidclear_voice_type_selection()
voidset_voice_type_selection( entity_type: String, voice_variant: String )
Stringget_voice_entity_type()
Stringget_voice_variant()
boolhas_footstep_entity_type()
voidclear_footstep_entity_type()
boolis_template()
Stringget_display_name()
boolis_valid()

Enumerations ​

enum EntityCollisionShape ​

========== ENUMS ==========

  • TINY = 0
  • SMALL = 1
  • NORMAL = 2
  • LARGE = 3

enum NavigationDomain ​

Where the navigation of an entity goes (NavigationController): Amphibious walks and swims (the default: it never enters lava, it crosses deep water by swimming), Land walks only (it goes round deep water and lava), Water lives in the water and cannot walk (a fish, a sea monster: it moves over the surface of the water and is stuck on land). The party is always amphibious. See docs: World > Movement volumes > Navigation.

  • AMPHIBIOUS = 0
  • LAND = 1
  • WATER = 2

Constants ​

  • Dictionary COLLISION_SIZES = { - The capsule of every collision shape: x = radius, y = height, z = how high the capsule's centre is above the entity's feet. The one table the collision, the navigation bake and the navigation agents read.

Property descriptions ​

Visual Configuration

PackedScene entity_model ​

3D model/skeleton scene for this entity

Vector3 model_scale = Vector3(1.0, 1.0, 1.0) ​

Scale multiplier applied to the entity model

EntityCollisionShape entity_collision_shape = EntityCollisionShape.NORMAL ​

Collision shape size category for physics interactions

NavigationDomain navigation_domain = NavigationDomain.AMPHIBIOUS ​

Where this kind of entity can go: walk and swim (Amphibious), walk only (Land) or swim only (Water). The party members are always Amphibious

Texture2D footprint_texture ​

The picture of one footprint of this kind of entity (a boot sole, a paw, a hoof): a white shape on a transparent background, the toes pointing up. The ground tints it and says how long it stays. Empty = this entity leaves no footprints

Animation Configuration

String animation_type = "" ​

Animation type identifier for DatabaseAnimation lookup

Array[String] animation_packages = ["core", "ability_animations", "transitions"] ​

Animation packages to include (core, ability_animations, transitions, etc.)

Audio Configuration

String selected_voice_type = "" ​

Voice audio selection in format "entity_type/voice_variant" (e.g. "humanoid/voice_humanoid_masculine_01")

String footstep_entity_type = "" ​

Footstep audio entity type for DatabaseAudio lookup (e.g. "humanoid", "beast")

Array[int] entity_tags = [] ​

Type tags of this kind of entity (Humanoid, Beast, Undead ...): EntityTagDefinition ids. Conditions read them

int spoken_language_id = 0 ​

The language this kind of entity speaks (the id of a proficiency that is a language). Its lines are in that language: a listener who does not understand it reads them garbled. 0 = none

Array[int] ui_tags = [] ​

The entity tags of this kind of entity (UITagDefinition ids: Boss, Elite, Rare ...): labels with no effect on the entity that the interface reads to show it differently (the unit frame, the nameplate, the map icon). A placed NPC can add tags and take some away (UniqueEntityData)

bool template = false ​

True when this definition is a template: other definitions follow it and it is not placed in the world.

Method descriptions ​

Vector3 get_collision_size( shape: EntityCollisionShape ) ​

The capsule of a collision shape: x = radius, y = height, z = the height of its centre above the feet.

void set_entity_name( new_name: String ) ​

Set entity display name

String get_entity_name() ​

Get entity display name

void set_entity_id( new_id: int ) ​

Set entity ID

int get_entity_id() ​

Get entity ID

void set_animation_type( new_animation: String ) ​

Set animation type

String get_animation_type() ​

Get animation type

void set_animation_packages( new_animation_packages: Array[String] ) ​

Set animation packages

Array[String] get_animation_packages() ​

Get animation packages

void set_entity_model( new_model: PackedScene ) ​

Set entity model

PackedScene get_entity_model() ​

Get entity model

bool has_entity_model() ​

Check if entity has a model

void set_model_scale( new_scale: Vector3 ) ​

Set model scale (ensures positive values)

Vector3 get_model_scale() ​

Get model scale

void set_uniform_model_scale( scale: float ) ​

Set uniform scale for all axes

void set_collision_shape( new_shape: EntityCollisionShape ) ​

Set collision shape

EntityCollisionShape get_collision_shape() ​

Get collision shape

String get_collision_shape_name() ​

Get collision shape name as string

bool has_voice_type_selection() ​

Check if voice type is selected

void clear_voice_type_selection() ​

Clear voice type selection

void set_voice_type_selection( entity_type: String, voice_variant: String ) ​

Set voice type selection

String get_voice_entity_type() ​

Get voice entity type

String get_voice_variant() ​

Get voice variant

bool has_footstep_entity_type() ​

Check if footstep entity type is set

void clear_footstep_entity_type() ​

Clear footstep entity type

bool is_template() ​

Check if this EntityDefinition is a template

String get_display_name() ​

Get display name appropriate for templates vs entities

bool is_valid() ​

Validates that all required entity configuration is present