Property | Description |
<character>.id | Entity ID of the character, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the ID of the character. |
<character>.type | Type of entity, in this case the constant value CHARACTER. |
<character>.name | Name of the character, as set in the Voxel Editor from the Model Properties panel. This can be used to either retrieve or change the name of the character. |
<character>.behavior | Behavior for the character, as set in the Map Editor from the Entity Properties panel. The character's behavior can be changed by assigning a string value to this property containing the behavior preset name. When accessing this property, a codex will be returned, allowing modification of individual behavior settings. See NPC Behavior for more details. |
<character>.stat[“x”] | Value of a stat for the character, where “x” is a string containing the ID of the stat. This can be used to either retrieve or change the stat's value. |
<character>.attack_cooldown | Override for the character's attack cooldown. This value will be null by default, which indicates that the character's attack will use either the global cooldown (see “Attack Cooldown” settings in the Combat Editor), the character model's cooldown, or their equipped weapon's cooldown. If a value is assigned to this property, it will override their current cooldown. |
<character>.skills | An array of skills currently possessed by the character. The array will contain string values, specifically the ID of each skill. The array will be empty if the character doesn't possess any skills. This can be used in a “contains” conditional expression to check if a character has a specific skill. |
<character>.statuses | A codex of status effects currently applied to the character. Each key is a status effect ID (e.g. “STATUS_0001”) and its corresponding value is a codex of that status effect's properties. The codex will be empty if the character doesn't have any status effects applied. This can be used in a “contains” conditional expression to check if a character has a specific status effect. |
<character>.quests | An array of quests currently assigned to the character. The array will contain string values, specifically the ID of each quest. The array will be empty if the character doesn't have any quests. |
<character>.portrait | Portait image for the character, as set in the Voxel Editor from the Model Properties panel. This can be used to either retrieve or change the portrait image for the character. |
<character>.coord | Coordinate of the character. |
<character>.direction | Cardinal direction (NORTH, SOUTH, WEST, EAST) in which the character is rotated. The default direction of an entity is SOUTH. |
<character>.tiles | An array of tiles that the character is currently occupying. |
<character>.groups | An array of groups to which the character is assigned. The array will be empty if the character is not assigned to any groups. |
<character>.tags | An array of tags (as strings) for the character, as set in the Voxel Editor from the Model Properties panel. |
<character>.interact_cursor | Interaction cursor for the character, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the interaction cursor for the character. Valid values include “default”, “walk”, “interact”, “speak”, “attack”, or any custom cursor defined in your game configuration. |
<character>.property[“x”] | Custom property stored on the character, where “x” is a string containing the name of the property. This can be used to either retrieve or change the property's value. |
<character>.model | Name of the character's model (e.g. “purple_slime”). |
<character>.frame | Current animation frame (as a number, with the first frame being 1). This can be used to either retrieve or change the model's current frame. If this property is changed and an animation is playing, the animation will first be stopped. |
<character>.animation | Name of the animation currently playing for this character (as a string). Value will be null if no animation is playing. |
<character>.animations | An array of animation names defined for this character. The names will be string values. |
<character>.attach_points | An array of attach point names defined for this character (across all animation frames). The names will be string values. The array will be empty if no attach points are defined. |
<character>.attachment[“x”] | Object attached to the character, where “x” is the attach point ID. |
<character>.effect[“x”] | Effect attached to the character, where “x” is the attach point ID. |
<character>.textures | An array of texture names defined for this character. The names will be string values. |
<character>.front_tile | Tile in front of the character relative to their current direction (if one is connected via navigation, otherwise null is returned). |
<character>.back_tile | Tile behind the character relative to their current direction (if one is connected via navigation, otherwise null is returned). |
<character>.left_tile | Tile to the left of the character relative to their current direction (if one is connected via navigation, otherwise null is returned). |
<character>.right_tile | Tile to the right of the character relative to their current direction (if one is connected via navigation, otherwise null is returned). |
<character>.north_tile | Tile to the north of the character (if one is connected via navigation, otherwise null is returned). |
<character>.south_tile | Tile to the south of the character (if one is connected via navigation, otherwise null is returned). |
<character>.west_tile | Tile to the west of the character (if one is connected via navigation, otherwise null is returned). |
<character>.east_tile | Tile to the east of the character (if one is connected via navigation, otherwise null is returned). |