Skip to content

Game Events

jjppof edited this page May 1, 2024 · 130 revisions

Description

Game Event is a type of event that controls the flow of the game. This class of events can interact and manipulate storage values, chars, interactable objects, start dialogs, move NPCs, get djinn and summons, control audio, set chests, create particles, generic sprites, and many more features. Game Events can be fired from Tile Events, NPC or Interactable Objects interaction, map changes, or other game events.

Example of a "emoticon" event followed by a "dialog" event:

{
    "type": "emoticon",
    "emoticon": "unhappy",
    "finish_events": [{
        "type": "dialog",
        "dialog_info" : {
            "text": "Now I'm tired... Call me another day so I can teach you Warp."
        }
    }]
}

A Game Event always has to have the type property set to specify which type of event the engine is dealing with. Also, optionally, you can set the key_name property to give the event you're creating a unique name, so you can identify this event by this key name.

If for some reason you want to start a game event deactivated, you can set the active optional property to false. You can use "event_caller" event later to fire this event at an appropriate time.

Common properties

These are the properties that are common among all Game Event types.

Properties

  • type [string]: the game event type key name. Required property.
  • key_name [string]: sets a unique key name to identify this particular game event. Optional property.
  • keep_reveal [boolean]: by default, a game event when fired stops the Reveal psynergy. If you don't want this behavior, you can optionally set this property to true. Optional property. Default is false.
  • keep_custom_psynergy [boolean]: by default, a game event when fired stops all ongoing custom psynergies. If you don't want this behavior, you can optionally set this property to true. Optional property. Default is false.
  • active [boolean]: whether this game event is initially active or not. Optional property. Default is true.

Event types

"add_item_to_party" event:

Adds an item to the party. The item might not be added if all inventories are full.

Properties

  • item_key [string]: the item key name. Required property.
  • quantity [number]: the quantity to be added. Optional property. Default value is 1.

"audio_play" event:

Plays a BGM or SFX audio.

Properties

  • audio_type [string]: the type of audio you want to play. It must be "sfx" or "bgm". Required property.
  • audio_key [string]: the audio key name. Examples: "madra_bgm", "battle/heal_1". Required property.
  • volume [number]: the execution volume. Optional property. Default value is 1.
  • loop [boolean]: whether the BGM will loop when execution is finished. Only works for BGM audio type. Optional property. Default value is true.
  • fade_in [boolean]: if true, the BGM will fade in on start. Only works for BGM audio type. Optional property. Default value is false.
  • in_parallel [boolean]: if true, this BGM will be played in parallel with current BGM. Only works for BGM audio type. Optional property. Default value is false.
  • bgm_identifier [string]: give an unique name for this BGM so you can control it with "audio_stop" event. Only works for BGM audio type. Optional property.
  • finish_events [array]: a list of Game Events that will be fired when audio execution finishes. Optional property.

"audio_stop" event:

Stops or pauses a BGM audio.

Properties

  • bgm_identifier [string]: the unique name of the BGM you want to control. Please see "bgm_identifier" property under "audio_play" event. Required property.
  • fade_out [boolean]: if true, the BGM will fade out instead of stopping immediately. Optional property. Default value is false.
  • pause_only [boolean]: if true, this BGM will be just paused instead of a full stop. Optional property. Default value is false.

"battle" event:

Starts a battle.

Properties

  • background_key [string]: the battle background key name. Required property.
  • enemy_party_key [string]: the enemy party key name. Required property.
  • return_to_sanctum [boolean]: if true, the hero will return to the last visited sanctum after battle defeat. Optional property. Default value is true.
  • bgm [string]: the battle bgm key. Required property.
  • reset_previous_bgm [boolean]: if true, the previous bgm will be restarted after the battle finishes. Optional property. Default value is true.
  • all_enemies_fled_events [array]: a list of Game Events that will be fired when the battle finishes after all enemies have fled. Optional property.
  • victory_events [array]: a list of Game Events that will be fired when the battle finishes with victory after the fadeout. Optional property.
  • defeat_events [array]: a list of Game Events that will be fired when the battle finishes with defeat after the fadeout. Optional property.
  • before_fade_victory_events [array]: a list of Game Events that will be fired when the battle finishes with victory before the fadeout. Optional property.
  • before_fade_defeat_events [array]: a list of Game Events that will be fired when the battle finishes with defeat before the fadeout. Optional property.

"branch" event:

Checks and compare many kinds of values in the engine. The values to be checked can be literals, storage values, tile event, main char, hero, NPC, and interactable object properties values.

Properties

  • combination [string]: the boolean operator that will be used to combine the list of comparisons set in "comparator_pairs" property. Optional property. Default is "or". Must be one of these:
    • "or"
    • "and"
  • comparator_pairs [array]: the list of comparisons that this event will perform. This list items is combined by what's set in "combination" property. Required property.
    • condition [string]: the type of comparison that will be done between parties. Required property. Must be one of these:
      • "=": equal
      • ">=": equal or greater
      • "<=": equal or less
      • ">": greater
      • "<": less
      • "!=": different
    • left_comparator_value [object]: the left side of the comparison. Required property.
      • type [string]: the type of the value: "value", "storage", "game_info". Required property.
      • value [string|boolean|number|object]: the actual value. Required property. If you set the above "type" property as "value", then you can set here a literal value of string, boolean, or number types. Otherwise, set an object with below properties:
        • type [string]: the type of object you want to retrieve the value from. It's only valid if you set the above "type" property as "game_info". It must be one of the following values: "char" for main char info, "hero" for hero info, "npc" for NPC info, "event" for Tile Event info, and "interactable_object" for Interactable Object info. Optional property.
        • key_name [string]: the main char key name if you set the just above "type" property as "char". Otherwise, if you set the topmost "type" property as "storage", you have to set the storage key name. Optional property.
        • label [string]: the NPC, Interactable Object, or Tile Event unique key name if you set the just above "type" property as "npc", "event" or "interactable_object". Optional property.
        • property [string]: the property name that you want to retrieve if you're not getting a storage value. Examples: it can be "max_hp" if you dealing with main chars, it can be "jumping" if you're dealing with NPC or hero, or it can also be "x" if you're dealing with Tile Events. Optional property. See the list of accessible properties here.
    • right_comparator_value [object]: the right side of the comparison. Required property. For details, check left_comparator_value property description.
  • events [array]: a list of Game Events that will be fired if the comparison gets satisfied. Required property.
  • else_events [array]: a list of Game Events that will be fired if the comparison does not get satisfied. Optional property.

Examples

Checks if the storage key alex_walked is equal to false:

{
    "type": "branch",
    "comparator_pairs": [{
      "condition": "=",
      "left_comparator_value": {
          "type": "storage",
          "value": {
              "key_name": "alex_walked"
          }
      },
      "right_comparator_value": {
          "type": "value",
          "value": false
      }
    }],
    "events": [{}],
    "else_events": [{}]
}

Checks if Isaac's attack is greater than Garet's defense:

{
    "type": "branch",
    "comparator_pairs": [{
      "condition": ">",
      "left_comparator_value": {
          "type": "game_info",
          "value": {
              "type": "char",
              "key_name": "isaac",
              "property": "atk"
          }
      },
      "right_comparator_value": {
          "type": "game_info",
          "value": {
              "type": "char",
              "key_name": "garet",
              "property": "def"
          }
      }
    }],
    "events": [{}],
    "else_events": [{}]
}

Checks if Alex NPC y position is different from Tile Event labeled by init_event_mars_lighthouse y position:

{
    "type": "branch",
    "comparator_pairs": [{
      "condition": "!=",
      "left_comparator_value": {
          "type": "game_info",
          "value": {
              "type": "npc",
              "label": "alex",
              "property": "y"
          }
      },
      "right_comparator_value": {
          "type": "game_info",
          "value": {
              "type": "event",
              "label": "init_event_mars_lighthouse",
              "property": "y"
          }
      }
    }],
    "events": [{}],
    "else_events": [{}]
}

"camera_fade" event:

Fades the camera in and out.

Properties

  • fade_type [string]: the type of fade the camera will do. Must be one of the following: "in" or "out". Required property.
  • duration [number]: the duration of the fade transition in ms. Optional property. Default value is 500.
  • color [string]: the fade color. Set the number as a string but in hexa, example: "0xfff". Optional property. Default is "0x0" (black).
  • finish_events [array]: a list of Game Events that will be fired when fade is complete. Optional property.

"camera_follow" event:

Toggles camera following. The camera can follow the hero, NPCs, or Interactable Objects.

