Difference between revisions of "Event Reference"

From Tuxepedia
Jump to navigation Jump to search
Line 5: Line 5:
== Condition Reference ==
== Condition Reference ==


Here is a list of currently implemented conditions. New event conditions can be created by creating a new method under the '''core.components.event.condition''' module:
Here is a list of currently implemented conditions. New event conditions can be created by creating a new page under the '''tuxemon/event/conditions''':


=== true ===
=== battle_is ===
The <code>true</code> condition will always evaluate to *True* (unless the "not" operator is used)
[...]


'''Parameters'''
=== button_pressed ===
* <code>None</code>
Check to see if a particular key has been pressed. E.g. <code>K_RETURN</code>.
 
'''Examples'''
* <code>is true</code> 
* <code>not true</code>
 
=== player_at ===
Check to see if the player is inside the event's area. This event will check the event object's <code>X</code>, <code>Y</code>, <code>Width</code>, and <code>Height</code> properties and checks to see if the player is within those bounds. That includes event areas that are greater than one tile in size. You can optionally include an <code>x,y</code> parameter to specify a single tile location.


'''Parameters'''  
'''Parameters'''  
* <code>x</code>: X tile coordinates that the player is at (optional) 
* <code>key</code>: A pygame key constant such as <code>K_RETURN</code>. For a list of all possible keys, refer to the [https://www.pygame.org/docs/ref/key.html Pygame Key Page]
* <code>y</code>: Y tile coordinate that the player is at (optional)


'''Examples'''  
'''Examples'''  
* <code>is player_at</code>   
* <code>is button_pressed K_RETURN</code>   
* <code>is player_at 4,3</code>
* <code>is button_pressed K_ESCAPE</code> 
* <code>not button_pressed K_SPACE</code>


=== player_facing ===
=== button_released ===
Check to see if the player is facing: <code>up</code>, <code>down</code>, <code>left</code> or <code>right</code>.
[...]


'''Parameters'''
=== combat_started ===
* <code>direction</code>: Direction to check for: (<code>up</code>, <code>down</code>, <code>left</code>, <code>right</code>)
Check to see if combat has currently started.
 
'''Examples'''
* <code>is player_facing up</code> 
* <code>not player_facing down</code>
 
=== player_facing_tile ===
Check to see if the player is facing a particular tile. This event will check the event object's <code>X</code>, <code>Y</code> coordinates for the tile to check for.


'''Parameters'''  
'''Parameters'''  
Line 45: Line 31:


'''Examples'''  
'''Examples'''  
* <code>is player_facing_tile</code>
* <code>is combat_started</code>


=== player_moved ===
=== dialog_open ===
Checks to see if the player has just moved. If the player is standing still, this condition will return <code>False</code>.
Check to see if a dialog window is currently open.


'''Parameters'''  
'''Parameters'''  
Line 54: Line 40:


'''Examples'''  
'''Examples'''  
* <code>is player_moved</code>   
* <code>is dialog_open</code>   
* <code>not player_moved</code>
* <code>not dialog_open</code>
 
=== has_item ===
[...]


=== has_monster ===
=== has_monster ===
Line 66: Line 55:
* <code>is has_monster txmn_pigabyte</code>
* <code>is has_monster txmn_pigabyte</code>


=== has_item ===
=== has_party_breeder ===
[...]


'''Parameters'''
=== has_tech ===
* <code>item</code>: The item name to check for.
[...]
* <code>operator</code>: Greater than, less than, etc (optional).
* <code>quantity</code>: The quantity to check for (optional).


'''Examples'''
=== money_is ===
* <code>is has_item player,hatchet,>=,1</code>
[...]
* <code>is has_item player,hatchet</code>


=== combat_started ===
=== monster_flair ===
Check to see if combat has currently started.
[...]


'''Parameters'''
=== monster_property ===
* <code>None</code>
[...]


'''Examples'''
=== music_playing ===
* <code>is combat_started</code>
Check to see if the specified music file is currently playing.
 
=== button_pressed ===
Check to see if a particular key has been pressed. E.g. <code>K_RETURN</code>.


'''Parameters'''  
'''Parameters'''  
* <code>key</code>: A pygame key constant such as <code>K_RETURN</code>. For a list of all possible keys, refer to the [https://www.pygame.org/docs/ref/key.html Pygame Key Page]
* <code>music_file</code>: The music file to check.


'''Examples'''  
'''Examples'''  
* <code>is button_pressed K_RETURN</code>   
* <code>is music_playing 472452_8-Bit-Ambient.ogg</code>   
* <code>is button_pressed K_ESCAPE</code> 
* <code>not button_pressed K_SPACE</code>


=== dialog_open ===
=== npc_at ===
Check to see if a dialog window is currently open.
Check to see if the npc is inside the event's area. This event will check the event object's <code>X</code>, <code>Y</code>, <code>Width</code>, and <code>Height</code> properties and checks to see if the npc is within those bounds. That includes event areas that are greater than one tile in size. You can optionally include an <code>x,y</code> parameter to specify a single tile location.


'''Parameters'''  
'''Parameters'''  
* <code>None</code>
* <code>name</code>: The name of the NPC.   
* <code>x</code>: X tile coordinates that the player is at (optional) 
* <code>y</code>: Y tile coordinate that the player is at (optional)


'''Examples'''  
'''Examples'''  
* <code>is dialog_open</code>   
* <code>is npc_at Maple</code>   
* <code>not dialog_open</code>
* <code>is npc_at Maple,4,3</code>
 
=== variable_set ===
Check to see if <code>variable_name</code> has been set to <code>value</code>.
 
'''Parameters'''
* <code>variable_name:value</code>: A key, value pair of the variable to look up and the expected value.
 
'''Examples'''
* <code>is variable_set battle_won:yes</code> 
* <code>not variable_set current_badges:4</code> 
* <code>is variable_set talked_to_prof:false</code>


=== npc_exists ===
=== npc_exists ===
Line 127: Line 100:
* <code>not npc_exists Apple</code>
* <code>not npc_exists Apple</code>


=== npc_at ===
=== npc_facing_tile ===
Check to see if the npc is inside the event's area. This event will check the event object's <code>X</code>, <code>Y</code>, <code>Width</code>, and <code>Height</code> properties and checks to see if the npc is within those bounds. That includes event areas that are greater than one tile in size. You can optionally include an <code>x,y</code> parameter to specify a single tile location.
Check to see if the npc is facing a particular tile. This event will check the event object's <code>X</code>, <code>Y</code> coordinates for the tile to check for.


'''Parameters'''  
'''Parameters'''  
* <code>name</code>: The name of the NPC.     
* <code>name</code>: The name of the NPC.     
* <code>x</code>: X tile coordinates that the player is at (optional) 
* <code>y</code>: Y tile coordinate that the player is at (optional)


'''Examples'''  
'''Examples'''  
* <code>is npc_at Maple</code>   
* <code>is npc_facing_tile Maple</code>   
* <code>is npc_at Maple,4,3</code>


=== npc_facing ===
=== npc_facing ===
Line 149: Line 119:
* <code>is npc_facing Maple,up</code>   
* <code>is npc_facing Maple,up</code>   
* <code>not npc_facing Maple,down</code>
* <code>not npc_facing Maple,down</code>
=== npc_facing_tile ===
Check to see if the npc is facing a particular tile. This event will check the event object's <code>X</code>, <code>Y</code> coordinates for the tile to check for.
'''Parameters'''
* <code>name</code>: The name of the NPC.   
'''Examples'''
* <code>is npc_facing_tile Maple</code> 
=== facing_npc ===
Check to see if the player is facing an NPC with the name <code>npc_name</code>.
'''Parameters'''
* <code>npc_name</code>: The name of the NPC on the current map.
'''Examples'''
* <code>is facing_npc Apple</code>


=== party_size ===
=== party_size ===
Line 180: Line 132:
* <code>is party_size greater_than,4</code>
* <code>is party_size greater_than,4</code>


=== music_playing ===
=== player_at ===
Check to see if the specified music file is currently playing.
Check to see if the player is inside the event's area. This event will check the event object's <code>X</code>, <code>Y</code>, <code>Width</code>, and <code>Height</code> properties and checks to see if the player is within those bounds. That includes event areas that are greater than one tile in size. You can optionally include an <code>x,y</code> parameter to specify a single tile location.


'''Parameters'''  
'''Parameters'''  
* <code>music_file</code>: The music file to check.
* <code>x</code>: X tile coordinates that the player is at (optional) 
* <code>y</code>: Y tile coordinate that the player is at (optional)


'''Examples'''  
'''Examples'''  
* <code>is music_playing 472452_8-Bit-Ambient.ogg</code>   
* <code>is player_at</code>   
* <code>is player_at 4,3</code>


== Action Reference ==
=== player_defeated ===
[...]


Here is a list of currently supported actions. New event actions can be created by creating a new function under the '''core.components.event.Action''' class:
=== player_facing_npc ===
Check to see if the player is facing an NPC with the name <code>npc_name</code>.


=== npc_move ===
'''Parameters'''
Determines the NPC's movement behaviour.  
* <code>npc_name</code>: The name of the NPC on the current map.


'''Examples'''  
'''Examples'''  
* <code>npc_move spyder_homemakerpapertown, down 1, right 1, up 1, left 1</code>
* <code>is player_facing_npc Apple</code>


=== npc_speed ===
=== player_facing_tile ===
Sets the NPC's walk speed.  
Check to see if the player is facing a particular tile. This event will check the event object's <code>X</code>, <code>Y</code> coordinates for the tile to check for.


'''Examples'''  
'''Parameters'''  
* <code>npc_speed npc_mom, 0.2</code>
* <code>None</code>
 
=== npc_run ===
Sets the NPC's speed to the universal run speed. 


'''Examples'''  
'''Examples'''  
* <code>npc_run npc_mom</code>
* <code>is player_facing_tile</code>


=== npc_walk ===
=== player_facing ===
Sets the NPC's speed to the universal walk speed.
[...]


'''Examples'''
=== player_moved ===
* <code>npc_walk npc_mom</code>
[...]


=== npc_wander ===
=== to_talk ===
Sets the NPC's behaviour to wander about instead of stand in place.
[...]


'''Examples'''
=== to_use_tile ===
* <code>npc_wander npc_mom</code>
[...]


=== teleport ===
=== true ===
Teleports the player to a given position on a map. This teleport is immediate and does not have any transition animation.
The <code>true</code> condition will always evaluate to *True* (unless the "not" operator is used)


'''Parameters'''  
'''Parameters'''  
* <code>map_name</code>: The map file to teleport the player to. 
* <code>None</code>
* <code>x</code>: The X-tile coordinate to teleport the player to. 
* <code>y</code>: The Y-tile coordinate to teleport the player to.


'''Examples'''  
'''Examples'''  
* <code>teleport map1.tmx,3,4</code>   
* <code>is true</code>   
* <code>teleport room1.tmx,8,1</code>
* <code>not true</code>
 
=== tuxepedia_is ===
[...]
 
=== variable_is ===
[...]


=== transition_teleport ===
=== variable_set ===
Teleports the player to a given position on a map with a screen transition over <code>x</code> seconds.
Check to see if <code>variable_name</code> has been set to <code>value</code>.


'''Parameters'''  
'''Parameters'''  
* <code>map_name</code>: The map file to teleport the player to. 
* <code>variable_name:value</code>: A key, value pair of the variable to look up and the expected value.
* <code>x</code>: The X-tile coordinate to teleport the player to. 
* <code>y</code>: The Y-tile coordinate to teleport the player to
* <code>transition_time</code>: The time in seconds the transition will last.


'''Examples'''  
'''Examples'''  
* <code>teleport map2.tmx,1,6,1.5</code>   
* <code>is variable_set battle_won:yes</code>   
* <code>teleport room1.tmx,8,1,4</code>
* <code>not variable_set current_badges:4</code> 
* <code>is variable_set talked_to_prof:false</code>


=== call_event ===
== Action Reference ==
Executes the actions from another event, ignoring its conditions. This can be especially useful for scenarios where you might need multiple sets of conditions that could be true, such as executing an action when the player is at a certain position OR has a certain item in their inventory.


'''Parameters'''  
Here is a list of currently supported actions. New event actions can be created by creating a new page under the '''tuxemon/event/actions''':
* <code>event_id</code>: The id of the event whose actions should be executed. 


'''Examples''' 
=== add_contacts ===
* <code>call_event 11</code>   
[...]
* <code>call_event 8</code>


=== set_variable ===
=== add_item ===
Sets an arbitrary variable to a particular value. This action is good for seeing if battles with NPCs have been fought or not. These variables are also saved when the player saves the game.
Add the specified itemto the player's party.
 
Also used to set the [[:Category:Environment|environment]].


'''Parameters'''  
'''Parameters'''  
* <code>variable_name:value</code>: A key, value pair of the <code>variable_name</code> to set with <code>value</code>.   
* <code>item_name</code>: The name of the item to add as defined in the monster JSON under <code>resources/db/item</code>.   


'''Examples'''  
'''Examples'''  
* <code>set_variable battle_won:yes</code> 
* <code>add_item hatchet</code>
* <code>set_variable talked_to_prof:true</code>
* <code>set_variable environment:grass</code>


=== play_sound ===
=== add_monster ===
Plays an audio file located under "sounds/".
Add the specified monster to the player's party.


'''Parameters'''  
'''Parameters'''  
* <code>filename</code>: The name of the sound file to play under "sounds/"  
* <code>monster_name</code>: The name of the monster to add as defined in the monster JSON under <code>resources/db/monster</code>.  
* <code>monster_lvl</code>: The level of the monster to start at.


'''Examples'''  
'''Examples'''  
* <code>play_sound combat/falling_Macro.ogg</code>
* <code>add_monster fruitera,10</code>


=== play_music ===
=== battles_print ===
Plays an audio file located under "music/" on a loop.
[...]


'''Parameters'''
=== breeding ===
* <code>filename</code>: The name of the music file to play under "music/" 
[...]


'''Examples'''
=== call_event ===
* <code>play_music 472452_8-Bit-Ambient.ogg</code>
Executes the actions from another event, ignoring its conditions. This can be especially useful for scenarios where you might need multiple sets of conditions that could be true, such as executing an action when the player is at a certain position OR has a certain item in their inventory.
 
=== player_face ===
Makes the player face a particular direction. Parameter can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.


'''Parameters'''  
'''Parameters'''  
* <code>direction</code>: Direction to make the player face. Can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.
* <code>event_id</code>: The id of the event whose actions should be executed.


'''Examples'''  
'''Examples'''
* <code>player_face left</code>
* <code>call_event 11</code>  
* <code>player_face up</code>
* <code>call_event 8</code>


=== player_stop ===
=== change_state ===
Stops the player's current movement.
[...]


There is currently no way to stop a player from inputting another movement after being stopped ([https://github.com/Tuxemon/Tuxemon/issues/790 issue #790])
=== clear_kennel ===
[...]


'''Parameters'''
=== clear_tuxepedia ===
* <code>None</code> 
[...]


'''Examples'''
=== clear_variable ===
* <code>player_stop</code> 
[...]


=== player_resume ===
=== copy_variable ===
Does not currently have a purpose.
[...]


'''Parameters'''
=== create_npc ===
* <code>None</code> 
Creates an NPC and places them on the current map.
 
'''Examples'''
* <code>player_resume</code> 
 
=== pause_music ===
Pauses the currently playing music.


'''Parameters'''  
'''Parameters'''  
* <code>None</code>
* <code>name</code>: The name of the NPC to create. This NPC should exist in <code>resources/db/npc</code> in JSON format. 
* <code>tile_pos_x</code>: The X-tile coordinate to place the NPC. 
* <code>tile_pos_y</code>: The Y-tile coordinate to place the NPC. 
* <code>animations</code>: The name of the sprite to use for the animations in <code>resources/sprites</code>. 
* <code>behavior</code>: The NPC's movement behavior. Currently not implemented. 


'''Examples'''  
'''Examples'''  
* <code>pause_music</code>
* <code>create_npc Maple,2,3,maple,wander</code> 
* <code>create_npc Pine,1,6,maple,stand</code>


=== fadeout_music ===
=== delayed_teleport ===
Fades out music over <code>x</code> milliseconds.
[...]


'''Parameters'''
=== dialog_chain ===
* <code>time_seconds</code>: Time in milliseconds to fade out the currently playing music.
Deprecated. Use [#dialog dialog]
 
'''Examples'''
* <code>fadeout_music 2</code>


=== dialog ===
=== dialog ===
Line 349: Line 292:
* <code>dialog $<nowiki>{{</nowiki>name<nowiki>}}</nowiki>:\n Hello there! \nHow are you?</code>   
* <code>dialog $<nowiki>{{</nowiki>name<nowiki>}}</nowiki>:\n Hello there! \nHow are you?</code>   


=== translated_dialog ===
=== fadeout_music ===
Opens the dialog box with translated text for a given key found in <code>resources/db/locale/<locale>.json</code>. Optional variable replacement will also be translated if the value is a key in the locale file. For line breaks, use the <code>\n</code> character. If you have multiple translated_dialog commands they will display sequentially. Using <code>$<nowiki>{{</nowiki>end<nowiki>}}</nowiki></code> does nothing as it used to denote the end of a dialog chain. You may also use special variables in dialog events. Here is a list of available variables:
Fades out music over <code>x</code> milliseconds.
   
* <code>$<nowiki>{{</nowiki>name<nowiki>}}</nowiki></code> - The current player's name.


'''Parameters'''  
'''Parameters'''  
* <code>dialog_key</code>: The translated text for a given key found in <code>resources/db/locale/<locale>.json</code> to display in a dialog window.   
* <code>time_seconds</code>: Time in milliseconds to fade out the currently playing music.
* <code>parameters</code>: Optional comma-separated <code>var=value</code> parameters to replace variables in the translation text. The <code>value</code> can either be text or a key found in <code>resources/db/locale/<locale>.json</code>.


'''Examples'''  
'''Examples'''  
* <code>translated_dialog received_x,name=a brand new car!</code>
* <code>fadeout_music 2</code>
* <code>translated_dialog received_x,name=item_potion</code> 
 
* <code>translated_dialog combat_fainted,name=$<nowiki>{{</nowiki>name<nowiki>}}</nowiki></code> 
=== get_player_monster ===
* <code>translated_dialog combat_opponent_call_tuxemon,user=$<nowiki>{{</nowiki>name<nowiki>}}</nowiki>,name=some guy</code> 
[...]


=== dialog_chain ===
=== kennel_print ===
Deprecated. Use [#dialog dialog]
[...]


=== translated_dialog_chain ===
=== lock_controls ===
Deprecated. Use [#translated_dialog translated_dialog]
[...]


=== dialog_choice ===
=== modify_npc_attribute ===
Asks the player to select a choice.
[...]


'''Parameters'''
=== modify_player_attribute ===
* <code>choices</code>: The possible choices separated by colons.
[...]
* <code>variable</code>: The variable to store the answer.


'''Examples'''
=== money_print ===
* <code>dialog_choice Yes:No:Maybe,myvariable</code> 
[...]


=== translated_dialog_choice ===
=== npc_face ===
Asks the player to select a choice. The translations for the text are looked up based on a given key.
Makes the npc face a particular direction. Parameter can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.


'''Parameters'''  
'''Parameters'''  
* <code>choice_keys</code>: Keys to reference translated text choices separated by colons.
* <code>name</code>: The name of the npc.  
* <code>variable</code>: The variable to store the answer which will be the key for the translated text.
* <code>direction</code>: Direction to make the player face. Can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.


'''Examples'''  
'''Examples'''  
* <code>translated_dialog_choice yes:no,myvariable</code>
* <code>npc_face Maple,left</code>
* <code>npc_face Pine,up</code>
 
=== npc_move ===
Determines the NPC's movement behaviour.


=== screen_transition ===
'''Examples'''
Fades the screen to black and back over <code>x</code> seconds.
* <code>npc_move spyder_homemakerpapertown, down 1, right 1, up 1, left 1</code>


'''Parameters'''
=== npc_run ===
* <code>transition_time</code>: Time in seconds to fade the screen to black.
Sets the NPC's speed to the universal run speed.


'''Examples'''  
'''Examples'''  
* <code>screen_transition 2</code>
* <code>npc_run npc_mom</code>


=== create_npc ===
=== npc_speed ===
Creates an NPC and places them on the current map.
Sets the NPC's walk speed.  
 
'''Parameters'''
* <code>name</code>: The name of the NPC to create. This NPC should exist in <code>resources/db/npc</code> in JSON format. 
* <code>tile_pos_x</code>: The X-tile coordinate to place the NPC. 
* <code>tile_pos_y</code>: The Y-tile coordinate to place the NPC. 
* <code>animations</code>: The name of the sprite to use for the animations in <code>resources/sprites</code>. 
* <code>behavior</code>: The NPC's movement behavior. Currently not implemented.


'''Examples'''  
'''Examples'''  
* <code>create_npc Maple,2,3,maple,wander</code> 
* <code>npc_speed npc_mom, 0.2</code>
* <code>create_npc Pine,1,6,maple,stand</code>


=== remove_npc ===
=== npc_walk ===
Removes an NPC from the current map.
Sets the NPC's speed to the universal walk speed.   
 
'''Parameters'''
* <code>name</code>: The name of the NPC to remove.   


'''Examples'''  
'''Examples'''  
* <code>remove_npc Maple</code> 
* <code>npc_walk npc_mom</code>
* <code>remove_npc Pine</code>


=== npc_face ===
=== npc_wander ===
Makes the npc face a particular direction. Parameter can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.
Sets the NPC's behaviour to wander about instead of stand in place.


'''Parameters'''  
'''Examples'''  
* <code>name</code>: The name of the npc.   
* <code>npc_wander npc_mom</code>  
* <code>direction</code>: Direction to make the player face. Can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.


'''Examples'''
=== open_shop ===
* <code>npc_face Maple,left</code> 
[...]
* <code>npc_face Pine,up</code>


=== pathfind ===
=== pathfind ===
Line 446: Line 375:
* <code>pathfind Pine,1,6</code>
* <code>pathfind Pine,1,6</code>


=== start_battle  ===
=== pause_music ===
Start a battle with an NPC defined in <code>resources/db/npc</code>.
Pauses the currently playing music.
 
'''Parameters'''
* <code>None</code>
 
'''Examples'''
* <code>pause_music</code>
 
=== play_map_animation ===
Plays an animation on the map. The <code>position</code> parameter can also be <code>player</code> if you want to draw the animation at the player's location. Loop can be either <code>loop</code> or <code>noloop</code>.
 
'''Parameters'''
* <code>animation_name</code>: The name of the animation to play under <code>resources/animations/tileset</code>. 
* <code>duration</code>: The amount of time in seconds between each frame. 
* <code>loop</code>: Whether or not to loop the animation. Can be either <code>loop</code> or <code>noloop</code> to loop the animation. 
* <code>position</code>: The position to draw the animation. Can either be an <code>x,y</code> coordinate or <code>player</code> to draw the animation over the player.
 
'''Examples'''
* <code>play_map_animation grass,0.1,noloop,player</code> 
* <code>play_map_animation sign01,0.4,loop,33,10</code>
 
=== play_music ===
Plays an audio file located under "music/" on a loop.


Here is an example NPC file:
'''Parameters'''
* <code>filename</code>: The name of the music file to play under "music/" 


''resources/db/npc/maple.json''
'''Examples'''  
* <code>play_music 472452_8-Bit-Ambient.ogg</code>


    json
=== play_sound ===
    {
Plays an audio file located under "sounds/".
    "monsters": [
        {
            "attack": 50,
            "defense": 7,
            "name": "Snowball",
            "special_attack": 9,
            "level": 5,
            "monster_slug": 1,
            "hp": 50,
            "speed": 7,
            "special_defense": 7,
            "exp_give_mod": 3,
            "exp_req_mod": 27
        }
    ],
    "id": 1,
    "name": "Maple"
    }


'''Parameters'''  
'''Parameters'''  
* <code>npc_slug</code>: The NPC's slug as defined in the NPC's JSON file in <code>resources/db/npc</code>.
* <code>filename</code>: The name of the sound file to play under "sounds/


'''Examples'''  
'''Examples'''  
* <code>start_battle npc_maple</code>
* <code>play_sound combat/falling_Macro.ogg</code>


=== add_item ===
=== player_face ===
Add the specified itemto the player's party.
Makes the player face a particular direction. Parameter can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.


'''Parameters'''  
'''Parameters'''  
* <code>item_name</code>: The name of the item to add as defined in the monster JSON under <code>resources/db/item</code>.
* <code>direction</code>: Direction to make the player face. Can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>.


'''Examples'''  
'''Examples'''  
* <code>add_item hatchet</code>
* <code>player_face left</code> 
* <code>player_face up</code>


=== add_monster ===
=== player_resume ===
Add the specified monster to the player's party.
Does not currently have a purpose.


'''Parameters'''  
'''Parameters'''  
* <code>monster_name</code>: The name of the monster to add as defined in the monster JSON under <code>resources/db/monster</code>.  
* <code>None</code>   
* <code>monster_lvl</code>: The level of the monster to start at.


'''Examples'''  
'''Examples'''  
* <code>add_monster fruitera,10</code>
* <code>player_resume</code>
 
=== player_stop ===
Stops the player's current movement.


=== remove_monster ===
There is currently no way to stop a player from inputting another movement after being stopped ([https://github.com/Tuxemon/Tuxemon/issues/790 issue #790])
Removes the specified monster from the player's party.


'''Parameters'''  
'''Parameters'''  
* <code>monster_slug</code>: The slug of the monster to remove as defined in the monster JSON under <code>resources/db/monster</code>.  
* <code>None</code>   


'''Examples'''  
'''Examples'''  
* <code>remove_monster fruitera</code>
* <code>player_stop</code>
 
=== print ===
[...]
 
=== quit ===
[...]


=== random_encounter ===
=== random_encounter ===
Line 554: Line 497:
* <code>random_encounter route1,20</code>
* <code>random_encounter route1,20</code>


=== play_map_animation ===
=== random_integer ===
Plays an animation on the map. The <code>position</code> parameter can also be <code>player</code> if you want to draw the animation at the player's location. Loop can be either <code>loop</code> or <code>noloop</code>.
[...]
 
=== random_monster ===
[...]
 
=== remove_contacts ===
[...]
 
=== remove_monster ===
Removes the specified monster from the player's party.


'''Parameters'''  
'''Parameters'''  
* <code>animation_name</code>: The name of the animation to play under <code>resources/animations/tileset</code>. 
* <code>monster_slug</code>: The slug of the monster to remove as defined in the monster JSON under <code>resources/db/monster</code>.   
* <code>duration</code>: The amount of time in seconds between each frame. 
* <code>loop</code>: Whether or not to loop the animation. Can be either <code>loop</code> or <code>noloop</code> to loop the animation.   
* <code>position</code>: The position to draw the animation. Can either be an <code>x,y</code> coordinate or <code>player</code> to draw the animation over the player.


'''Examples'''  
'''Examples'''  
* <code>play_map_animation grass,0.1,noloop,player</code> 
* <code>remove_monster fruitera</code>
* <code>play_map_animation sign01,0.4,loop,33,10</code>


=== wait_for_input ===
=== remove_npc ===
Pauses execution of all events until the given input is received.
Removes an NPC from the current map.


'''Parameters'''  
'''Parameters'''  
* <code>input</code>: The pygame input to wait for.   
* <code>name</code>: The name of the NPC to remove.   


'''Examples'''  
'''Examples'''  
* <code>wait_for_input K_RETURN</code>   
* <code>remove_npc Maple</code>   
* <code>wait_for_input K_Q</code>
* <code>remove_npc Pine</code>
 
=== rename_monster ===
[...]
 
=== rename_player ===
[...]
 
=== rumble ===
[...]


=== wait ===
=== screen_transition ===
Pauses execution of all events for the given amount of time in seconds.
Fades the screen to black and back over <code>x</code> seconds.


'''Parameters'''  
'''Parameters'''  
* <code>seconds</code>: The amount of time in seconds to wait for.
* <code>transition_time</code>: Time in seconds to fade the screen to black.


'''Examples'''  
'''Examples'''  
* <code>wait 2.0</code>
* <code>screen_transition 2</code>
* <code>wait 5.2</code>
 
=== set_battle ===
[...]
 
=== set_code ===
[...]
 
=== set_economy ===
[...]
 
=== set_inventory ===
=== set_inventory ===
Overwrites the inventory of the npc or player.
Overwrites the inventory of the npc or player.
Line 595: Line 561:
'''Examples'''  
'''Examples'''  
* <code>set_inventory shopkeeper,new_stock</code>
* <code>set_inventory shopkeeper,new_stock</code>
=== set_kennel_visible ===
[...]
=== set_kennel ===
[...]
=== set_money ===
[...]
=== set_monster_flair ===
[...]
=== set_monster_health ===
=== set_monster_health ===
Changes the hp of a monster in the current player's party. The action parameters may contain a monster slot and the amount of health.  
Changes the hp of a monster in the current player's party. The action parameters may contain a monster slot and the amount of health.  
Line 613: Line 592:
'''Examples'''  
'''Examples'''  
* <code>set_monster_level 1,100</code>
* <code>set_monster_level 1,100</code>
=== set_monster_level ===
[...]
=== set_monster_status ===
[...]
=== set_npc_attribute ===
[...]
=== set_player_attribute ===
[...]
=== set_tuxepedia ===
[...]
=== set_variable ===
Sets an arbitrary variable to a particular value. This action is good for seeing if battles with NPCs have been fought or not. These variables are also saved when the player saves the game.
Also used to set the [[:Category:Environment|environment]].
'''Parameters'''
* <code>variable_name:value</code>: A key, value pair of the <code>variable_name</code> to set with <code>value</code>. 
'''Examples'''
* <code>set_variable battle_won:yes</code> 
* <code>set_variable talked_to_prof:true</code>
* <code>set_variable environment:grass</code>
=== spawn_monster ===
[...]
=== start_battle ===
Start a battle with an NPC defined in <code>resources/db/npc</code>.
Here is an example NPC file:
''resources/db/npc/maple.json'' 
    json
    {
    "monsters": [
        {
            "attack": 50,
            "defense": 7,
            "name": "Snowball",
            "special_attack": 9,
            "level": 5,
            "monster_slug": 1,
            "hp": 50,
            "speed": 7,
            "special_defense": 7,
            "exp_give_mod": 3,
            "exp_req_mod": 27
        }
    ],
    "id": 1,
    "name": "Maple"
    }
'''Parameters'''
* <code>npc_slug</code>: The NPC's slug as defined in the NPC's JSON file in <code>resources/db/npc</code>.
'''Examples'''
* <code>start_battle npc_maple</code>
=== start_cinema_mode ===
[...]
=== stop_cinema_mode ===
[...]
=== store_monster ===
[...]
=== teleport_faint ===
[...]
=== teleport ===
Teleports the player to a given position on a map. This teleport is immediate and does not have any transition animation.
'''Parameters'''
* <code>map_name</code>: The map file to teleport the player to. 
* <code>x</code>: The X-tile coordinate to teleport the player to. 
* <code>y</code>: The Y-tile coordinate to teleport the player to.
'''Examples'''
* <code>teleport map1.tmx,3,4</code> 
* <code>teleport room1.tmx,8,1</code>
=== transfer_money ===
[...]
=== transition_teleport ===
Teleports the player to a given position on a map with a screen transition over <code>x</code> seconds.
'''Parameters'''
* <code>map_name</code>: The map file to teleport the player to. 
* <code>x</code>: The X-tile coordinate to teleport the player to. 
* <code>y</code>: The Y-tile coordinate to teleport the player to. 
* <code>transition_time</code>: The time in seconds the transition will last.
'''Examples'''
* <code>teleport map2.tmx,1,6,1.5</code> 
* <code>teleport room1.tmx,8,1,4</code>
=== translated_dialog_chain ===
Deprecated. Use [#translated_dialog translated_dialog]
=== translated_dialog_choice ===
Asks the player to select a choice. The translations for the text are looked up based on a given key.
'''Parameters'''
* <code>choice_keys</code>: Keys to reference translated text choices separated by colons.
* <code>variable</code>: The variable to store the answer which will be the key for the translated text.
'''Examples'''
* <code>translated_dialog_choice yes:no,myvariable</code>
=== translated_dialog ===
Opens the dialog box with translated text for a given key found in <code>resources/db/locale/<locale>.json</code>. Optional variable replacement will also be translated if the value is a key in the locale file. For line breaks, use the <code>\n</code> character. If you have multiple translated_dialog commands they will display sequentially. Using <code>$<nowiki>{{</nowiki>end<nowiki>}}</nowiki></code> does nothing as it used to denote the end of a dialog chain. You may also use special variables in dialog events. Here is a list of available variables:
   
* <code>$<nowiki>{{</nowiki>name<nowiki>}}</nowiki></code> - The current player's name.
'''Parameters'''
* <code>dialog_key</code>: The translated text for a given key found in <code>resources/db/locale/<locale>.json</code> to display in a dialog window.   
* <code>parameters</code>: Optional comma-separated <code>var=value</code> parameters to replace variables in the translation text. The <code>value</code> can either be text or a key found in <code>resources/db/locale/<locale>.json</code>.
'''Examples'''
* <code>translated_dialog received_x,name=a brand new car!</code> 
* <code>translated_dialog received_x,name=item_potion</code> 
* <code>translated_dialog combat_fainted,name=$<nowiki>{{</nowiki>name<nowiki>}}</nowiki></code> 
* <code>translated_dialog combat_opponent_call_tuxemon,user=$<nowiki>{{</nowiki>name<nowiki>}}</nowiki>,name=some guy</code> 
=== tuxepedia_print ===
[...]
=== unlock_controls ===
[...]
=== variable_math ===
=== variable_math ===
Performs a mathematical operation on the key in the player.game_variables dictionary.
Performs a mathematical operation on the key in the player.game_variables dictionary.
Line 623: Line 742:
'''Examples'''  
'''Examples'''  
* <code>variable_math badge_count,+,1</code>
* <code>variable_math badge_count,+,1</code>
=== wait ===
Pauses execution of all events for the given amount of time in seconds.
'''Parameters'''
* <code>seconds</code>: The amount of time in seconds to wait for. 
'''Examples'''
* <code>wait 2.0</code> 
* <code>wait 5.2</code>
=== withdraw_monster ===
[...]

Revision as of 08:44, 19 February 2023

Introduction

This page is a reference for all the available actions and conditions available in Tuxemon. You can use this reference to create new map events for your own maps. All action and condition parameters are separated with a comma (,).

Condition Reference

Here is a list of currently implemented conditions. New event conditions can be created by creating a new page under the tuxemon/event/conditions:

battle_is

[...]

button_pressed

Check to see if a particular key has been pressed. E.g. K_RETURN.

Parameters

  • key: A pygame key constant such as K_RETURN. For a list of all possible keys, refer to the Pygame Key Page

Examples

  • is button_pressed K_RETURN
  • is button_pressed K_ESCAPE
  • not button_pressed K_SPACE

button_released

[...]

combat_started

Check to see if combat has currently started.

Parameters

  • None

Examples

  • is combat_started

dialog_open

Check to see if a dialog window is currently open.

Parameters

  • None

Examples

  • is dialog_open
  • not dialog_open

has_item

[...]

has_monster

Checks to see the player is has a monster in his party.

Parameters

  • monster_slug: The slug of the monster to check for.

Examples

  • is has_monster txmn_pigabyte

has_party_breeder

[...]

has_tech

[...]

money_is

[...]

monster_flair

[...]

monster_property

[...]

music_playing

Check to see if the specified music file is currently playing.

Parameters

  • music_file: The music file to check.

Examples

  • is music_playing 472452_8-Bit-Ambient.ogg

npc_at

Check to see if the npc is inside the event's area. This event will check the event object's X, Y, Width, and Height properties and checks to see if the npc is within those bounds. That includes event areas that are greater than one tile in size. You can optionally include an x,y parameter to specify a single tile location.

Parameters

  • name: The name of the NPC.
  • x: X tile coordinates that the player is at (optional)
  • y: Y tile coordinate that the player is at (optional)

Examples

  • is npc_at Maple
  • is npc_at Maple,4,3

npc_exists

Check to see if an NPC exists on the current map with npc_name.

Parameters

  • npc_name: The name of the NPC on the current map.

Examples

  • not npc_exists Apple

npc_facing_tile

Check to see if the npc is facing a particular tile. This event will check the event object's X, Y coordinates for the tile to check for.

Parameters

  • name: The name of the NPC.

Examples

  • is npc_facing_tile Maple

npc_facing

Check to see if the npc is facing: up, down, left or right.

Parameters

  • name: The name of the NPC.
  • direction: Direction to check for: (up, down, left, right)

Examples

  • is npc_facing Maple,up
  • not npc_facing Maple,down

party_size

Perform a check on the player's party size. The check parameter can be: equals, less_than, or greater_than.

Parameters

  • check: The check to run against the party size. Can be: equals, less_than, or greater_than.
  • party_size: The size of the party to check against.

Examples

  • is party_size less_than,1
  • not party_size equals,0
  • is party_size greater_than,4

player_at

Check to see if the player is inside the event's area. This event will check the event object's X, Y, Width, and Height properties and checks to see if the player is within those bounds. That includes event areas that are greater than one tile in size. You can optionally include an x,y parameter to specify a single tile location.

Parameters

  • x: X tile coordinates that the player is at (optional)
  • y: Y tile coordinate that the player is at (optional)

Examples

  • is player_at
  • is player_at 4,3

player_defeated

[...]

player_facing_npc

Check to see if the player is facing an NPC with the name npc_name.

Parameters

  • npc_name: The name of the NPC on the current map.

Examples

  • is player_facing_npc Apple

player_facing_tile

Check to see if the player is facing a particular tile. This event will check the event object's X, Y coordinates for the tile to check for.

Parameters

  • None

Examples

  • is player_facing_tile

player_facing

[...]

player_moved

[...]

to_talk

[...]

to_use_tile

[...]

true

The true condition will always evaluate to *True* (unless the "not" operator is used)

Parameters

  • None

Examples

  • is true
  • not true

tuxepedia_is

[...]

variable_is

[...]

variable_set

Check to see if variable_name has been set to value.

Parameters

  • variable_name:value: A key, value pair of the variable to look up and the expected value.

Examples

  • is variable_set battle_won:yes
  • not variable_set current_badges:4
  • is variable_set talked_to_prof:false

Action Reference

Here is a list of currently supported actions. New event actions can be created by creating a new page under the tuxemon/event/actions:

add_contacts

[...]

add_item

Add the specified itemto the player's party.

Parameters

  • item_name: The name of the item to add as defined in the monster JSON under resources/db/item.

Examples

  • add_item hatchet

add_monster

Add the specified monster to the player's party.

Parameters

  • monster_name: The name of the monster to add as defined in the monster JSON under resources/db/monster.
  • monster_lvl: The level of the monster to start at.

Examples

  • add_monster fruitera,10

battles_print

[...]

breeding

[...]

call_event

Executes the actions from another event, ignoring its conditions. This can be especially useful for scenarios where you might need multiple sets of conditions that could be true, such as executing an action when the player is at a certain position OR has a certain item in their inventory.

Parameters

  • event_id: The id of the event whose actions should be executed.

Examples

  • call_event 11
  • call_event 8

change_state

[...]

clear_kennel

[...]

clear_tuxepedia

[...]

clear_variable

[...]

copy_variable

[...]

create_npc

Creates an NPC and places them on the current map.

Parameters

  • name: The name of the NPC to create. This NPC should exist in resources/db/npc in JSON format.
  • tile_pos_x: The X-tile coordinate to place the NPC.
  • tile_pos_y: The Y-tile coordinate to place the NPC.
  • animations: The name of the sprite to use for the animations in resources/sprites.
  • behavior: The NPC's movement behavior. Currently not implemented.

Examples

  • create_npc Maple,2,3,maple,wander
  • create_npc Pine,1,6,maple,stand

delayed_teleport

[...]

dialog_chain

Deprecated. Use [#dialog dialog]

dialog

Opens the dialog box with provided text. For line breaks, use the \n character. You may also use special variables in dialog events. If you have multiple dialog commands they will display sequentially. Using ${{end}} does nothing as it used to denote the end of a dialog chain. Here is a list of available variables:

  • ${{name}} - The current player's name.

Parameters

  • text: The text to display in a dialog window.

Examples

  • dialog Red:\n This is some dialog!
  • dialog ${{name}}:\n Hello there! \nHow are you?

fadeout_music

Fades out music over x milliseconds.

Parameters

  • time_seconds: Time in milliseconds to fade out the currently playing music.

Examples

  • fadeout_music 2

get_player_monster

[...]

kennel_print

[...]

lock_controls

[...]

modify_npc_attribute

[...]

modify_player_attribute

[...]

money_print

[...]

npc_face

Makes the npc face a particular direction. Parameter can be set to: left, right, up, or down.

Parameters

  • name: The name of the npc.
  • direction: Direction to make the player face. Can be set to: left, right, up, or down.

Examples

  • npc_face Maple,left
  • npc_face Pine,up

npc_move

Determines the NPC's movement behaviour.

Examples

  • npc_move spyder_homemakerpapertown, down 1, right 1, up 1, left 1

npc_run

Sets the NPC's speed to the universal run speed.

Examples

  • npc_run npc_mom

npc_speed

Sets the NPC's walk speed.

Examples

  • npc_speed npc_mom, 0.2

npc_walk

Sets the NPC's speed to the universal walk speed.

Examples

  • npc_walk npc_mom

npc_wander

Sets the NPC's behaviour to wander about instead of stand in place.

Examples

  • npc_wander npc_mom

open_shop

[...]

pathfind

Moves an NPC to a certain tile on the map.

Parameters

  • name: The name of the NPC to be moved.
  • tile_pos_x: The X-tile coordinate to have the NPC to walk to.
  • tile_pos_y: The Y-tile coordinate to have the NPC to walk to.

Examples

  • pathfind Maple,2,3
  • pathfind Pine,1,6

pause_music

Pauses the currently playing music.

Parameters

  • None

Examples

  • pause_music

play_map_animation

Plays an animation on the map. The position parameter can also be player if you want to draw the animation at the player's location. Loop can be either loop or noloop.

Parameters

  • animation_name: The name of the animation to play under resources/animations/tileset.
  • duration: The amount of time in seconds between each frame.
  • loop: Whether or not to loop the animation. Can be either loop or noloop to loop the animation.
  • position: The position to draw the animation. Can either be an x,y coordinate or player to draw the animation over the player.

Examples

  • play_map_animation grass,0.1,noloop,player
  • play_map_animation sign01,0.4,loop,33,10

play_music

Plays an audio file located under "music/" on a loop.

Parameters

  • filename: The name of the music file to play under "music/"

Examples

  • play_music 472452_8-Bit-Ambient.ogg

play_sound

Plays an audio file located under "sounds/".

Parameters

  • filename: The name of the sound file to play under "sounds/"

Examples

  • play_sound combat/falling_Macro.ogg

player_face

Makes the player face a particular direction. Parameter can be set to: left, right, up, or down.

Parameters

  • direction: Direction to make the player face. Can be set to: left, right, up, or down.

Examples

  • player_face left
  • player_face up

player_resume

Does not currently have a purpose.

Parameters

  • None

Examples

  • player_resume

player_stop

Stops the player's current movement.

There is currently no way to stop a player from inputting another movement after being stopped (issue #790)

Parameters

  • None

Examples

  • player_stop

print

[...]

quit

[...]

random_encounter

Randomly start a battle based on the encounter group looked up via the encounter_id. Encounter groups contain a list of monsters that can be encountered as well as their level and encounter rate. In most circumstances you will pair this action with the player_at and player_moved conditions.

Here is an example encounter file:

resources/db/encounter/1.json

   json
   {
   "id": 1, 
   "monsters": [
       {
           "monster_slug": "bigfin", 
           "encounter_rate": 10, 
           "level_range": [
               1, 
               6
           ]
       },
       {
           "monster_slug": "dandylion", 
           "encounter_rate": 10, 
           "level_range": [
               1, 
               6
           ]
       },
       {
           "monster_slug": "tux", 
           "encounter_rate": 10, 
           "level_range": [
               1, 
               6
           ]
       }
   ]
   }

Parameters

  • encounter_id: The id of the encounter JSON file to use for random battles under resources/db/encounter.
  • total_prob: The probability of an encounter, with 100 = 100% probability of an encounter. If not set, then the probability of an encounter is the sum of all encounter_rates in the encounter JSON file (as a percentage).

Examples

  • random_encounter route1
  • random_encounter route1,20

random_integer

[...]

random_monster

[...]

remove_contacts

[...]

remove_monster

Removes the specified monster from the player's party.

Parameters

  • monster_slug: The slug of the monster to remove as defined in the monster JSON under resources/db/monster.

Examples

  • remove_monster fruitera

remove_npc

Removes an NPC from the current map.

Parameters

  • name: The name of the NPC to remove.

Examples

  • remove_npc Maple
  • remove_npc Pine

rename_monster

[...]

rename_player

[...]

rumble

[...]

screen_transition

Fades the screen to black and back over x seconds.

Parameters

  • transition_time: Time in seconds to fade the screen to black.

Examples

  • screen_transition 2

set_battle

[...]

set_code

[...]

set_economy

[...]

set_inventory

Overwrites the inventory of the npc or player.

Parameters

  • npc_slug: The slug of the player or NPC.
  • inventory_slug: The slug of the inventory that will overwrite the NPC's existing inventory.

Examples

  • set_inventory shopkeeper,new_stock

set_kennel_visible

[...]

set_kennel

[...]

set_money

[...]

set_monster_flair

[...]

set_monster_health

Changes the hp of a monster in the current player's party. The action parameters may contain a monster slot and the amount of health.

Parameters

  • slot: The slot the monster appears in. If no slot is specified, all monsters are healed.
  • health: A float value between 0 and 1, which is the percent of max hp to be restored to. If no health is specified, the hp is maxed out.

Examples

  • set_monster_health 1,1

set_monster_level

Changes the level of a monster in the current player's party.

Parameters

  • slot: The slot the monster appears in. If no slot is specified, all monsters are leveled.
  • level: The amount by which to level. If no level is specified, the level is reverted to 1.

Examples

  • set_monster_level 1,100

set_monster_level

[...]

set_monster_status

[...]

set_npc_attribute

[...]

set_player_attribute

[...]

set_tuxepedia

[...]

set_variable

Sets an arbitrary variable to a particular value. This action is good for seeing if battles with NPCs have been fought or not. These variables are also saved when the player saves the game.

Also used to set the environment.

Parameters

  • variable_name:value: A key, value pair of the variable_name to set with value.

Examples

  • set_variable battle_won:yes
  • set_variable talked_to_prof:true
  • set_variable environment:grass

spawn_monster

[...]

start_battle

Start a battle with an NPC defined in resources/db/npc.

Here is an example NPC file:

resources/db/npc/maple.json

   json
   {
   "monsters": [
       {
           "attack": 50, 
           "defense": 7, 
           "name": "Snowball", 
           "special_attack": 9, 
           "level": 5, 
           "monster_slug": 1, 
           "hp": 50, 
           "speed": 7, 
           "special_defense": 7,
           "exp_give_mod": 3,
           "exp_req_mod": 27
       }
   ], 
   "id": 1, 
   "name": "Maple"
   }

Parameters

  • npc_slug: The NPC's slug as defined in the NPC's JSON file in resources/db/npc.

Examples

  • start_battle npc_maple

start_cinema_mode

[...]

stop_cinema_mode

[...]

store_monster

[...]

teleport_faint

[...]

teleport

Teleports the player to a given position on a map. This teleport is immediate and does not have any transition animation.

Parameters

  • map_name: The map file to teleport the player to.
  • x: The X-tile coordinate to teleport the player to.
  • y: The Y-tile coordinate to teleport the player to.

Examples

  • teleport map1.tmx,3,4
  • teleport room1.tmx,8,1

transfer_money

[...]

transition_teleport

Teleports the player to a given position on a map with a screen transition over x seconds.

Parameters

  • map_name: The map file to teleport the player to.
  • x: The X-tile coordinate to teleport the player to.
  • y: The Y-tile coordinate to teleport the player to.
  • transition_time: The time in seconds the transition will last.

Examples

  • teleport map2.tmx,1,6,1.5
  • teleport room1.tmx,8,1,4

translated_dialog_chain

Deprecated. Use [#translated_dialog translated_dialog]

translated_dialog_choice

Asks the player to select a choice. The translations for the text are looked up based on a given key.

Parameters

  • choice_keys: Keys to reference translated text choices separated by colons.
  • variable: The variable to store the answer which will be the key for the translated text.

Examples

  • translated_dialog_choice yes:no,myvariable

translated_dialog

Opens the dialog box with translated text for a given key found in resources/db/locale/<locale>.json. Optional variable replacement will also be translated if the value is a key in the locale file. For line breaks, use the \n character. If you have multiple translated_dialog commands they will display sequentially. Using ${{end}} does nothing as it used to denote the end of a dialog chain. You may also use special variables in dialog events. Here is a list of available variables:

  • ${{name}} - The current player's name.

Parameters

  • dialog_key: The translated text for a given key found in resources/db/locale/<locale>.json to display in a dialog window.
  • parameters: Optional comma-separated var=value parameters to replace variables in the translation text. The value can either be text or a key found in resources/db/locale/<locale>.json.

Examples

  • translated_dialog received_x,name=a brand new car!
  • translated_dialog received_x,name=item_potion
  • translated_dialog combat_fainted,name=${{name}}
  • translated_dialog combat_opponent_call_tuxemon,user=${{name}},name=some guy

tuxepedia_print

[...]

unlock_controls

[...]

variable_math

Performs a mathematical operation on the key in the player.game_variables dictionary.

Parameters

  • variable_name
  • operation: +, -, * or /
  • value

Examples

  • variable_math badge_count,+,1

wait

Pauses execution of all events for the given amount of time in seconds.

Parameters

  • seconds: The amount of time in seconds to wait for.

Examples

  • wait 2.0
  • wait 5.2

withdraw_monster

[...]