Skip to content

Interactable objects (Map)

jjppof edited this page Sep 3, 2023 · 22 revisions

Interactable objects

These are the properties that can be set when creating an Interactable Object in Tiled. Interactable object properties set here will override those ones in database file.

General properties

  • key_name [string]: the interactable object key name.
  • label [string]: a unique key name for this interactable object instance.
  • storage_keys [object]: some properties can also be set by storage values. The value of each property below should receive a storage value key name as value. The properties specified on this storage_keys property override the original ones set outside of it.
    • position: [storage_key_name]: the x and y position of this interactable object.
    • base_collision_layer: [storage_key_name]: see base_collision_layer in this doc to see what this property does.
    • enable: [storage_key_name]: see enable in this doc to see what this property does.
    • animation: [storage_key_name]: see animation in this doc to see what this property does.
    • entangled_by_bush: [storage_key_name]: see entangled_by_bush in this doc to see what this property does.
  • x [number]: the tile x position.
  • y [number]: the tile y position.
  • anchor_x [number]: x anchor of the sprite. 0 is 0%, 1 is 100%, see.
  • anchor_y [number]: y anchor of the sprite. 0 is 0%, 1 is 100%, see.
  • scale_x [number]: x scale of the sprite. 0 is 0%, 1 is 100%, see.
  • scale_y [number]: y scale of the sprite. 0 is 0%, 1 is 100%, see.
  • dock_tile_position [object]: if set, this interactable object will forever dock its position. Only works with pushables. position and base_collision_layer storage keys need to be set.
    • x [number]: the tile x position to dock.
    • y [number]: the tile y position to dock.
    • collision_layer [number]: the collision layer to dock.
  • has_shadow [boolean]: whether this IO has a shadow or not. Default is false.
  • action [string]: initial action key name. Example: "pound_pillar".
  • animation [string]: initial animation key name. Examples "rock_pound_pillar", "stone_pound_pillar", "ice_pillar"...
  • base_collision_layer [number]: the collision layer index where the object is.
  • intermediate_collision_layer_shift [number]: this number will be added to base_collision_layer. Any related events that need an intermediate layer will use this property.
  • collision_layer_shift [number]: this number will be added to base_collision_layer. Any related events that need an upper layer will use this property.
  • block_climb_collision_layer_shift [number]: this number will be added to base_collision_layer. If this property is set, a collision block will be created in the resulting collision layer.
  • allowed_tiles [array]: array of objects that specifies allowed tiles that this interactable object can be positioned in:
    • type [string]: whether this tile specification is for a single tile or a rectangular range. Must be one of the following: "tile" or "rect". Optional property. Default is "tile".
    • x [number]: the tile x position. Only required if type was set with "tile".
    • y [number]: the tile y position. Only required if type was set with "tile".
    • x0 [number]: the initial x position of the rect range. Only required if type was set with "rect".
    • y0 [number]: the initial y position of the rect range. Only required if type was set with "rect".
    • x1 [number]: the final x position of the rect range. Only required if type was set with "rect".
    • y1 [number]: the final y position of the rect range. Only required if type was set with "rect".
    • collision_layer [number]: the collision layer index that the posision(s) set are allowed. Required property.
  • not_allowed_tiles [array]: array of tiles where related events won't be created:
    • x [number]: the tile x position.
    • y [number]: the tile y position.
  • events_info [object]: some extra properties to be defined when describing the events that this object creates. These events are defined in the interactable objects database file by the events property. This database property is an array, so in order to identify which event an extra property that will be set here belongs, is necessary to specify the index of the event of the event array in database file. Example: "events_info": {"0": "collision_layer_shift": 2}}, so the event of index 0 will have the collision_layer_shift property set to 2.
    • active [bool]: if it's initially active or not.
    • x_shift [number]: the amount of x shift in tile size relative to the event position.
    • y_shift [number]: the amount of y shift in tile size relative to the event position.
    • top_event_y_shift [number]: property only for "climb" type. The relative y position of the top side of the ladder.
    • collision_tiles_relative_pos [array]: property only for "climb" type. If necessary, create collision bodies around the stair. Positions are relative. dynamic property needs to be set to true.
      • x [number]: x tile position relative to origin position.
      • y [number]: y tile position relative to origin position.
    • collision_layer_shift [number]: the event collision layer will be shifted by the amount passed by this property.
    • intermediate_collision_layer_shift [number]: property only for "climb" type. If there's a specific collision layer for climbing, use this property to specify the shift from the base collision layer.
    • activation_directions [array]: property only for "rope" type. The array of directions that this event can be activated. It can be "up", "down", "left" and "right".
    • walk_over_rope [bool]: property only for "rope" type. If true, the hero will walk over the rope instead of climb.
    • rope_collision_layer [number]: property only for "rope" type. The rope specific collision layer.
    • dock_exit_collision_layer [number]: property only for "rope" type. The collision layer that the hero will be on exit of rope.
  • allow_jumping_over_it [boolean]: if true, a jump event won't be stopped if the jump target location has this interactable object. Default if false.
  • allow_jumping_through_it [boolean]: if true, a jump event won't be stopped if the location between the jump start and target locations has this interactable object. Default if false.
  • object_drop_tiles [object]: property only valid for pushable interactable objects. This property is an object that defines the behavior of an interactable object drop when pushing it.
    • x [number]: x tile position that the interactable object needs to be in order to fall.
    • y [number]: y tile position that the interactable object needs to be in order to fall.
    • destination_collision_layer [number]: the interactable object destination collision layer after fall.
    • animation_duration [number]: the duration of the drop in ms.
    • dest_y [number]: the y tile position the interactable object will be on fall end.
    • dust_animation [boolean]: whether some dust will be shown when the interactable object touches the ground.
    • water_animation [boolean]: whether this interactable object will fall in the water.
  • active [boolean]: if false, this interactable object won't be visible, won't have a collision body and the hero can't interact with it. Default is true.
  • enable [boolean]: if false, this interactable object is on the map, but the hero can't interact with it. Default is true.
  • toggle_enable_events [array]: this property is an array of objects that will hold Game Events that will be activated on this interactable object enabling or disabling.
    • on_enable [boolean]: if true, this event will be fired on this interactable object enable.
    • event [object]: the Game Event description. See Game Event section to have more info.
  • entangled_by_bush [boolean]: if true, this interactable object will be entangled by a bush.
  • affected_by_reveal [boolean]: if true, this interactable object will be affected by Reveal. Reveal psynergy will toggle this IO active property.
  • after_push_events [array]: this property is an array of objects that will hold Game Events that will be activated when this interactable object is manually pushed, not by psynergy. Optional property.
  • psynergies_info [object]: an object of psynergy keys that this Interactable Object interacts with and the associated settings of the specified psynergy.
    • [ability key name] [object]: ability key name as the object key
      • destination_collision_layer [number]: Property only valid for Lift field psynergy. The collision layer index that the target Interactable Object (probably Lift Rock) will be after it got lifted. Default if current index plus one.
      • destination_y_pos [number]: Property only valid for Lift field psynergy. The y tile position that the target Interactable Object (probably Lift Rock) will be after it gets lifted. Default if current y tile position minus two.
      • before_psynergy_cast_events [array]: list of Game Events objects that will be fired in sequence before the specified psynergy gets cast. See Game Event section to have more info.
      • after_psynergy_cast_events [array]: list of Game Events objects that will be fired in sequence after the specified psynergy gets cast. See Game Event section to have more info.
Clone this wiki locally