Properties

  • follow [boolean]: whether it's going to turn on or off the camera following. Optional property. Default value is true. If this property is set to false, no other property needs to be set.
  • is_hero [boolean]: whether the camera will be following the hero or not. Optional property. Default value is true. If this property is set to true, npc_label and io_label properties can't be set.
  • npc_label [string]: the unique NPC key name. Optional property. Don't set this property if is_hero property is set to true. If this property is set, io_label property can't be set.
  • io_label [string]: the unique Interactable Object key name. Optional property. Don't set this property if is_hero property is set to true. If this property is set, npc_label property can't be set.
  • transition_duration [number]: the transition duration in ms that the camera will take to translate from current position to the target when start following. Optional property. Default value is 0.
  • transition_end_events [array]: a list of Game Events that will be fired after the camera transitions end on follow start. Optional property.

"camera_move" event:

Moves the camera freely by following a sequence of given positions.

Properties

  • positions [array]: an array of objects containing the below properties that will designate the positions to be reached. Required property.
    • x [number]: the x position in px. Optional property. If not passed, will get the current camera x position.
    • y [number]: the y position in px. Optional property. If not passed, will get the current camera y position.
    • duration [number]: the transition duration in ms from current position to the position given at this point. Optional property. Default value is 500.
    • easing [string]: the type of easing that the transition will follow. Optional property. Default value is Linear.None which is a linear transition. Available values for this property:
      • "Linear.None"
      • "Quadratic.In"
      • "Quadratic.Out"
      • "Quadratic.InOut"
      • "Cubic.In"
      • "Cubic.Out"
      • "Cubic.InOut"
      • "Quartic.In"
      • "Quartic.Out"
      • "Quartic.InOut"
      • "Quintic.In"
      • "Quintic.Out"
      • "Quintic.InOut"
      • "Sinusoidal.In"
      • "Sinusoidal.Out"
      • "Sinusoidal.InOut"
      • "Exponential.In"
      • "Exponential.Out"
      • "Exponential.InOut"
      • "Circular.In"
      • "Circular.Out"
      • "Circular.InOut"
      • "Elastic.In"
      • "Elastic.Out"
      • "Elastic.InOut"
      • "Back.In"
      • "Back.Out"
      • "Back.InOut"
      • "Bounce.In"
      • "Bounce.Out"
      • "Bounce.InOut"
  • reset_follow [boolean]: whether the camera will return to follow the previous target that it was following. Optional property. Default value is false.
  • return_to_target_duration [number]: sets the duration in ms of return transition to initial target that the camera was following previously. Optional property. Default value is 0. This property is only valid if reset_follow property is set to true.
  • finish_events [array]: a list of Game Events that will be fired when all camera movements are done. Optional property.

"camera_shake" event:

Turns camera shake on or off.

Properties

  • enable [boolean]: if true, it will enable camera shaking, otherwise will disable it. Required property.

"casting_aura" event:

Turns psynergy casting aura on or off for an NPC or hero.

Properties

  • enable [boolean]: if true, it will enable the casting aura, otherwise will disable it. Required property.
  • is_npc [boolean]: if true, it will toggle the casting aura in an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.

"change_collision_layer" event:

Changes the collision layer of the current map.

Properties

  • target_collision_layer [number]: the target collision layer index. Required property.

"char_animation_play" event:

Starts or stops a char animation.

Properties

  • is_npc [boolean]: if true, it will set animation in an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • action [string]: the animation action key. Optional property. Only valid if stop_animation is not set or it's false.
  • animation [string]: the animation key. Optional property. Only valid if stop_animation is not set or it's false. Remember that this field accepts "up", "down", "left", etc.
  • frame_rate [number]: the animation frame rate. Optional property. Only valid if stop_animation is not set or it's false. Default value is the animation default frame rate value.
  • loop [boolean]: if true, the animation will loop. Optional property. Only valid if stop_animation is not set or it's false. If not set, will use animation default value.
  • stop_animation [boolean]: if true, the animation will be stopped instead of getting started. Optional property. Default value is false.
  • reset_frame_on_stop [boolean]: if true, the animation will return to the first frame when stopped. Optional property. Only valid if stop_animation is set to true. Default value is false.
  • reset_before_start [boolean]: if true, the animation will return to the first frame before being played. Optional property. Only valid if stop_animation is set to false. Default value is true.
  • finish_events [array]: a list of Game Events that will be fired when the animation is finished. Optional property. Only valid if stop_animation is not set or it's false and loop is set to false.

"char_blend_mode" event:

Sets a blend mode for a char sprite.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • blend_mode [string]: a blend mode to be set. Must be one of the following: "normal", "screen", or "multiply". Optional property. Default value is "normal".

"char_exp" event:

Sets or increments the experience points of a char.

Properties

  • char_key [string]: the main char key name. Required property.
  • control_type [string]: whether it's going to increment the current value by a certain amount or will set the given amount absolutely. It must be "increment" or "set_value" Required property.
  • amount [number]: the number of experience points to be added or set. Required property.

"char_fall" event:

Make a char to fall to a specific location in this map or to another map.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • y_destination_position [number]: the y destination the the char will reach when falling. This value must be bigger than char current location. Required property.
  • dest_collision_layer [number]: the collision layer index that the char will be after falling. Optional property.
  • show_exclamation_emoticon [boolean]: if true, will show a exclamation emoticon over the char before he falls. Optional property. Default is false.
  • splash_sweat_drops [boolean]: if true, the char will splash sweat drops before het falls. Optional property. Default is false.
  • walking_in_the_air [boolean]: if true, the char will "walk in the air" before he falls. Optional property. Default is false.
  • ground_hit_animation [boolean]: if true, the char will emit some dust when hitting the ground on fall finish. Optional property. Default is false.
  • teleport [object]: property that will contain teleport info in the case the char will fall to another map. If you don't want to teleport, simply don't set this property. Optional property.
    • destination [string]: the destination map key name. Required property.
    • origin_position [object]: The origin position that the char will be just after the teleport and before reaching destination_position. If not passed, the engine will try to guess this origin position. Optional property.
      • x [number]: the x tile position. Required property.
      • y [number]: the y tile position. Required property.
    • destination_position [object]: the final destination tile position that the char will reach when hitting the ground after falling. Required property.
      • x [number]: the x tile position. Required property.
      • y [number]: the y tile position. Required property.
    • dest_collision_layer [number]: the final collision layer index that the char will be on the target map after teleporting and after falling. Required property.
    • send_to_front_on_teleport [boolean]: if true, the char sprite will on the front of other sprites only while falling in the target map. Optional property. Default is false.
    • diminish_on_transition [boolean]: if true, the char sprite will have your scale set to zero instead of reaching the position specified in the "y_destination_position" property. This only happens in the current map. Optional property. Default value is false.
  • finish_events [array]: a list of Game Events that will be fired when the char hits the ground. These events will only be called if the "teleport" property is not specified. Optional property.

"char_hue" event:

Changes the char sprite HUE angle.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • enable [boolean]: if true, will apply the hue angle, otherwise, will disable the hue filter. Optional property. Default value is true.
  • angle [number]: the HUE angle to be set. Optional property.

"char_item_manipulation" event:

Adds, removes, equips an item, or sets it broken or non-broken for a char. If a char is not specified will apply the chosen action for the first char in the sequence that can have this action applied.

Properties

  • char_key [string]: the main char key name to have his/her items manipulated. If it's not specified, the action will be applied in the first char in the sequence that can have this action applied. Optional property.
  • control_type [string]: sets what type of item manipulation it's going to be. It must be "add", "set_equip", "remove", or "set_broken". Required property.
  • item_key [string]: will add an item with this item key if control_type was set as "add", otherwise will try to find the first item in inventory with this item key. Optional property. This property should not be set with equip_slot and slot_index.
  • slot_index [number]: will try to select an item in the index given by this property. Optional property. This property should not be set with equip_slot and item_key.
  • equip_slot [string]: will try to select an item in the equip slot set by this property. It must be one of these values: , "weapon", "head", "chest", "body", "ring", "boots", "underwear", "class_changer". Optional property. This property should not be set with slot_index and item_key.
  • equip [boolean]: whether it's to equip or not the selected item. Optional property. Only valid if control_type was set with "set_equip" or "add".
  • broken [boolean]: whether it's to set the selected item as broken or not. Optional property. Only valid if control_type was set with "set_broken".
  • amount [number]: the number of items to be added or removed. Optional property. Only valid if control_type was set with "remove" or "add".
  • manipulation_done_events [array]: a list of Game Events that will be fired if the chosen action succeeds. This list will only be called if control_type property is set to "add" or "remove" and, in the case of "remove", it will only be called if char_key property wasn't specified. Optional property.
  • manipulation_fail_events [array]: a list of Game Events that will be fired if the chosen action fails. This list will only be called if control_type property is set to "add" or "remove" and, in the case of "remove", it will only be called if char_key property wasn't specified. Optional property.

