User Tools

Site Tools


object

Object


An object is a resource type meant for certain entities that can be interacted with by the player as well as for those that are simply decorations to place onto tiles. Objects, similar to tiles and characters, are created in the Voxel Editor and then placed into a map using the “Place” mode of the Map Editor. Refer to the table below for some examples of what should be represented as an object in your game.

UsageExamples
Interactive EntitiesTreasure chests (or other containers), signs, doors, levers, switches
DecorationsTables and chairs (or other furniture), trees, bushes, fences
Item PickupsA key or potion within the world that will provide an item to the player

Scripting

Refer to the table below for a list of object properties that can be accessed from a script. If the property's value can be changed using an assignment statement, it will be noted in the description.

PropertyDescription
<object>.idEntity ID of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the ID of the object.
<object>.typeType of entity, in this case the constant value OBJECT.
<object>.coordCoordinate of the object.
<object>.directionCardinal direction (NORTH, SOUTH, WEST, EAST) in which the object is rotated. The default direction of an entity is SOUTH.
<object>.tilesAn array of tiles that the object is currently occupying.
<object>.groupsAn array of groups to which the object is assigned. The array will be empty if the object is not assigned to any groups.
<object>.tagsAn array of tags (as strings) for the object, as set in the Voxel Editor from the Model Properties panel.
<object>.interact_cursorInteraction cursor for the object, 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 object. Valid values include “default”, “walk”, “interact”, “speak”, “attack”, or any custom cursor defined in your game configuration.
<object>.property[“x”]Custom property stored on the object, where “x” is a string containing the name of the property. This can be used to either retrieve or change the property's value.
<object>.modelName of the object's model (e.g. “tree”).
<object>.frameCurrent 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.
<object>.animationName of the animation currently playing for this object (as a string). Value will be null if no animation is playing.
<object>.animationsAn array of animation names defined for this object. The names will be string values.
<object>.attach_pointsAn array of attach point names defined for this object (across all animation frames). The names will be string values. The array will be empty if no attach points are defined.
<object>.attachment[“x”]Object attached to the object, where “x” is the attach point ID.
<object>.effect[“x”]Effect attached to the object, where “x” is the attach point ID.
<object>.texturesAn array of texture names defined for this object. The names will be string values.
<object>.scaleScale of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the scale of the object. When changing the scale, an array with three numeric values (X, Y, Z) is expected.
<object>.scale_xX scale of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the X scale of the object.
<object>.scale_yY scale of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the Y scale of the object.
<object>.scale_zZ scale of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the Z scale of the object.
<object>.offsetOffset of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the offset of the object. When changing the offset, an array with three numeric values (X, Y, Z) is expected.
<object>.offset_xX offset of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the X offset of the object.
<object>.offset_yY offset of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the Y offset of the object.
<object>.offset_zZ offset of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the Z offset of the object.
<object>.rotationRotation of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the rotation of the object. When changing the rotation, an array with three numeric values (X, Y, Z) is expected.
<object>.rotation_xX rotation of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the X rotation of the object.
<object>.rotation_yY rotation of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the Y rotation of the object.
<object>.rotation_zZ rotation of the object, as set in the Map Editor from the Entity Properties panel. This can be used to either retrieve or change the Z rotation of the object.
object.txt · Last modified: 2024/03/14 09:41 by justin