-
Notifications
You must be signed in to change notification settings - Fork 39
Game Events
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.
These are the properties that are common among all Game Event types.
-
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 totrue
. Optional property. Default isfalse
. -
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 totrue
. Optional property. Default isfalse
. -
active
[boolean]
: whether this game event is initially active or not. Optional property. Default istrue.
Adds an item to the party. The item might not be added if all inventories are full.
-
item_key
[string]
: the item key name. Required property. -
quantity
[number]
: the quantity to be added. Optional property. Default value is1
.
Plays a BGM or SFX audio.
-
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 is1
. -
loop
[boolean]
: whether the BGM will loop when execution is finished. Only works for BGM audio type. Optional property. Default value istrue
. -
fade_in
[boolean]
: if true, the BGM will fade in on start. Only works for BGM audio type. Optional property. Default value isfalse
. -
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 isfalse
. -
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.
Stops or pauses a BGM audio.
-
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 isfalse
. -
pause_only
[boolean]
: if true, this BGM will be just paused instead of a full stop. Optional property. Default value isfalse
.
Starts a battle.
-
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 istrue
. -
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 istrue
. -
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.
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.
-
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, checkleft_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.
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": [{}]
}
Fades the camera in and out.
-
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 is500
. -
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.
Toggles camera following. The camera can follow the hero, NPCs, or Interactable Objects.
-
follow
[boolean]
: whether it's going to turn on or off the camera following. Optional property. Default value istrue
. If this property is set tofalse
, no other property needs to be set. -
is_hero
[boolean]
: whether the camera will be following the hero or not. Optional property. Default value istrue
. If this property is set totrue
,npc_label
andio_label
properties can't be set. -
npc_label
[string]
: the unique NPC key name. Optional property. Don't set this property ifis_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 ifis_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 is0
. -
transition_end_events
[array]
: a list of Game Events that will be fired after the camera transitions end on follow start. Optional property.
Moves the camera freely by following a sequence of given positions.
-
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 is500
. -
easing
[string]
: the type of easing that the transition will follow. Optional property. Default value isLinear.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 isfalse
. -
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 is0
. This property is only valid ifreset_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.
Turns camera shake on or off.
-
enable
[boolean]
: if true, it will enable camera shaking, otherwise will disable it. Required property.
Turns psynergy casting aura on or off for an NPC or hero.
-
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 ifis_npc
is set to false.
Changes the collision layer of the current map.
-
target_collision_layer
[number]
: the target collision layer index. Required property.
Starts or stops a char animation.
-
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 ifis_npc
is set to false. -
action
[string]
: the animation action key. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. -
animation
[string]
: the animation key. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. Remember that this field accepts"up"
,"down"
,"left"
, etc. -
frame_rate
[number]
: the animation frame rate. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. Default value is the animation default frame rate value. -
loop
[boolean]
: if true, the animation will loop. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. 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 isfalse
. -
reset_frame_on_stop
[boolean]
: if true, the animation will return to the first frame when stopped. Optional property. Only valid ifstop_animation
is set totrue
. Default value isfalse
. -
reset_before_start
[boolean]
: if true, the animation will return to the first frame before being played. Optional property. Only valid ifstop_animation
is set tofalse
. Default value istrue
. -
finish_events
[array]
: a list of Game Events that will be fired when the animation is finished. Optional property. Only valid ifstop_animation
is not set or it'sfalse
andloop
is set tofalse
.
Sets a blend mode for a char sprite.
-
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 ifis_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"
.
Sets or increments the experience points of a char.
-
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.
Make a char to fall to a specific location in this map or to another map.
-
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 ifis_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 isfalse
. -
splash_sweat_drops
[boolean]
: if true, the char will splash sweat drops before het falls. Optional property. Default isfalse
. -
walking_in_the_air
[boolean]
: if true, the char will "walk in the air" before he falls. Optional property. Default isfalse
. -
ground_hit_animation
[boolean]
: if true, the char will emit some dust when hitting the ground on fall finish. Optional property. Default isfalse
. -
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 reachingdestination_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 isfalse
. -
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 isfalse
.
-
-
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.
Changes the char sprite HUE angle.
-
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 ifis_npc
is set to false. -
enable
[boolean]
: if true, will apply the hue angle, otherwise, will disable the hue filter. Optional property. Default value istrue
. -
angle
[number]
: the HUE angle to be set. Optional property.
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.
-
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 ifcontrol_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 withequip_slot
andslot_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 withequip_slot
anditem_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 withslot_index
anditem_key
. -
equip
[boolean]
: whether it's to equip or not the selected item. Optional property. Only valid ifcontrol_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 ifcontrol_type
was set with"set_broken"
. -
amount
[number]
: the number of items to be added or removed. Optional property. Only valid ifcontrol_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 ifcontrol_type
property is set to"add"
or"remove"
and, in the case of"remove"
, it will only be called ifchar_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 ifcontrol_type
property is set to"add"
or"remove"
and, in the case of"remove"
, it will only be called ifchar_key
property wasn't specified. Optional property.
Sets the level of a char to a given value.
-
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.
Toggles NPC or hero rotation on z-axis.
-
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 ifis_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.
Controls an NPC or hero shadow visibility.
-
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 ifis_npc
is set to false. -
visible
[boolean]
: if true, the shadow won't be visible, otherwise it will be visible. Required property.
Plays the sweat drops splash animation over the char sprite.
-
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 ifis_npc
is set to false. -
times
[number]
: the number of times the animation will be played. Optional property. Default value is2
. -
finish_events
[array]
: a list of Game Events that will be fired when the animation finished. Optional property.
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.
-
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 ifis_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 isLinear.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 ifhide_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.
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.
-
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 is1
. -
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 isfalse
. -
hide_on_finish
[boolean]
: if true, the NPC that originated this event will be hidden. Optional property. Default value isfalse
. -
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 itsstorage_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 isfalse
.
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.
Colorizes the char in a given color. It can also mix with grayscale levels in order to create a saturation effect.
-
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 ifis_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.
Colorizes the map in a given color. It can also mix with grayscale levels in order to create a saturation effect.
-
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 specifiedintensity
and/orgray
properties in ms. Optional property. Default is500
. -
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 isfalse
. -
finish_events
[array]
: a list of Game Events that will be fired when the transition is done. Optional property.
Resumes, pauses, stops or sets BGM volume.
-
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 ifcontrol_type
was set with"set_volume"
.
Adds or remove a storage value. Good for creating auxiliary variables.
-
add
[boolean]
: if true, will create a new storage var, otherwise, it will remove. Optional property. Default istrue
. -
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 ifadd
property was set withtrue
. 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.
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.
-
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 ifcreate
property was set withtrue
. -
y
[number]
: the y position of the body in px. Optional property. Only valid ifcreate
property was set withtrue
. -
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 ifcreate
property was set withtrue
. -
properties
[object]
: the body properties. Optional property. Only valid ifcreate
property was set withtrue
.-
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 ifbody_type
property was set with"box"
. Optional property. -
height
[number]
: the body height in px. Only valid ifbody_type
property was set with"box"
. Optional property. -
radius
[number]
: the body radius in px. Only valid ifbody_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 tox
andy
properties. Only valid ifbody_type
property was set with"polygon"
. Optional property. Example[[0,0],[49,15],[21,32]]
set inx = 458
andy = 492
position:
-
Destroys a game event. The target event must be labeled.
-
target_event_key
[string]
: the Game Event unique key name. Required property.
Creates a sequence of dialogs. Yes/No confirmation can also be set.
-
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 inreference_npc
property and get its avatar, ifreference_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 inreference_npc
property and get its voice key, ifreference_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 isfalse
. Not valid ifcustom_pos
property is set. -
sweat_drops
[boolean]
: if true, the NPC that's talking will show sweat drops. Optional property. Default isfalse
. Not valid ifreference_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 ifreference_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 isfalse
. -
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 ifnpc_hero_reciprocal_look
was set totrue
. Default value istrue
. -
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 isfalse
. -
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 ifend_with_yes_no
was set withtrue
.-
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 ifend_with_yes_no
wasn't set or set tofalse
. -
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 isfalse
. -
pos_relative_to_canvas
[boolean]
: if true, the window position will always be relative to the game canvas. Optional property. Default value isfalse
.
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."
}]
}]
}
}
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!"
, ifitems_found_number
storage has a value of7
. -
${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).
This type of event manages the process of getting a djinni. It can be with animation, with battle, or simply add to the party.
-
add_djinn
[boolean]
: if true, it will get a djinni, otherwise it will remove it. Optional property. Default value istrue
. When removing a djinni,no_animation
must be set totrue
, 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 isfalse
. This property need to be set totrue
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 isfalse
. Only valid ifadd_djinn
is set totrue
andno_animation
is set tofalse
. -
enemy_party_key
[string]
: if it's starting a fight against the djinni, defines it enemy party key name. Optional property. Only valid ifadd_djinn
is set totrue
,no_animation
is set tofalse
andhas_fight
is set totrue
. -
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 ifadd_djinn
is set totrue
,no_animation
is set tofalse
andhas_fight
is set totrue
. -
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 ifadd_djinn
is set totrue
,no_animation
is set tofalse
andhas_fight
is set totrue
. Events set infinish_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 ifadd_djinn
is set totrue
andno_animation
is set tofalse
. 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.
Set the status of a djinni.
-
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.
Shows an emoticon above the char.
-
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 withdestroy_emoticon
set to true to remove the emoticon. Optional property. Default value is800
. -
destroy_emoticon
[boolean]
: destroys the emoticon. This is useful if you setduration
to-1
in a previous call of this event. If this property is set to true, events infinish_events
won't be called. Optional property. Default value isfalse
. -
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 ifis_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 isfalse
. -
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 istrue
. Only valid ifface_hero
was set totrue
. -
finish_events
[array]
: a list of Game Events that will be fired after the emoticon hides. This property is only valid ifdestroy_emoticon
is set to false. Optional property.
Sets Game Event activation.
-
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.
Fires another Game Event.
-
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 istrue
.
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.
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.
If the hero is melted into sand, call this event to make the hero to exit it.
-
finish_events
[array]
: a list of Game Events that will be fired when the hero exits sand mode. Optional property.
Sets a direction for a char to face.
-
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 ifis_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 is40
. -
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.
Colorizes the the char sprite with flame colors.
-
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 ifis_npc
is set to false. -
enable
[boolean]
: if true, will apply the flame filter, otherwise, will disable the flame filter. Optional property. Default value istrue
.
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.
-
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 whencontrol_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 ifcontrol_type
was set with"remove"
. -
x
[number]
: the x position in px of the sprite. Optional property. Not valid ifcontrol_type
was set with"remove"
. -
y
[number]
: the y position in px of the sprite. Optional property. Not valid ifcontrol_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 ifcontrol_type
was set with"remove"
. -
frame
[string]
: sets a specific frame according to the frame name given in this property. Optional property. Not valid ifcontrol_type
was set with"remove"
. -
alpha
[number]
: the alpha channel of the sprite. Range: [0, 1]. Optional property. Default value is1
. Not valid ifcontrol_type
was set with"remove"
. -
anchor_x
[number]
: the x anchor value of the sprite. Range: [0, 1]. Optional property. Default value is0
. Not valid ifcontrol_type
was set with"remove"
. -
anchor_y
[number]
: the y anchor value of the sprite. Range: [0, 1]. Optional property. Default value is0
. Not valid ifcontrol_type
was set with"remove"
. -
scale_x
[number]
: the x scale value of the sprite. Range: [0, 1]. Optional property. Default value is1
. Not valid ifcontrol_type
was set with"remove"
. -
scale_y
[number]
: the y scale value of the sprite. Range: [0, 1]. Optional property. Default value is1
. Not valid ifcontrol_type
was set with"remove"
. -
rotation
[number]
: the rotation in rad of the sprite. Optional property. Default value is0
. Not valid ifcontrol_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 ifcontrol_type
was set with"remove"
. -
play
[boolean]
: plays an animation for this sprite. Optional property. Default value isfalse
. Not valid ifcontrol_type
was set with"remove"
. -
animation
[string]
: the animation key to be played. Optional property. Not valid ifcontrol_type
was set with"remove"
. Only valid ifplay
property was set withtrue
. -
frame_rate
[number]
: the animation frame rate. Optional property. If not set, uses the default frame rate of the animation. Not valid ifcontrol_type
was set with"remove"
. Only valid ifplay
property was set withtrue
. -
loop
[boolean]
: whether the animation will loop. Optional property. If not set, will use the default value of the animation. Not valid ifcontrol_type
was set with"remove"
. Only valid ifplay
property was set withtrue
. -
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 isfalse
.
Grants an ability to a char.
-
char_key
[string]
: the key name of the char that will receive the ability. Required property. -
ability
[string]
: the ability key name. Required property.
Starts or stops an Interactable Object animation.
-
io_label
[string]
: the Interactable Object unique key name. Required property. -
action
[string]
: the animation action key. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. -
animation
[string]
: the animation key. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. -
frame_rate
[number]
: the animation frame rate. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. Default value is the animation default frame rate value. -
loop
[boolean]
: if true, the animation will loop. Optional property. Only valid ifstop_animation
is not set or it'sfalse
. 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 isfalse
. -
reset_frame_on_stop
[boolean]
: if true, the animation will return to the first frame when stopped. Optional property. Only valid ifstop_animation
is set totrue
. Default value isfalse
. -
finish_events
[array]
: a list of Game Events that will be fired when the animation is finished. Optional property. Only valid ifstop_animation
is not set or it'sfalse
andloop
is set tofalse
.
Tweens an IO to a given position.
-
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 isLinear.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 ifhide_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.
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.
-
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 withslot_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 withitem_key
. -
quantity
[number]
: the number of items to be checked. Optional property. Default value is1
. Only valid ifcontrol_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.
Allows a char to jump. The char can jump in the same tile he/she's in or to another position.
-
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 ifis_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 is12
. -
duration
[number]
: the jump duration in ms. Optional property. Default value is65
. -
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 isfalse
. -
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.
Moves a specific Tiled map layer by a given x/y offset.
-
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.
Sets the visibility of a Tile map layer.
-
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.
Forces a char to keep looking at another char wherever it moves.
-
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 ifis_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 iflook
property was set to true. -
target_npc_label
[string]
: the target NPC unique key name. Optional property. Don't set this property ifis_npc
is set to false. Only valid iflook
property was set to true.
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.
-
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 ifmode
property issplit
. Required property ifmode
issplit
. The destination position object when the main char is splitting. Optional property.-
x
[number]
: thex
position destination. Optional property. -
y
[number]
: they
position destination. Optional property.
-
-
destination_incremental
[boolean]
: only valid ifmode
property issplit
. Whether the value passed indestination
property will be incremented from main hero position or if it's an absolute value, for the latest, set this property tofalse
. Optional property. Default istrue
. -
destination_type
[string]
: only valid ifmode
property issplit
. Whether the value passed indestination
property will be in pixel units or tile units. Must be one of the following:"tile"
or"px"
. Optional property. Default istile
. -
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 ifmode
property issplit
. 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 ifmode
property issplit
. 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 ifmode
property issplit
. 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 totrue
. Optional property. Default isfalse
. -
dash
[boolean]
: iftrue
, the main char will dash while it's moving instead of walk. Optional property. Default isfalse
. -
finish_events
[array]
: a list of Game Events that will be fired when the join/split is finished. Optional property.
Sets the blend mode of a specific map layer.
-
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.
Sets or transitions the alpha channel of a specific map layer.
-
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 is0
. -
finish_events
[array]
: a list of Game Events that will be fired when the transition is done. Optional property.
Moves/translates a char to a position/destination. The char can walk or dash to the destination.
-
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 ifis_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
andy
properties.-
x
[number|object]
: the x position of the destination. It can be in px or tile position, depending on what was set indest_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 indest_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 inx
property right above.
-
-
Storage value type: it must be a storage value of
-
dest_unit_in_tile
[boolean]
: if true, thedest
property will have its values in tile position number, otherwise the values will be in px. Optional property. Default value istrue
. -
dash
[boolean]
: if true, the char will dash, otherwise, walk. Optional property. Default value isfalse
. -
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 is3
px. -
camera_follow
[boolean]
: if true, the camera will follow the char while it moves. Optional property. Default value isfalse
. -
camera_follow_duration
[number]
: the camera transition duration in ms when targeting a char. Optional property. Default value is400
. Only valid ifcamera_follow
and/orfollow_hero_on_finish
properties are set totrue
. -
reset_previous_camera_target
[boolean]
: if true, the camera will follow the object it was following before this event. Optional property. Default value isfalse
. Only valid ifcamera_follow
property is set totrue
. -
camera_unfollow_char_on_finish
[boolean]
: if true, the camera will stop following the char on movement end. Optional property. Default value isfalse
. Only valid ifcamera_follow
property is set totrue
. This property has no effect ifreset_previous_camera_target
property is set totrue
. -
follow_hero_on_finish
[boolean]
: if true, the camera will follow the hero on movement finish. Optional property. Default value isfalse
. -
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 totrue
, it will keep this collision disable. Optional property. Default value isfalse
. -
deactive_char_on_end
[boolean]
: if true, it will deactive char on finish. Optional property. Default value isfalse
. -
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.
Applys an outline effect in a char.
-
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 ifis_npc
is set to false. -
enable
[boolean]
: if true, will apply the outline effect, otherwise, will remove the effect. Optional property. Default value istrue
. -
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 istrue
. Only valid ifenable
property istrue
. -
color
[object]
: the color of the outline. Optional property. Default is white. Only valid ifenable
property istrue
.-
r
[number]
: the red channel of RGB. Range: [0, 1]. Optional property. Default is1
. -
g
[number]
: the green channel of RGB. Range: [0, 1]. Optional property. Default is1
. -
b
[number]
: the blue channel of RGB. Range: [0, 1]. Optional property. Default is1
.
-
Adds or removes a main char into the party.
-
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 istrue
. -
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 istrue
. Only valid ifjoin
property is set totrue
. -
finish_events
[array]
: a list of Game Events that will be fired when the dialog is done. Optional property.
Sets or unsets a permanent status in a char.
-
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 istrue
. -
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 is1.0
. Only valid ifpermanent_status
property was set with"downed"
andadd
property is set tofalse
.
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.
Activates or deactivates an NPC or hero.
-
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 ifis_npc
is set to false. -
active
[boolean]
: if true, it will activate the char, otherwise it will deactivate. Required property.
Controls a char collision body. Enables, disables, or destroys it.
-
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 ifis_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.
-
Sets HP or PP for a main char or entire party.
-
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.
Controls a char sprite visibility.
-
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 ifis_npc
is set to false. -
visible
[boolean]
: if true, the char will be visible. Required property.
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.
-
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.
Controls an Interactable Object collision body. Enables, disables, or destroys it.
-
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.
-
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.
-
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.
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.
-
collision_active
[boolean]
: if true, the collision between NPCs and the hero is active. Required property.
Control the party coins number.
-
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.
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.
-
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 innpc_label
property. Optional property. Default isfalse
. -
check_io_storage_values
[boolean]
: if true, will force the storage values update of the IO specified inio_label
property. Optional property. Default isfalse
. -
check_collision_structures
[boolean]
: if true, this storage variable change will trigger a check whether collision structures withcontroller_variable
property set should collide or not with the hero. Optional property. Default isfalse
. -
check_layers_visibility
[boolean]
: if true, this storage variable change will trigger a check whether Tiled tile layers withhidden
property set to a string value corresponding to this storage value that's being modified should be visible or not. Optional property. Default isfalse
. -
io_label
[string]
: the IO unique key name to have its storage values checked ifcheck_io_storage_values
is true. Optional property. -
npc_label
[string]
: the NPC unique key name to have its storage values checked ifcheck_npc_storage_values
is true. Optional property. -
increment
[boolean]
: if true, it will incrementally set the value passed. Optional property. Default isfalse
. -
dismiss_checks
[boolean]
: if true, it won't check whether a given IO/NPC/Hero/Event property exists before setting. Optional property. Default isfalse
.
Fires a list of game events when specific(s) storage value(s) changed.
-
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.
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.
-
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 istrue
. -
finish_events
[array]
: a list of Game Events that will be fired when the summon is gotten. Optional property.
Teleports to another map. Please notice that after this event is called, the current map will be unmounted. Use it wisely.
-
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).
Manages some properties of a selected Tile Event or all Tile Events from an Interactable Object.
-
tile_event_key
[string]
: the unique tile event key name to be managed. Optional property ifio_label
property is set. -
io_label
[string]
: the unique Interactable Object key name to be retrieved all Tile Events. Optional property iftile_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]
: iftrue
, the selected Tile Event will be removed from the map. Optional property. Default value isfalse
.
Waits for a period of time.
-
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.
Tints a char by filling its sprite area with a solid color.
-
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 ifis_npc
is set to false. -
enable
[boolean]
: if true, will apply the tint effect, otherwise, will remove the effect. Optional property. Default value istrue
. -
color
[object]
: the color that will fill the char's sprite. Optional property. Only valid ifenable
property istrue
.-
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.
-
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
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
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
type
x
y
location_key
id
affected_by_reveal
key_name
allow_active_in_diagonal
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
- Home
- Introduction for developers
- Tutorials
- Game initialization settings
- Map settings
-
Game Events
- Add item to party event
- Audio play event
- Battle event
- Branch event
- Camera fade event
- Camera follow event
- Camera move event
- Camera shake event
- Casting aura event
- Change collision layer event
- Char animation play event
- Char blend mode event
- Char exp event
- Char fall event
- Char hue event
- Char item manipulation event
- Char level change event
- Char rotation event
- Char shadow visibility event
- Char tween position event
- Chest event
- Colorize char event
- Colorize map event
- Control bgm event
- Create storage var event
- Custom collision body event
- Destroyer event
- Dialog event
- Djinn get event
- Djinn set status event
- Emoticon event
- Event activation event
- Event caller event
- Event holder event
- Event loop event
- Exit Sand mode event
- Face direction event
- Flame char event
- Generic sprite event
- Grant ability event
- IO anim play event
- IO tween position event
- Item checks event
- Jump event
- Layer tween event
- Layer visibility event
- Look event
- Main chars join split event
- Map blend mode event
- Map opacity event
- Move event
- Outline char event
- Particles event
- Party join event
- Permanent status event
- Psynergy stone event
- Set char activation event
- Set char collision event
- Set char visibility event
- Set IO activation event
- Set IO collision event
- Set IO visibility event
- Set NPC collision event
- Set party coins event
- Set value event
- Storage change event
- Summon event
- Teleport event
- Tile event manage event
- Timer event
- Tint char event
- Databases
- Code reference