"char_level_change" event:

Sets the level of a char to a given value.

Properties

  • target_char_key [string]: the main char key name to have his/her level changed. Required property.
  • target_level_value [number]: the level value to be set. Required property.

"char_rotation" event:

Toggles NPC or hero rotation on z-axis.

Properties

  • is_npc [boolean]: if true, it will rotate an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • rotate [boolean]: if true, this char will rotate on z-axis. Required property.
  • interframe_interval [number]: defines, in ms, the inverval between each frame change. Set -1 if you want that rotation animation changes the char frame in every game tick. Optional property. Default value is -1.
  • frame_index [number]: set the frame index of current animation that will be kept while the char is rotating. Optional property.

"char_shadow_visibility" event:

Controls an NPC or hero shadow visibility.

Properties

  • is_npc [boolean]: if true, it will control the visibility of the shadow of an NPC, otherwise, of the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • visible [boolean]: if true, the shadow won't be visible, otherwise it will be visible. Required property.

"char_splash_sweat_drops" event:

Plays the sweat drops splash animation over the char sprite.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • times [number]: the number of times the animation will be played. Optional property. Default value is 2.
  • finish_events [array]: a list of Game Events that will be fired when the animation finished. Optional property.

"char_tween_position" event:

Tweens an NPC or hero to a given position. Please notice that this is different from "move" event where the char will walk or dash.

Properties

  • is_npc [boolean]: if true, it will tween an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • duration [number]: the tween duration in ms. Required property.
  • ease [string]: the type of easing that the tween will follow. Optional property. Default value is Linear.None which is a linear tween. Available values for this property:
    • "Linear.None"
    • "Quadratic.In"
    • "Quadratic.Out"
    • "Quadratic.InOut"
    • "Cubic.In"
    • "Cubic.Out"
    • "Cubic.InOut"
    • "Quartic.In"
    • "Quartic.Out"
    • "Quartic.InOut"
    • "Quintic.In"
    • "Quintic.Out"
    • "Quintic.InOut"
    • "Sinusoidal.In"
    • "Sinusoidal.Out"
    • "Sinusoidal.InOut"
    • "Exponential.In"
    • "Exponential.Out"
    • "Exponential.InOut"
    • "Circular.In"
    • "Circular.Out"
    • "Circular.InOut"
    • "Elastic.In"
    • "Elastic.Out"
    • "Elastic.InOut"
    • "Back.In"
    • "Back.Out"
    • "Back.InOut"
    • "Bounce.In"
    • "Bounce.Out"
    • "Bounce.InOut"
  • repeat [number]: the number of times this tween will repeat. Optional property. Default value is 0.
  • yoyo [boolean]: if true, this tween will go and back (yoyo effect). Optional property. Default value is false.
  • incremental [boolean]: if true, the value passed to "position" property will be incrementally added to char current position. Optional property. Default value is false.
  • is_px [boolean]: if true, the value passed to "position" property will be in px units instead of tile units. Optional property. Default value is true.
  • position [object]: an object containing the destination position of the tween. Required property.
    • x [number]: the x position destination. Optional property.
    • y [number]: the y position destination. Optional property.
  • hide_shadow [boolean]: if true, it will hide char's shadow on tween start. Optional property. Default value is false.
  • keep_shadow_hidden [boolean]: if true, it will keep char's shadow hidden on tween finish if hide_shadow property is true. Optional property. Default value is false.
  • shadow_follow_char [boolean]: if true, the char's shadow will follow it on tween. Optional property. Default value is true.
  • keep_char_collision_disable [boolean]: this char collision is disabled while the tween is happening. If this property is set to true, the collision of this char won't be activated on tween finish. Optional property. Default value is false.
  • finish_events [array]: a list of Game Events that will be fired when the tween is finished. Optional property.

"chest" event:

This event type manages item-get through standard chests or boxes, pots, etc. It executes the item-get animation and shows the appropriate dialog boxes. When using the standard chest, it must be an NPC with "chest" key name. The event must be fired by NPC interaction in this case.

Properties

  • item_key_name [string]: the item key name to be granted. Required property.
  • quantity [number]: the number of items that will be granted. Optional property. Default value is 1.
  • custom_init_text [string]: the initial dialog text that will be shown when interacting with the chest. Optional property. Default value is for standard chests.
  • no_chest [boolean]: if false, the engine will assume that the NPC that originated this event is a standard chest. Optional property. Default value is false.
  • hide_on_finish [boolean]: if true, the NPC that originated this event will be hidden. Optional property. Default value is false.
  • finish_events [array]: a list of Game Events that will be fired when the entire process is done and the party received the item. Optional property.
  • inventory_full_events [array]: a list of Game Events that will be fired when the inventory of all party is full. Optional property.
  • standard_chest [boolean]: if true, this event will consider that a standard chest NPC is firing this event and its storage_keys.animation property is properly set. In this case, it will automatically manipulate this storage key and retrieve the item if this storage key holds "closed" value. Optional property. Default value is false.

Examples

Madra standard chest:

{
  "key_name": "chest",
  "storage_keys": {
    "animation": "adepts_clothes_chest"
  },
  "x": 14,
  "y": 3,
  "npc_type": "normal",
  "movement_type": "idle",
  "base_collision_layer": 2,
  "events": [{
    "type": "branch",
    "comparator_pairs": [{
      "condition": "=",
      "left_comparator_value": {
        "type": "storage",
        "value": {
          "key_name": "adepts_clothes_chest"
        }
      },
      "right_comparator_value": {
        "type": "value",
        "value": "closed"
      }
    }],
    "events": [{
      "type": "chest",
      "item": "adepts_clothes",
      "finish_events": [{
        "type": "set_value",
        "event_value": {
          "type": "storage",
          "value": {
            "key_name": "adepts_clothes_chest",
            "value": "empty"
          }
        }
      }]
    }],
    "else_events": [{
      "type": "dialog",
      "dialog_info": {
        "text": "${HERO} checked the chest...${BREAK}but the chest was empty."
      }
    }]
  }]
}

The engine also supports a simplified version for standard chests. Please find it below:

{
  "key_name": "chest",
  "storage_keys": {
    "animation": "pound_cube_chest"
  },
  "x": 28,
  "y": 10,
  "npc_type": "normal",
  "movement_type": "idle",
  "base_collision_layer": 2,
  "events": [
    {
      "type": "chest",
      "item": "pound_cube",
      "standard_chest": true
    }
  ]
}

You can replace almost everything from previous example by "standard_chest": true. Please notice that "storage_keys.animation": "pound_cube_chest" needs to be properly set with closed or open values in the storage db file.

"colorize_char" event:

Colorizes the char in a given color. It can also mix with grayscale levels in order to create a saturation effect.

Properties

  • is_npc [boolean]: if true, it will colorize an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • color_key [number]: determines which color will be applied to the char. The value varies between 0 and 1 which represents the below color range. Optional property.

  • intensity [number]: the intensity of the colorization. The value varies between 0 and 1. Optional property. Set it to 0 in order to reset to default.
  • gray [number]: controls the saturation of the char. The value varies between 0 and 1. Optional property. Set it to 0 in order to reset to default.

"colorize_map" event:

Colorizes the map in a given color. It can also mix with grayscale levels in order to create a saturation effect.

Properties

  • color_key [number]: determines which color will be applied to the map. The value varies between 0 and 1 which represents the below color range. Optional property.

  • intensity [number]: the intensity of the colorization. The value varies between 0 and 1. Optional property. Set it to 0 in order to reset to default.
  • gray [number]: controls the saturation of the map. The value varies between 0 and 1. Optional property. Set it to 0 in order to reset to default.
  • duration [number]: the duration to transition to the specified intensity and/or gray properties in ms. Optional property. Default is 500.
  • layer [string]: specify a Tiled layer name if you want to apply the effects only in this layer. Optional property.
  • detach_transition [boolean]: if true, the game won't remain locked while the color transition happens. Optional property. Default is false.
  • finish_events [array]: a list of Game Events that will be fired when the transition is done. Optional property.

"control_bgm" event:

Resumes, pauses, stops or sets BGM volume.

Properties

  • control_type [string]: sets what you want to do with BGM. It must be "resume", "pause", "stop", or "set_volume". Required property.
  • volume [number]: the volume to be set. Optional property. Only valid if control_type was set with "set_volume".

"create_storage_var" event:

Adds or remove a storage value. Good for creating auxiliary variables.

Properties

  • add [boolean]: if true, will create a new storage var, otherwise, it will remove. Optional property. Default is true.
  • var_name [string]: the storage var unique key name. Required property.
  • initial_value [string|number|boolean|object]: the storage var initial value. Optional property. Only valid if add property was set with true. You can set here a literal value of string, boolean, or number types. Otherwise, in the case of "position" type, set an object with "x" and "y" properties designating the position values.

