User Tools

Site Tools


set_entity_property

Set Entity Property


Sets a custom property for an entity to the specified value. This property can then be referenced elsewhere, for example when evaluating a condition. When editing this function in the Script Editor, the Variable Expression Builder provides an easy way to choose which value you'd like to assign to the property. These properties can also be given values via assignment statements (i.e. the “Assign Value” visual script node) or even pre-defined with initial startup values from their Entity Properties panel in the Map Editor.

Signature:

set_entity_property(entity, property_name, property_value)
ArgumentDescriptionTypeRequired
entityEntity on which the property will be stored.EntityYes
property_nameName of the property.StringYes
property_valueValue that will be assigned to the property.String, Number, BooleanYes

You can also store general, game-wide properties that are not specific to a tile, object, or character. For more information, see Set Global Property.

Example:

set_entity_property("chest01", "opened", true);

Results: A property is stored on the “chest01” entity with a Boolean value of “true”.

Use the Set Entity Property function to keep track of important information about specific entities, for example whether an NPC has already been visited by the player.


Editor Node:

Visual Demo:

set_entity_property.txt · Last modified: 2021/04/21 18:51 by justin