"custom_collision_body" event:

Creates a custom collision body on the map. It can be a box, circle, or polygon. The collision body will be destroyed if the map gets changed.

Properties

  • label [string]: the collision body unique key name. Required property.
  • create [boolean]: if true, will create a body, otherwise it will destroy a body. Required property.
  • x [number]: the x position of the body in px. Optional property. Only valid if create property was set with true.
  • y [number]: the y position of the body in px. Optional property. Only valid if create property was set with true.
  • body_type [string]: the type of the body to be created. It must be one of the following: "box", "circle", or "polygon". Optional property. Only valid if create property was set with true.
  • properties [object]: the body properties. Optional property. Only valid if create property was set with true.
    • collision_layer [number]: the target collision layer for the body to be. Optional property. Default value is current map collision layer.
    • width [number]: the body width in px. Only valid if body_type property was set with "box". Optional property.
    • height [number]: the body height in px. Only valid if body_type property was set with "box". Optional property.
    • radius [number]: the body radius in px. Only valid if body_type property was set with "circle". Optional property.
    • points [array]: list of position points in px to mount the polygon of the body ([[x1, y1], [x2, y2], ... , [xn, yn]]). Points values are relative to x and y properties. Only valid if body_type property was set with "polygon". Optional property. Example [[0,0],[49,15],[21,32]] set in x = 458 and y = 492 position:

"destroyer" event:

Destroys a game event. The target event must be labeled.

Properties

  • target_event_key [string]: the Game Event unique key name. Required property.

"dialog" event:

Creates a sequence of dialogs. Yes/No confirmation can also be set.

Properties

  • dialog_info [object|array]: the dialog text and its properties. It can be an object specified below or an array of objects of the same type. If it's an array, the dialogs will be shown in the sequence of this array. Required property.
    • text [string]: the dialog text. See placeholders below in order to add custom features to the text. Required property.
    • avatar [string]: the avatar key name that will make an avatar to be displayed. Set empty string if you want no avatar to be shown. If not set, it will look for the NPC set in reference_npc property and get its avatar, if reference_npc property is also not set, it will look for the NPC that started this event. If none of these options were satisfied, no avatar is shown. Optional property.
    • voice_key [string]: the voice key name that will make the corresponding voice SFX to be player. Set empty string if you want no voice to be played. If not set, it will look for the NPC set in reference_npc property and get its voice key, if reference_npc property is also not set, it will look for the NPC that started this event. If none of these options were satisfied, no voice is played. Optional property.
    • consider_hero_direction [boolean]: if true, it will consider the hero direction to position the dialog window. Optional property. Default is false. Not valid if custom_pos property is set.
    • sweat_drops [boolean]: if true, the NPC that's talking will show sweat drops. Optional property. Default is false. Not valid if reference_npc property is not set or, if it's the case, not valid if this event origin is not from an NPC.
    • emoticon [string]: if passed, the NPC that's talking will show an emoticon with the given emoticon key in this property. This emoticon will last as long as the dialog passed here lasts. Optional property. Not valid if reference_npc property is not set or, if it's the case, not valid if this event origin is not from an NPC.
    • sfx [string]: if passed, it will play a sfx with this given key. Optional property.
    • reference_npc [string]: a reference NPC unique key name to have its avatar and voice key info retrieved. Optional property.
    • custom_pos [object]: a custom position for the dialog window. Optional property.
      • x [number]: the x position in px relative to camera position. Optional property. Default is the automatic calculated position.
      • y [number]: the y position in px relative to camera position. Optional property. Default is the automatic calculated position.
    • custom_avatar_pos [object]: a custom position for the avatar box. Optional property.
      • x [number]: the x position in px relative to camera position. Optional property. Default is the automatic calculated position.
      • y [number]: the y position in px relative to camera position. Optional property. Default is the automatic calculated position.
  • npc_hero_reciprocal_look [boolean]: if true, the hero and the NPC that originated this event will look each other on dialog start. Optional property. Default value is false.
  • reset_reciprocal_look [boolean]: if true, after the dialog, the hero and the NPC will face the direction that they're looking at before the dialog start. Optional property. Only valid if npc_hero_reciprocal_look was set to true. Default value is true.
  • end_with_yes_no [boolean]: if true, at the end of all dialogs set by this event, an Yes/No confirmation will be shown. Optional property. Default value is false.
  • yes_no_events [object]: object containing the list of Game Events in case of Yes and/or in the case of No. Optional property. Only valid if end_with_yes_no was set with true.
    • yes [array]: a list of Game Events that will be fired when Yes is selected. Optional property.
    • no [array]: a list of Game Events that will be fired when No is selected. Optional property.
  • finish_events [array]: a list of Game Events that will be fired when the all dialogs finished. Optional property. Only valid if end_with_yes_no wasn't set or set to false.
  • mind_read_window [boolean]: if true, the window type is going to be the same as for the Mind Read psynergy. Optional property. Default value is false.
  • pos_relative_to_canvas [boolean]: if true, the window position will always be relative to the game canvas. Optional property. Default value is false.

Examples

Example from the DEMO. Dialog section originated from Alex when you have Piers in the party:

{
  "type": "dialog",
  "end_with_yes_no": true,
  "dialog_info": [{
    "text": "It seems you're making new friends...${BREAK}You have been busy, haven't you?",
    "consider_hero_direction": true
  }],
  "yes_no_events": {
    "yes": [{
      "type": "dialog",
      "dialog_info": [{
        "text": "Maybe now you can ask your friend to teach you Warp."
      }, {
        "avatar": "piers",
        "voice_key": "adult_male_1",
        "text": "What Psynergy is this?"
      }, {
        "text": "..."
      }]
    }],
    "no": [{
      "type": "dialog",
      "dialog_info": [{
        "avatar": "piers",
        "voice_key": "adult_male_1",
        "text": "Is he a Water Adept?"
      }, {
        "text": "What a coincidence, no?${BREAK}Maybe now you can ask your friend to teach you Warp."
      }]
    }]
  }
}

Dialog text placeholders

The text can be enhanced with some placeholders:

  • ${HERO}: add this to have it replaced by the hero name. Ex.: "${HERO} found an item!""Isaac found an item!".
  • ${BREAK}: add this to start the text that follows in a new window.
  • ${BREAK_LINE}: add this to start the text that follows in a new line, but same window.
  • ${PAUSE:[duration value]} add this to pause/delay the dialog by a given value in ms. Ex.: "Well... ${PAUSE:1000}that should be ok.", will pause the dialog for one second just after "Well...".
  • ${STORAGE:[storage key]} add this to have it replaced by a storage value specified by the given storage key. Ex.: "You found ${STORAGE:items_found_number} items!""You found 7 items!", if items_found_number storage has a value of 7.
  • ${COLOR:[hex value]} some text ${COLOR:/} add this to color the text between the tokens with the given color. Ex.: "That's ${COLOR:FF0000}hard${COLOR:/}!", this will output "That's hard!" with "hard" colored in red (FF0000).

"djinn_get" event:

This type of event manages the process of getting a djinni. It can be with animation, with battle, or simply add to the party.

Properties

  • add_djinn [boolean]: if true, it will get a djinni, otherwise it will remove it. Optional property. Default value is true. When removing a djinni, no_animation must be set to true, because there's no animation for djinn removal.
  • djinn_key [string]: the unique key name of the djinni that will be gotten or removed. Required property.
  • no_animation [boolean]: if true, the djinni will be added or removed without animation. Optional property. Default value is false. This property need to be set to true in the case of removing a djinni.
  • has_fight [boolean]: if true, it will start a fight against the djinni before getting it. Optional property. Default value is false. Only valid if add_djinn is set to true and no_animation is set to false.
  • enemy_party_key [string]: if it's starting a fight against the djinni, defines it enemy party key name. Optional property. Only valid if add_djinn is set to true, no_animation is set to false and has_fight is set to true.
  • custom_battle_bg [string]: if it's starting a fight against the djinni, defines a custom battle background key name. Optional property. Default value is the battle background of the current map. Only valid if add_djinn is set to true, no_animation is set to false and has_fight is set to true.
  • on_battle_defeat_events [array]: a list of Game Events that will be fired when you lose the battle against the djinni. Optional property. Only valid if add_djinn is set to true, no_animation is set to false and has_fight is set to true. Events set in finish_events property won't be called if you lose a battle against the djinni.
  • finish_events [array]: a list of Game Events that will be fired after you get the djinni. Optional property. Only valid if add_djinn is set to true and no_animation is set to false. If fighting against the djinni and you lose this battle, events set in this property won't be called if you lose a battle against the djinni.

"djinn_set_status" event:

Set the status of a djinni.

Properties

  • djinn_key [string]: the unique key name of the djinni that will have its status changed. Required property.
  • status_key [string]: the status to be set. Must be one of the following: "set", "standby", or "recovery". Required property.

"emoticon" event:

Shows an emoticon above the char.

Properties

  • emoticon [string]: the unique key name of the emoticon to be shown. Required property.
  • duration [number]: for how long the emoticon will be shown in ms. Pass -1 if you want the emoticon to be shown for an undetermined amount of time, in this case, you'll need to call this event one more time with destroy_emoticon set to true to remove the emoticon. Optional property. Default value is 800.
  • destroy_emoticon [boolean]: destroys the emoticon. This is useful if you set duration to -1 in a previous call of this event. If this property is set to true, events in finish_events won't be called. Optional property. Default value is false.
  • sound_effect [string]: an SFX key name to be played on emoticon show. Optional property.
  • is_npc [boolean]: if true, it will show an emoticon over an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • location [object]: a custom location of the emoticon to be shown. Optional property.
    • x [number]: the x position in px. Optional property. If not set, it will use the default location (middle of the char).
    • y [number]: the y position in px. Optional property. If not set, it will use the default location (above the char).
  • face_hero [boolean]: if true and target char is not the hero, it will force the target char to face the hero. Optional property. Default is false.
  • reset_direction [boolean]: if true and target char is not the hero, it will return that target char direction to the previous one before this event. Optional property. Default is true. Only valid if face_hero was set to true.
  • finish_events [array]: a list of Game Events that will be fired after the emoticon hides. This property is only valid if destroy_emoticon is set to false. Optional property.

"event_activation" event:

Sets Game Event activation.

Properties

  • event_label [string]: the unique key name of the Game Event you want to activate or deactivate. Required property.
  • activate [boolean]: if true, it will activate the target Game Event. Required property.

"event_caller" event:

Fires another Game Event.

Properties

  • event_label [string]: the unique key name of the Game Event you want to fire. Required property.
  • activate_event_before [boolean]: whether you want to activate the target event before firing it. Optional property. Default value is true.

"events_holder" event:

This is just an event that holds other events. When this event gets fired, all the events here held will be also fired.

  • events [array]: a list of Game Events that will be fired when this one is fired. Required property.

"events_loop" event:

Will repeatedly fire a list of events at the end of a given interval. This event will only stop firing the events if it's deactivated or destroyed.

  • interval [number]: the loop interval in ms. Required property.
  • events [array]: a list of Game Events that will be fired. Required property.

"exit_sand_mode" event:

If the hero is melted into sand, call this event to make the hero to exit it.

Properties

  • finish_events [array]: a list of Game Events that will be fired when the hero exits sand mode. Optional property.

"face_direction" event:

Sets a direction for a char to face.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • direction [string]: the direction to be facing. Must be one of the following: "right", "up_right", "up", "up_left", "left", "down_left", "down", or "down_right". Required property.
  • time_between_frames [number]: the duration in ms between frames till the char reaches the target direction. Optional property. Default is 40.
  • wait_after [number]: waits for a duration in ms after facing the direction is done. Optional property. Default is no wait time.
  • finish_events [array]: a list of Game Events that will be fired after facing a direction is finished. Optional property.

"flame_char" event:

Colorizes the the char sprite with flame colors.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • enable [boolean]: if true, will apply the flame filter, otherwise, will disable the flame filter. Optional property. Default value is true.

"generic_sprite" event:

Creates a generic sprite in the map. It has no collision body. The sprite can be animated. The sprite must be registered in misc_animations_db.json file. The sprite is destroyed on map change.

Properties

  • control_type [string]: whether you want to add, update, or remove a generic sprite It must be one of the following: "add", "update", or "remove". Required property.
  • generic_sprite_key_name [string]: the generic sprite unique key name. Required property.
  • misc_sprite_key [string]: the misc sprite key name. The one that was registered in misc sprites database. Optional property. It's not required when control_type property was set as "update" or "remove".
  • action [string]: sets the action key that you want this sprite to assume. Optional property. If not passed, will get the first one that the engine finds. Not valid if control_type was set with "remove".
  • x [number]: the x position in px of the sprite. Optional property. Not valid if control_type was set with "remove".
  • y [number]: the y position in px of the sprite. Optional property. Not valid if control_type was set with "remove".
  • group [string]: the group where the sprite will be inserted, it's relative to NPCs: whether it's below, same layer as, or above them. Must be one of the following: "lower", "middle", or "over". Optional property. Not valid if control_type was set with "remove".
  • frame [string]: sets a specific frame according to the frame name given in this property. Optional property. Not valid if control_type was set with "remove".
  • alpha [number]: the alpha channel of the sprite. Range: [0, 1]. Optional property. Default value is 1. Not valid if control_type was set with "remove".
  • anchor_x [number]: the x anchor value of the sprite. Range: [0, 1]. Optional property. Default value is 0. Not valid if control_type was set with "remove".
  • anchor_y [number]: the y anchor value of the sprite. Range: [0, 1]. Optional property. Default value is 0. Not valid if control_type was set with "remove".
  • scale_x [number]: the x scale value of the sprite. Range: [0, 1]. Optional property. Default value is 1. Not valid if control_type was set with "remove".
  • scale_y [number]: the y scale value of the sprite. Range: [0, 1]. Optional property. Default value is 1. Not valid if control_type was set with "remove".
  • rotation [number]: the rotation in rad of the sprite. Optional property. Default value is 0. Not valid if control_type was set with "remove".
  • collision_layer [number]: the collision layer that the sprite will be. Important when sorting sprites. Optional property. Default value is the current map collision layer. Not valid if control_type was set with "remove".
  • play [boolean]: plays an animation for this sprite. Optional property. Default value is false. Not valid if control_type was set with "remove".
  • animation [string]: the animation key to be played. Optional property. Not valid if control_type was set with "remove". Only valid if play property was set with true.
  • frame_rate [number]: the animation frame rate. Optional property. If not set, uses the default frame rate of the animation. Not valid if control_type was set with "remove". Only valid if play property was set with true.
  • loop [boolean]: whether the animation will loop. Optional property. If not set, will use the default value of the animation. Not valid if control_type was set with "remove". Only valid if play property was set with true.
  • send_to_back [boolean]: if true and if the sprite is in the "middle" group, the sprite will always be sorted under the hero and NPCs. Optional property. Default value is false.

"grant_ability" event:

Grants an ability to a char.

Properties

  • char_key [string]: the key name of the char that will receive the ability. Required property.
  • ability [string]: the ability key name. Required property.

"io_anim_play" event:

Starts or stops an Interactable Object animation.

Properties

  • io_label [string]: the Interactable Object unique key name. Required property.
  • action [string]: the animation action key. Optional property. Only valid if stop_animation is not set or it's false.
  • animation [string]: the animation key. Optional property. Only valid if stop_animation is not set or it's false.
  • frame_rate [number]: the animation frame rate. Optional property. Only valid if stop_animation is not set or it's false. Default value is the animation default frame rate value.
  • loop [boolean]: if true, the animation will loop. Optional property. Only valid if stop_animation is not set or it's false. If not set, will use animation default value.
  • stop_animation [boolean]: if true, the animation will be stopped instead of getting started. Optional property. Default value is false.
  • reset_frame_on_stop [boolean]: if true, the animation will return to the first frame when stopped. Optional property. Only valid if stop_animation is set to true. Default value is false.
  • finish_events [array]: a list of Game Events that will be fired when the animation is finished. Optional property. Only valid if stop_animation is not set or it's false and loop is set to false.

"io_tween_position" event:

Tweens an IO to a given position.

Properties

  • io_label [string]: the Interactable Object unique key name. Required property.
  • duration [number]: the tween duration in ms. Required property.
  • ease [string]: the type of easing that the tween will follow. Optional property. Default value is Linear.None which is a linear tween. Available values for this property:
    • "Linear.None"
    • "Quadratic.In"
    • "Quadratic.Out"
    • "Quadratic.InOut"
    • "Cubic.In"
    • "Cubic.Out"
    • "Cubic.InOut"
    • "Quartic.In"
    • "Quartic.Out"
    • "Quartic.InOut"
    • "Quintic.In"
    • "Quintic.Out"
    • "Quintic.InOut"
    • "Sinusoidal.In"
    • "Sinusoidal.Out"
    • "Sinusoidal.InOut"
    • "Exponential.In"
    • "Exponential.Out"
    • "Exponential.InOut"
    • "Circular.In"
    • "Circular.Out"
    • "Circular.InOut"
    • "Elastic.In"
    • "Elastic.Out"
    • "Elastic.InOut"
    • "Back.In"
    • "Back.Out"
    • "Back.InOut"
    • "Bounce.In"
    • "Bounce.Out"
    • "Bounce.InOut"
  • repeat [number]: the number of times this tween will repeat. Optional property. Default value is 0.
  • yoyo [boolean]: if true, this tween will go and back (yoyo effect). Optional property. Default value is false.
  • incremental [boolean]: if true, the value passed to "position" property will be incrementally added to the IO current position. Optional property. Default value is false.
  • is_px [boolean]: if true, the value passed to "position" property will be in px units instead of tile units. Optional property. Default value is true.
  • position [object]: an object containing the destination position of the tween. Required property.
    • x [number]: the x position destination. Optional property.
    • y [number]: the y position destination. Optional property.
  • hide_shadow [boolean]: if true, it will hide IO's shadow on tween start. Optional property. Default value is false.
  • keep_shadow_hidden [boolean]: if true, it will keep IO's shadow hidden on tween finish if hide_shadow property is true. Optional property. Default value is false.
  • shadow_follow_io [boolean]: if true, the IO's shadow will follow it on tween. Optional property. Default value is true.
  • keep_io_collision_disable [boolean]: this IO collision is disabled while the tween is happening. If this property is set to true, the collision of this IO won't be activated on tween finish. Optional property. Default value is false.
  • dest_collision_layer [number]: the destination collision layer index that this IO will be after the tween. Optional property.
  • change_collision_layer_on_init [boolean]: if true and "dest_collision_layer" property is set, the collision layer change of this IO will happen before the tween, otherwise after it. Optional property. Default value is false.
  • enable_collision_on_previous_pos [boolean]: if true, the previous collision blocks that were occupied by the specified IO will reactivated. Only works for rollable and pushable. Optional property. Default value is false.
  • finish_events [array]: a list of Game Events that will be fired when the tween is finished. Optional property.

"item_checks" event:

Do some checks related to items. Check if char has item, if item is broken, if it's equipped, or if char has a specific quantity of an item. If a char is not specified, the check will be applied to all chars in sequence till the check is satisfied.

Properties

  • control_type [string]: the type of check to be done. Must be one of the following: "has_item", "is_broken", "equipped", or "quantity_check". Required property.
  • char_key [string]: the key name of the char to have his/her items analyzed. If this property is not specified, the chosen check will be applied to all chars in sequence till the check is satisfied. Optional property.
  • item_key [string]: will try to find the first item in inventory with this item key. Optional property. This property should not be set with slot_index.
  • slot_index [number]: will try to select an item in the index given by this property. Optional property. This property should not be set with item_key.
  • quantity [number]: the number of items to be checked. Optional property. Default value is 1. Only valid if control_type property was set with "quantity_check";
  • check_ok_events [array]: a list of Game Events that will be fired if the check succeeds. Optional property.
  • check_fail_events [array]: a list of Game Events that will be fired if the check fails. Optional property.

"jump" event:

Allows a char to jump. The char can jump in the same tile he/she's in or to another position.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • jump_height [number]: the jump height in px. Optional property. This option is not valid if it's a diagonal direction jumping. Default value is 12.
  • duration [number]: the jump duration in ms. Optional property. Default value is 65.
  • jump_direction [number]: the direction that the char will be while jumping. Must be one of the following: "right", "up_right", "up", "up_left", "left", "down_left", "down", or "down_right". Optional property. If not set, it will jump facing the current direction.
  • sfx_key [number]: the SFX sound that will be played while jumping. Optional property. If not set, it will play the default jump sound.
  • wait_after [number]: waits for a duration in ms after jumping. Optional property. Default is no wait time.
  • dont_play_jump_animation [boolean]: if true, char jump animation won't be played. Optional property. Default value is false.
  • dest [object]: some properties to define the jump position destination. Optional property. If not set, it will jump in the same place the char is in.
    • x [number]: the x position destination in px. This position has preference over tile position. Optional property. Default value is the char current position.
    • y [number]: the y position destination in px. This position has preference over tile position. Optional property. Default value is the char current position.
    • tile_x [number]: the x tile position destination. If position in px is defined, this one won't be used. Optional property. Default value is the char current position.
    • tile_y [number]: the y tile position destination. If position in px is defined, this one won't be used. Optional property. Default value is the char current position.
  • finish_events [array]: a list of Game Events that will be fired when the jump is finished. Optional property.

"layer_tween" event:

Moves a specific Tiled map layer by a given x/y offset.

Properties

  • map_layer_name [string]: the Tiled layer name that will be moved. Required property.
  • duration [number]: the duration of the tween in ms. Required property.
  • destination_offset [object]: object containing the x/y offsets. Required property.
    • x [number]: the x direction offset in px. Optional property.
    • y [number]: the y direction offset in px. Optional property.
  • finish_events [array]: a list of Game Events that will be fired when the tween is finished. Optional property.

"layer_visibility" event:

Sets the visibility of a Tile map layer.

Properties

  • map_layer_name [string]: the Tiled layer name that will be moved. Required property.
  • visible [boolean]: if true, it will enable the visibility of the selected layer. Required property.

"look" event:

Forces a char to keep looking at another char wherever it moves.

Properties

  • look [boolean]: if true, it will enable char look, otherwise, it will disable it. Required property.
  • looker_is_npc [boolean]: if true, it will select an NPC as looker, otherwise, the hero. Required property.
  • looker_npc_label [string]: the looker NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • target_is_npc [boolean]: if true, it will select an NPC as target, otherwise, the hero. Optional property. Only valid if look property was set to true.
  • target_npc_label [string]: the target NPC unique key name. Optional property. Don't set this property if is_npc is set to false. Only valid if look property was set to true.

"main_chars_join_split" event:

This event facilitates the main chars split or join from main hero in cut scenes. It allows a main char to split from hero to a specific place or to join a main char with the hero. This event will create an NPC on-the-fly with [main_char_key_name]/join_split_event label when splitting and will destroy the first NPC it finds with this label when joining.

Properties

  • mode [string]: whether it's splitting or joining. Must be one of the following: "split" or "join". Required property.
  • main_char_key_name [string]: the main char key name. Required property.
  • destination [object]: only valid if mode property is split. Required property if mode is split. The destination position object when the main char is splitting. Optional property.
    • x [number]: the x position destination. Optional property.
    • y [number]: the y position destination. Optional property.
  • destination_incremental [boolean]: only valid if mode property is split. Whether the value passed in destination property will be incremented from main hero position or if it's an absolute value, for the latest, set this property to false. Optional property. Default is true.
  • destination_type [string]: only valid if mode property is split. Whether the value passed in destination property will be in pixel units or tile units. Must be one of the following: "tile" or "px". Optional property. Default is tile.
  • wait_after [number]: the amount of time to be waited for after the split/join finished in ms. Optional property.
  • final_direction [string]: only valid if mode property is split. The final direction of the main char after it reaches its final position. Must be one of the following: "up", "down", "left", "right", "up_left", "up_right", "down_left", or "down_right". Optional property.
  • final_hero_direction [string]: only valid if mode property is split. The final direction of the hero after the char reaches its final position. Must be one of the following: "up", "down", "left", "right", "up_left", "up_right", "down_left", or "down_right". Optional property.
  • initial_hero_direction [string]: only valid if mode property is split. The initial direction of the hero on event start. Must be one of the following: "up", "down", "left", "right", "up_left", "up_right", "down_left", or "down_right". Optional property.
  • keep_npc_collision_disable [boolean]: this event disables collision between NPCs and main hero while it's running, then it enables again on finish. If you want to keep it disabled, set this property to true. Optional property. Default is false.
  • dash [boolean]: if true, the main char will dash while it's moving instead of walk. Optional property. Default is false.
  • finish_events [array]: a list of Game Events that will be fired when the join/split is finished. Optional property.

"map_blend_mode" event:

Sets the blend mode of a specific map layer.

Properties

  • map_layer_name [string]: the layer name that you want to set the blend mode. Required property.
  • blend_mode [string]: the blend mode you want to set. It must be one of the following: "NORMAL" or "SCREEN". Required property.

"map_opacity" event:

Sets or transitions the alpha channel of a specific map layer.

Properties

  • map_layer_name [string]: the layer name that you want to set the blend mode. Required property.
  • opacity [number]: the opacity/alpha value to be set. Range: [0, 1]. Required property.
  • duration [number]: the transition time in ms to the new opacity value. Optional property. Default value is 0.
  • finish_events [array]: a list of Game Events that will be fired when the transition is done. Optional property.

"move" event:

Moves/translates a char to a position/destination. The char can walk or dash to the destination.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • dest [object]: the destination of the char. Required property. It can be two types of object, a position type or a storage value type:
    • Storage value type: it must be a storage value of position type.
      • type [string]: the type of the value. In this case, it must be "storage". Required property.
      • value [object]: the storage value info. Required property. Set an object with below properties:
        • key_name [string]: the storage key name. Required property.
    • Position type: here you can specify x and y properties.
      • x [number|object]: the x position of the destination. It can be in px or tile position, depending on what was set in dest_unit_in_tile property. Required property. If a number was set in this property, the destination will be this literal value, otherwise you can get a destination value from a game object, in this case, set an object with below properties (remember that the wished value must be a number):
        • type [string]: the type of the value: "value", "storage", "game_info". Required property.
        • value [string|boolean|number|object]: the actual value. Required property. If you set the above "type" property as "value", then you can set here a literal value of string, boolean, or number types. Otherwise, set an object with below properties:
          • type [string]: the type of object you want to retrieve the value from. It's only valid if you set the above "type" property as "game_info". It must be one of the following values: "char" for main char info, "hero" for hero info, "npc" for NPC info, "event" for Tile Event info, and "interactable_object" for Interactable Object info. Optional property.
          • key_name [string]: the main char key name if you set the just above "type" property as "char". Otherwise, if you set the topmost "type" property as "storage", you have to set the storage key name. Optional property.
          • label [string]: the NPC, Interactable Object, or Tile Event unique key name if you set the just above "type" property as "npc", "event" or "interactable_object". Optional property.
          • property [string]: the property name that you want to retrieve if you're not getting a storage value. Examples: it can be "max_hp" if you dealing with main chars, it can be "tile_x_pos" if you're dealing with NPC or hero, or it can also be "x" if you're dealing with Tile Events. Optional property. See the list of accessible properties here.
      • y [number|object]: the y position of the destination. It can be in px or tile position, depending on what was set in dest_unit_in_tile property. Required property. If a number was set in this property, the destination will be this literal value, otherwise you can get a destination value from a game object, in this case, set an object as explained in x property right above.
  • dest_unit_in_tile [boolean]: if true, the dest property will have its values in tile position number, otherwise the values will be in px. Optional property. Default value is true.
  • dash [boolean]: if true, the char will dash, otherwise, walk. Optional property. Default value is false.
  • minimal_distance [number]: the minimal distance from target position that the char has to be in order to have the arrival confirmed. Optional property. Default value is 3 px.
  • camera_follow [boolean]: if true, the camera will follow the char while it moves. Optional property. Default value is false.
  • camera_follow_duration [number]: the camera transition duration in ms when targeting a char. Optional property. Default value is 400. Only valid if camera_follow and/or follow_hero_on_finish properties are set to true.
  • reset_previous_camera_target [boolean]: if true, the camera will follow the object it was following before this event. Optional property. Default value is false. Only valid if camera_follow property is set to true.
  • camera_unfollow_char_on_finish [boolean]: if true, the camera will stop following the char on movement end. Optional property. Default value is false. Only valid if camera_follow property is set to true. This property has no effect if reset_previous_camera_target property is set to true.
  • follow_hero_on_finish [boolean]: if true, the camera will follow the hero on movement finish. Optional property. Default value is false.
  • final_direction [string]: if set, the char will face the given direction on movement finish. It must be one of the following: "right", "up_right", "up", "up_left", "left", "down_left", "down", or "down_right". Optional property.
  • keep_npc_collision_disable [boolean]: when starting the movement, the engine disables hero-NPC collision and, on finish, it enables it. If this property is set to true, it will keep this collision disable. Optional property. Default value is false.
  • deactive_char_on_end [boolean]: if true, it will deactive char on finish. Optional property. Default value is false.
  • wait_after [number]: waits for a duration in ms after the movement is done. Optional property. Default is no wait time.
  • finish_events [array]: a list of Game Events that will be fired when the movement is done. Optional property.

"outline_char" event:

Applys an outline effect in a char.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • enable [boolean]: if true, will apply the outline effect, otherwise, will remove the effect. Optional property. Default value is true.
  • keep_transparent [boolean]: if true, will keep the inner content of the outline transparent, which means that you won't be able to see the char sprite content. Otherwise, you'll be able to see the char sprite with the outline. Optional property. Default value is true. Only valid if enable property is true.
  • color [object]: the color of the outline. Optional property. Default is white. Only valid if enable property is true.
    • r [number]: the red channel of RGB. Range: [0, 1]. Optional property. Default is 1.
    • g [number]: the green channel of RGB. Range: [0, 1]. Optional property. Default is 1.
    • b [number]: the blue channel of RGB. Range: [0, 1]. Optional property. Default is 1.

"particles" event:

"party_join" event:

Adds or removes a main char into the party.

Properties

  • char_key_name [string]: the main char unique key name. Required property.
  • join [boolean]: if true, the char will join the party, otherwise it will be removed. Optional property. Default is true.
  • show_dialog [boolean]: if true, it will show the member join dialog and also play party join SFX, if false, will just add the char into the party. Optional property. Default is true. Only valid if join property is set to true.
  • finish_events [array]: a list of Game Events that will be fired when the dialog is done. Optional property.

"permanent_status" event:

Sets or unsets a permanent status in a char.

Properties

  • target_char_key [string]: the main char unique key name. Required property.
  • permanent_status [string]: the permanent status key to set or unset. Required property. Must be one of the following: "downed", "poison", "venom", "equip_curse", or "haunt".
  • add [boolean]: if true, will set the permanent status, otherwise will unset. Optional property. Default value is true.
  • revive_target_hp [number]: when reviving a char, the percentage of its max HP that it will recover. Range: [0, 1]. Optional property. Default value is 1.0. Only valid if permanent_status property was set with "downed" and add property is set to false.

"psynergy_stone" event:

Game event to get psynergy stones. The psynergy stone must be an NPC with "psynergy_stone" key name. The event must be fired by NPC interaction.

  • finish_events [array]: a list of Game Events that will be fired when the stone shatters. Optional property.

"set_char_activation" event:

Activates or deactivates an NPC or hero.

Properties

  • is_npc [boolean]: if true, it will toggle activation in an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • active [boolean]: if true, it will activate the char, otherwise it will deactivate. Required property.

"set_char_collision" event:

Controls a char collision body. Enables, disables, or destroys it.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • control_type [string]: decides what should be done. Required property. Must be one of the following:
    • "disable": disables collision for this char.
    • "enable": enables collision for this char.
    • "remove": destroys this char collision body.

"set_char_hp_pp" event:

Sets HP or PP for a main char or entire party.

Properties

  • char_key [string]: that main char key that you want to set the points. Set "all" if you want to set for the entire party. Required property.
  • points_type [string]: the point type. Set "pp" or "hp". Required property.
  • value [number|string]: the points number to be set. Must be greater than zero and integer. Set "full" for full points recovery. Required property.

"set_char_visibility" event:

Controls a char sprite visibility.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • visible [boolean]: if true, the char will be visible. Required property.

"set_io_activation" event:

Controls an Interactable Object activation. If an IO is deactivated, it won't be visible, won't have a collision body, and won't be able to interact with it.

Properties

  • io_label [string]: the Interactable Object unique key name. Required property.
  • io_active [boolean]: if true, the IO will be activated. Optional property. Default is true.

"set_io_collision" event:

Controls an Interactable Object collision body. Enables, disables, or destroys it.

Properties

  • io_label [string]: the Interactable Object unique key name. Required property.
  • control_type [string]: decides what should be done. Required property. Must be one of the following:
    • "disable": disables collision for this interactable object.
    • "enable": enables collision for this interactable object.
    • "remove": destroys this interactable object collision body.

"set_io_visibility" event:

Controls an Interactable Object visibility. Even if it's not visible, the IO will have a collision body and the hero will be able to interact with it.

Properties

  • io_label [string]: the Interactable Object unique key name. Required property.
  • visible [boolean]: if true, the IO will be visible. Optional property. Default is true.

"set_npc_collision" event:

Defines whether the collision between all NPCs and the hero is active or not. Please be aware that some other game events may control this same switch, these events may have keep_npc_collision_disable property, for example.

Properties

  • collision_active [boolean]: if true, the collision between NPCs and the hero is active. Required property.

"set_party_coins" event:

Control the party coins number.

Properties

  • control_type [string]: whether you want to increment coins, then set "increment", or set an absolute value of coins, then set "set_value". Required property.
  • amount [number]: the number of coins to be set or incremented. Required property.

"set_value" event:

Sets many kinds of values in the engine. The values to be set can be storage values, tile event, main char, hero, NPC, and interactable object properties values.

Properties

  • event_value [object]: the object that specifies the value to be set. Required property.
    • type [string]: the type of the value: "storage" or "game_info". Required property.
    • value [string|boolean|number|object]: the actual value. Required property. Set an object with below properties:
      • type [string]: the type of object you want to retrieve the value from. It's only valid if you set the above "type" property as "game_info". It must be one of the following values: "char" for main char info, "hero" for hero info, "npc" for NPC info, "event" for Tile Event info, and "interactable_object" for Interactable Object info. Optional property.
      • key_name [string]: the main char key name if you set the just above "type" property as "char". Otherwise, if you set the topmost "type" property as "storage", you have to set the storage key name. Optional property.
      • label [string]: the NPC, Interactable Object, or Tile Event unique key name if you set the just above "type" property as "npc", "event" or "interactable_object". Optional property.
      • property [string]: the property name that you want to retrieve if you're not getting a storage value. Examples: it can be "max_hp" if you dealing with main chars, it can be "jumping" if you're dealing with NPC or hero, or it can also be "x" if you're dealing with Tile Events. Optional property. See the list of accessible properties here.
      • value [string|boolean|number|object]: the actual value. Required property. You can set here a literal value of string, boolean, or number types. Otherwise, if setting a storage value of "position" type, set an object with "x" and "y" properties designating the position values.
  • check_npc_storage_values [boolean]: if true, will force the storage values update of the NPC that originated this event or specified in npc_label property. Optional property. Default is false.
  • check_io_storage_values [boolean]: if true, will force the storage values update of the IO specified in io_label property. Optional property. Default is false.
  • check_collision_structures [boolean]: if true, this storage variable change will trigger a check whether collision structures with controller_variable property set should collide or not with the hero. Optional property. Default is false.
  • check_layers_visibility [boolean]: if true, this storage variable change will trigger a check whether Tiled tile layers with hidden property set to a string value corresponding to this storage value that's being modified should be visible or not. Optional property. Default is false.
  • io_label [string]: the IO unique key name to have its storage values checked if check_io_storage_values is true. Optional property.
  • npc_label [string]: the NPC unique key name to have its storage values checked if check_npc_storage_values is true. Optional property.
  • increment [boolean]: if true, it will incrementally set the value passed. Optional property. Default is false.
  • dismiss_checks [boolean]: if true, it won't check whether a given IO/NPC/Hero/Event property exists before setting. Optional property. Default is false.

"storage_change" event:

Fires a list of game events when specific(s) storage value(s) changed.

Properties

  • keys [string|array]: a single storage key or a list of storage keys to have their values watched. Required property.
  • callback_call_type [string]: sets how the events will be called. Must be one of the following: "once" or "multiple". If "once" is set, the list of game events will be fired just once when the selected storage values change, otherwise the list of events will be fired whenever the selected storage values change. Optional property. Default value is "once".
  • change_events [array]: a list of Game Events that will be fired when the storage values change. Required property.

"summon" event:

Game Event to get a summon. If getting a summon with animation, the summon stone must be an NPC with "summon" key name and the event must be fired by NPC interaction.

Properties

  • summon_key [string]: the summon unique key name to be granted to the party. Required property.
  • animate [string]: is true, the standard animation to get a summon will be played. In order for this to happen, this event must be fired by NPC interaction. Optional property. Default is true.
  • finish_events [array]: a list of Game Events that will be fired when the summon is gotten. Optional property.

"teleport" event:

Teleports to another map. Please notice that after this event is called, the current map will be unmounted. Use it wisely.

Properties

  • target_map_key [string]: the target map key name. Required property.
  • target_tile_position [object]: the x and y target position in the target map. Required property.
    • x [number]: the x tile position. Required property.
    • y [number]: the y tile position. Required property.
  • target_collision_layer [string]: the destination collision layer index. Required property.
  • target_direction [string]: the hero direction after teleporting. Must be one of the following: "right", "up_right", "up", "up_left", "left", "down_left", "down", and/or "down_right". Required property.
  • fade_color [string]: the fade-in color when teleporting. Set the number as a string but in hexa, example: "0xfff". Optional property. Default is "0x0" (black).

"tile_event_manage" event:

Manages some properties of a selected Tile Event or all Tile Events from an Interactable Object.

Properties

  • tile_event_key [string]: the unique tile event key name to be managed. Optional property if io_label property is set.
  • io_label [string]: the unique Interactable Object key name to be retrieved all Tile Events. Optional property if tile_event_key property is set.
  • activate_at [object]: this object can define in which directions the selected event will be activated. Optional property. The keys of this object must be the following directions: "right", "up_right", "up", "up_left", "left", "down_left", "down", and/or "down_right". Optionally, you can set "all", if you want to set for all directions at once.
    • <direction> [boolean]: whether this direction is going to be activated or not. Directions are optional property in general, but at least one direction must be set.
  • pos [object]: this object can define the x and/or y position(s) of the selected tile event. Optional property.
    • x [number]: the x tile position of the event. Optional property. Default is the current position.
    • y [number]: the y tile position of the event. Optional property. Default is the current position.
  • collision_layers [number|array]: sets the new collision layers that the select tile event will be activated. It can be a number representing a collision layer or list of these. Optional property.
  • remove_from_field [boolean]: if true, the selected Tile Event will be removed from the map. Optional property. Default value is false.

"timer" event:

Waits for a period of time.

Properties

  • duration [number]: the duration to wait in ms. Required property.
  • finish_events [array]: a list of Game Events that will be fired when the timer is done. Optional property.

"tint_char" event:

Tints a char by filling its sprite area with a solid color.

Properties

  • is_npc [boolean]: if true, it will select an NPC, otherwise, the hero. Required property.
  • npc_label [string]: the NPC unique key name. Optional property. Don't set this property if is_npc is set to false.
  • enable [boolean]: if true, will apply the tint effect, otherwise, will remove the effect. Optional property. Default value is true.
  • color [object]: the color that will fill the char's sprite. Optional property. Only valid if enable property is true.
    • r [number]: the red channel of RGB. Range: [0, 1]. Optional property. Default is the current value.
    • g [number]: the green channel of RGB. Range: [0, 1]. Optional property. Default is the current value.
    • b [number]: the blue channel of RGB. Range: [0, 1]. Optional property. Default is the current value.

Accessible properties

Hero

  • key_name
  • is_npc
  • tile_x_pos
  • tile_y_pos
  • x
  • y
  • width
  • height
  • body_radius
  • active
  • current_direction
  • required_direction
  • transition_direction
  • ice_slide_direction
  • trying_to_push_direction
  • current_speed
  • temp_speed
  • force_diagonal_speed
  • extra_speed
  • extra_speed_force
  • current_action
  • current_animation
  • is_interactable_object
  • shapes_collision_active
  • stop_by_colliding
  • force_direction
  • dashing
  • climbing
  • pushing
  • jumping
  • sliding
  • misc_busy
  • casting_psynergy
  • on_reveal
  • teleporting
  • idle_climbing
  • ice_sliding_active
  • sliding_on_ice
  • trying_to_push
  • walking_over_rope
  • climbing_rope

NPC

Same as hero plus:

  • move_freely_in_event
  • movement_type
  • message
  • thought_message
  • back_interaction_message
  • avatar
  • label
  • voice_key
  • interaction_pattern
  • talk_range
  • base_collision_layer
  • affected_by_reveal
  • ignore_world_map_scale
  • npc_type
  • shop_key
  • inn_key
  • healer_key
  • map_index
  • allow_interaction_when_inactive
  • ignore_physics

Interactable Object

  • key_name
  • tile_x_pos
  • tile_y_pos
  • x
  • y
  • label
  • base_collision_layer
  • active
  • pushable
  • is_rope_dock
  • rollable
  • breakable
  • enable
  • entangled_by_bush
  • width
  • height
  • is_interactable_object
  • has_shadow
  • current_animation
  • current_action
  • shapes_collision_active
  • map_index
  • affected_by_reveal

Tile Event

  • type
  • x
  • y
  • location_key
  • id
  • affected_by_reveal
  • key_name
  • allow_active_in_diagonal

Main Char

  • key_name
  • name
  • battle_scale
  • battle_shadow_key
  • status_sprite_shift
  • fighter_type
  • elemental_current.<level|power|resist>.<element>
  • elemental_base.<level|power|resist>.<element>
  • elemental_before_buff.<level|power|resist>.<element>
  • elemental_buff.<level|power|resist>.<element>
  • turns
  • base_turns
  • extra_turns
  • max_hp
  • current_hp
  • max_pp
  • current_pp
  • hp_recovery
  • pp_recovery
  • atk
  • def
  • agi
  • luk
  • level
  • current_exp
  • paralyzed_by_effect
  • extra_stats.<main_stat>
  • before_buff_stats.<main_stat>
  • buff_stats.<main_stat>
  • element_afinity
  • special_class_type
  • weapon_sprite_shift
  • class.name
  • granted_class_type
  • inventory_is_full
Clone this wiki locally