Editing Event Reference
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
=== battle_is === | === battle_is === | ||
Check to see if | Check to see if the player has fought against NPC and won, lost or draw. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>result</code>: One among "won", "lost" or "draw". | ||
'''Examples''' | '''Examples''' | ||
* <code>is battle_is | * <code>is battle_is npc_maple,won</code> | ||
=== button_pressed === | === button_pressed === | ||
Line 27: | Line 26: | ||
* <code>is button_pressed K_RETURN</code> | * <code>is button_pressed K_RETURN</code> | ||
* <code>is button_pressed K_ESCAPE</code> | * <code>is button_pressed K_ESCAPE</code> | ||
* <code>not button_pressed K_SPACE</code> | * <code>not button_pressed K_SPACE</code> | ||
=== | === combat_started === | ||
Check to see if | Check to see if combat has currently started. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is combat_started</code> | ||
=== | === dialog_open === | ||
Check to see | Check to see if a dialog window is currently open. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is dialog_open</code> | ||
* <code>not dialog_open</code> | |||
=== | === has_item === | ||
Check to see if a | Check to see if a NPC inventory contains something. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>item</code>: The item slug name (e.g. "item_cherry"). | |||
* <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "greater_than", "equals", "less_or_equal" and "greater_or_equal". (optional) | |||
* <code>quantity</code>: Quantity to compare with. (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is has_item player,potion</code> | ||
* <code>is has_item player,potion,greater_than,2</code> | |||
=== | === has_monster === | ||
Checks to see the player has a monster in his party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: The slug of the monster to check for. | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is has_monster txmn_pigabyte</code> | ||
=== | === has_party_breeder === | ||
Check to see the | Check to see if the player has a male and female monster in the party (monster not basic, basic is the first step in the evolution stage). | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is has_party_breeder</code> | ||
=== | === has_tech === | ||
Check to see if a | Check to see if the player has a technique in his party (one of the monsters). | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>technique</code>: Technique slug name (e.g. "bullet"). | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is has_tech bullet</code> | ||
=== | === money_is === | ||
Check to see if the | Check to see if the player has a certain amount of money (pocket). | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slug</code>: Slug name (player). | ||
* <code>operator</code>: One of "==", "!=", ">", ">=", "<" or "<=". | |||
* <code>amount</code>: Amount of money. | |||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is money_is player,>=,500</code> | ||
=== | === monster_flair === | ||
Check the | Check to see if the given monster flair matches the expected value. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slot</code>: Position of the monster in the player monster list. | ||
* <code> | * <code>property</code>: Category of the flair. | ||
* <code>name</code>: Name of the flair. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>to be defined</code> | ||
=== | === monster_property === | ||
Check | Check to see if a monster property or condition is as asked. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slot</code>: Position of the monster in the player monster list. | ||
* <code> | * <code>property</code>: Property of the monster to check (e.g. "level"). Valid values are: name, level, level_reached, type, category and shape. | ||
* <code>value</code>: | * <code>value</code>: Value to compare the property with. | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is monster_property 1,level,15</code> | ||
=== | === music_playing === | ||
Check to see the | Check to see if the specified music file is currently playing. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>music_file</code>: The music file to check. | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is music_playing 472452_8-Bit-Ambient.ogg</code> | ||
=== | === npc_at === | ||
Check to see the | 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> | * <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 | * <code>is npc_at Maple</code> | ||
* <code>is | * <code>is npc_at Maple,4,3</code> | ||
=== | === npc_exists === | ||
Check to see the | Check to see if an NPC exists on the current map with <code>npc_name</code>. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_name</code>: The name of the NPC on the current map. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>not npc_exists Apple</code> | ||
=== | === npc_facing_tile === | ||
Check to see the | 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> | * <code>name</code>: The name of the NPC. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is npc_facing_tile Maple</code> | ||
=== | === npc_facing === | ||
Check | Check to see if the npc is facing: <code>up</code>, <code>down</code>, <code>left</code> or <code>right</code>. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the NPC. | ||
* <code> | * <code>direction</code>: Direction to check for: (<code>up</code>, <code>down</code>, <code>left</code>, <code>right</code>) | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is npc_facing Maple,up</code> | ||
* <code> | * <code>not npc_facing Maple,down</code> | ||
=== | === party_size === | ||
Perform a check on the player's party size. The <code>check</code> parameter can be: <code>equals</code>, <code>less_than</code>, or <code>greater_than</code>. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>check</code>: The check to run against the party size. Can be: <code>equals</code>, <code>less_than</code>, or <code>greater_than</code>. | ||
* <code>party_size</code>: The size of the party to check against. | |||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is party_size less_than,1</code> | ||
* <code>is | * <code>not party_size equals,0</code> | ||
* <code>is party_size greater_than,4</code> | |||
=== | === player_at === | ||
Check to see | 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> | * <code>x</code>: X tile coordinates that the player is at (optional) | ||
* <code>y</code>: Y tile coordinate that the player is at (optional) | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_at</code> | ||
* <code>is | * <code>is player_at 4,3</code> | ||
=== | === player_defeated === | ||
Check to see | Check to see the player has at least one tuxemon, and all tuxemon in their party are defeated. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_defeated</code> | ||
=== | === player_facing_npc === | ||
Check to see if | Check to see if the player is facing an NPC with the name <code>npc_name</code>. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_name</code>: The name of the NPC on the current map. | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_facing_npc Apple</code> | ||
=== | === player_facing_tile === | ||
Check to see if a | 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''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_facing_tile</code> | ||
=== | === player_facing === | ||
Check to see | Check to see where an NPC is facing. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>direction</code>: One of "up", "down", "left" or "right". | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_facing right</code> | ||
=== | === player_moved === | ||
Check to see | Check to see the player has just moved into this tile. Using this condition will prevent a condition like "player_at" from constantly being true every single frame. Check if player destination collides with event, if it collides, wait until destination changes. It become True after collides and destination has changed. These rules ensure that the event is true once player in in the tile and is only true once. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_moved</code> | ||
=== | === to_talk === | ||
Check | Check if we are attempting interact with a map condition tile. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: | * <code>character</code>: Npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is to_talk npc_maple</code> | ||
=== to_use_tile === | === to_use_tile === | ||
Line 385: | Line 263: | ||
* <code>not true</code> | * <code>not true</code> | ||
=== | === tuxepedia_is === | ||
Check | Check to see if the player has seen or caught a monster. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | ||
* <code> | * <code>string</code>: seen / caught | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is tuxepedia_is rockitten,seen</code> | ||
=== variable_is === | === variable_is === | ||
Line 402: | Line 278: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>value1</code>: Either a variable or a number. | * <code>value1</code>: Either a variable or a number. | ||
* <code>operation</code>: | * <code>operation</code>: One of "==", "!=", ">", ">=", "<" or "<=". | ||
* <code>value2</code>: Either a variable or a number. | * <code>value2</code>: Either a variable or a number. | ||
'''Examples''' | '''Examples''' | ||
* <code>is variable_is [value1], | * <code>is variable_is [value1],>=,[value2]</code> | ||
=== variable_set === | === variable_set === | ||
Line 422: | Line 298: | ||
Here is a list of currently supported actions. New event actions can be created by creating a new page under the '''tuxemon/event/actions''': | 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_contacts === | ||
Line 448: | Line 313: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>item_name</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>add_item hatchet</code> | * <code>add_item hatchet</code> | ||
=== add_monster === | === add_monster === | ||
Line 461: | Line 322: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <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. | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code>add_monster fruitera,10</code> | * <code>add_monster fruitera,10</code> | ||
=== | === battles_print === | ||
Print the current value of battle history to the console. If no variable is specified, print out values of all battles. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Npc slug name (e.g. "npc_maple"). (optional) | ||
* <code>result</code>: One among "won", "lost" or "draw". (optional) | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>battles_print</code> | ||
* <code> | * <code>battles_print [character,result]</code> | ||
=== breeding === | === breeding === | ||
Line 499: | Line 353: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>event_id</code>: The id of the event whose actions should be executed. | ||
'''Examples''' | '''Examples''' | ||
* <code>call_event | * <code>call_event 11</code> | ||
* <code>call_event 8</code> | |||
* <code> | |||
=== change_state === | === change_state === | ||
Line 539: | Line 364: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>state_name</code>: The state name to switch to (e.g. PCState). | * <code>state_name</code>: The state name to switch to (e.g. PCState). | ||
'''Examples''' | '''Examples''' | ||
* <code>change_state PCState</code> | * <code>change_state PCState</code> | ||
=== clear_kennel === | === clear_kennel === | ||
Line 712: | Line 413: | ||
* <code>tile_pos_x</code>: The X-tile coordinate to place the NPC. | * <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>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. | * <code>behavior</code>: The NPC's movement behavior. Currently not implemented. | ||
'''Examples''' | '''Examples''' | ||
* <code>create_npc Maple,2,3</code> | * <code>create_npc Maple,2,3,maple,wander</code> | ||
* <code>create_npc Pine,1,6,stand</code> | * <code>create_npc Pine,1,6,maple,stand</code> | ||
=== delayed_teleport === | === delayed_teleport === | ||
Line 729: | Line 431: | ||
* <code>delayed_teleport cotton_town,10,10</code> | * <code>delayed_teleport cotton_town,10,10</code> | ||
=== | === dialog_chain === | ||
Deprecated. Use [#dialog dialog] | |||
=== dialog === | |||
Opens the dialog box with provided text. For line breaks, use the <code>\n</code> character. You may also use special variables in dialog events. If you have multiple 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. Here is a list of available variables: | |||
* <code>$<nowiki>{{</nowiki>name<nowiki>}}</nowiki></code> - The current player's name. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>text</code>: The text to display in a dialog window. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>dialog Red:\n This is some dialog!</code> | ||
* <code>dialog $<nowiki>{{</nowiki>name<nowiki>}}</nowiki>:\n Hello there! \nHow are you?</code> | |||
=== fadeout_music === | === fadeout_music === | ||
Line 746: | Line 454: | ||
'''Examples''' | '''Examples''' | ||
* <code>fadeout_music 2</code> | * <code>fadeout_music 2</code> | ||
=== get_player_monster === | === get_player_monster === | ||
Select a monster in the player party and store its id in a variable. | Select a monster in the player party and store its id in a variable. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>variable_name</code>: Name of the variable where to store the monster id. | * <code>variable_name</code>: Name of the variable where to store the monster id. | ||
'''Examples''' | '''Examples''' | ||
* <code>get_player_monster name_variable</code> | * <code>get_player_monster name_variable</code> | ||
=== | === kennel_print === | ||
Print all the kennels or one. It returns <name, qty, visible/hidden>, where *qty = number of monsters inside. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>kennel</code>: Name of the kennel. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>kennel_print</code> | ||
* <code> | * <code>kennel_print name_kennel</code> | ||
=== | === lock_controls === | ||
Lock player controls. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>lock_controls</code> | ||
=== | === modify_npc_attribute === | ||
Modify the given attribute of the npc by modifier. By default this is achieved via addition, but prepending a '%' will cause it to be multiplied by the attribute. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>attribute</code>: Name of the attribute to modify. | ||
* <code> | * <code>value</code>: Value of the attribute modifier. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>modify_npc_attribute npc_slug,attribute,value</code> | ||
=== | === modify_player_attribute === | ||
Modify the given attribute of the player character by modifier. By default this is achieved via addition, but prepending a '%' will cause it to be multiplied by the attribute. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>attribute</code>: Name of the attribute to modify. | ||
* <code>value</code>: Value of the attribute modifier. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>modify_player_attribute attribute,value</code> | ||
=== | === money_print === | ||
Print the current value of money dictionary to the console. If no entity is specified, print out values of all money dictionary. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slug</code>: Slug name (e.g. player or NPC, etc.). (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>money_print</code> | ||
* <code>money_print player</code> | |||
=== | === npc_face === | ||
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> | * <code>name</code>: The name of the npc. | ||
* <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> | * <code>npc_face Maple,left</code> | ||
* <code>npc_face Pine,up</code> | |||
=== | === npc_move === | ||
Determines the NPC's movement behaviour. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the npc. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>npc_move spyder_homemakerpapertown, down 1, right 1, up 1, left 1</code> | ||
=== | === npc_run === | ||
Sets the NPC's speed to the universal run speed. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the npc. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>npc_run npc_mom</code> | ||
=== | === npc_speed === | ||
Sets the NPC's walk speed. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the npc. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>npc_speed npc_mom, 0.2</code> | ||
=== | === npc_walk === | ||
Sets the NPC's speed to the universal walk speed. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the npc. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>npc_walk npc_mom</code> | ||
=== | === npc_wander === | ||
Sets the NPC's behaviour to wander about instead of stand in place. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the npc. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>npc_wander npc_mom</code> | ||
=== open_shop === | === open_shop === | ||
Line 942: | Line 579: | ||
'''Examples''' | '''Examples''' | ||
* <code>open_shop npc_maple</code> | * <code>open_shop npc_maple</code> | ||
=== pathfind === | === pathfind === | ||
Line 964: | Line 591: | ||
* <code>pathfind Maple,2,3</code> | * <code>pathfind Maple,2,3</code> | ||
* <code>pathfind Pine,1,6</code> | * <code>pathfind Pine,1,6</code> | ||
=== pause_music === | === pause_music === | ||
Line 994: | Line 608: | ||
* <code>duration</code>: The amount of time in seconds between each frame. | * <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>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> | * <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''' | ||
Line 1,001: | Line 615: | ||
=== play_music === | === play_music === | ||
Plays an audio file. | Plays an audio file located under "music/" on a loop. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>filename</code>: | * <code>filename</code>: The name of the music file to play under "music/" | ||
'''Examples''' | '''Examples''' | ||
* <code>play_music | * <code>play_music 472452_8-Bit-Ambient.ogg</code> | ||
=== play_sound === | === play_sound === | ||
Plays | Plays an audio file located under "sounds/". | ||
'''Parameters''' | '''Parameters''' | ||
* <code>filename</code>: | * <code>filename</code>: The name of the sound file to play under "sounds/" | ||
'''Examples''' | '''Examples''' | ||
* <code>play_sound | * <code>play_sound combat/falling_Macro.ogg</code> | ||
=== 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''' | |||
* <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''' | |||
* <code>player_face left</code> | |||
* <code>player_face up</code> | |||
=== player_sprite === | |||
Check the player's sprite | |||
'''Parameters''' | |||
* <code>sprite</code>: slug of the sprite | |||
'''Examples''' | |||
* <code>is player_sprite adventurer</code> | |||
=== player_stop === | |||
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]) | |||
'''Parameters''' | |||
* <code>None</code> | |||
'''Examples''' | |||
* <code>player_stop</code> | |||
=== print === | === print === | ||
Line 1,030: | Line 669: | ||
* <code>print</code> | * <code>print</code> | ||
* <code>print name_variable</code> | * <code>print name_variable</code> | ||
=== quit === | === quit === | ||
Line 1,063: | Line 691: | ||
=== random_encounter === | === random_encounter === | ||
Randomly start a battle based on the encounter group looked up via the <code>encounter_id</code>. 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 <code> | Randomly start a battle based on the encounter group looked up via the <code>encounter_id</code>. 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 <code>player_at</code> and <code>player_moved</code> 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''' | '''Parameters''' | ||
* <code> | * <code>encounter_id</code>: The id of the encounter JSON file to use for random battles under <code>resources/db/encounter</code>. | ||
* <code>total_prob</code>: 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). | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
Line 1,099: | Line 746: | ||
'''Examples''' | '''Examples''' | ||
* <code>random_integer name_variable,1,9</code> | * <code>random_integer name_variable,1,9</code> | ||
=== random_monster === | === random_monster === | ||
Add a monster to the specified trainer's party | Add a random monster to the specified trainer's party. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>monster_level</code>: Level of the added monster. | * <code>monster_level</code>: Level of the added monster. | ||
* <code>trainer_slug</code>: Slug of the trainer that will receive the monster. It defaults to the current player. (optional) | * <code>trainer_slug</code>: Slug of the trainer that will receive the monster. It defaults to the current player. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code>random_monster 10</code> | * <code>random_monster 10</code> | ||
* <code>random_monster 10,npc_maple</code> | * <code>random_monster 10,npc_maple</code> | ||
=== remove_contacts === | === remove_contacts === | ||
Line 1,151: | Line 768: | ||
=== remove_monster === | === remove_monster === | ||
Removes the specified monster from the player's party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: The slug of the monster to remove as defined in the monster JSON under <code>resources/db/monster</code>. | ||
'''Examples''' | '''Examples''' | ||
* <code>remove_monster fruitera</code> | |||
* <code>remove_monster | |||
=== remove_npc === | === remove_npc === | ||
Line 1,169: | Line 785: | ||
* <code>remove_npc Maple</code> | * <code>remove_npc Maple</code> | ||
* <code>remove_npc Pine</code> | * <code>remove_npc Pine</code> | ||
=== rename_monster === | === rename_monster === | ||
Open the text input | Open the monster menu and text input screens to rename a selected monster. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>rename_monster | * <code>rename_monster</code> | ||
=== rename_player === | === rename_player === | ||
Line 1,217: | Line 813: | ||
'''Examples''' | '''Examples''' | ||
* <code>rumble duration,power</code> | * <code>rumble duration,power</code> | ||
=== screen_transition === | === screen_transition === | ||
Line 1,232: | Line 818: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>transition_time</code>: Time in seconds to fade the screen to black. | ||
'''Examples''' | '''Examples''' | ||
Line 1,239: | Line 824: | ||
=== set_battle === | === set_battle === | ||
Set the key in the player.battle_history dictionary. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Npc slug name (e.g. "npc_maple"). | ||
* <code>result</code>: One among "won", "lost" or "draw" | * <code>result</code>: One among "won", "lost" or "draw" | ||
'''Examples''' | '''Examples''' | ||
* <code>set_battle | * <code>set_battle npc_maple,won</code> | ||
=== | === set_code === | ||
Set a code and checks if it's correct or not. Case Sensitive: ATTENTION and AtTenTION are two different words. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>question</code>: The question the player needs to reply. (eg. "access_code") then you create the msgid "access_code" inside the English PO file, as follows: msgid "access_code" and msgstr "Here the actual question?" | ||
* <code> | * <code>answer</code>: The right answer to the question. | ||
* <code>variable</code>: Where the result (right/wrong) is saved. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_code access_code,joke,name_variable</code> | ||
=== set_economy === | === set_economy === | ||
Line 1,266: | Line 848: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>economy_slug</code>: Slug of an economy. | * <code>economy_slug</code>: Slug of an economy. | ||
Line 1,298: | Line 880: | ||
'''Examples''' | '''Examples''' | ||
* <code>set_kennel new_kennel,true</code> | * <code>set_kennel new_kennel,true</code> | ||
=== set_money === | === set_money === | ||
Set | Set the key and value in the money dictionary. It'll reset the previous amount. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>slug</code>: Slug name (e.g. player or NPC, etc.). | * <code>slug</code>: Slug name (e.g. player or NPC, etc.). | ||
* <code>amount</code>: Amount of money | * <code>amount</code>: Amount of money | ||
'''Examples''' | '''Examples''' | ||
* <code>set_money player,500</code> | * <code>set_money player,500</code> | ||
=== set_monster_flair === | === set_monster_flair === | ||
Line 1,347: | Line 895: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slot</code>: Slot of the monster in the party. | ||
* <code>category</code>: Category of the monster flair. | * <code>category</code>: Category of the monster flair. | ||
* <code>flair</code>: Name of the monster flair. | * <code>flair</code>: Name of the monster flair. | ||
'''Examples''' | '''Examples''' | ||
* <code>set_monster_flair 1,category,flair</code> | |||
* <code>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. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slot</code>: The slot the monster appears in. If no slot is specified, all monsters are healed. | ||
* <code>health</code>: A float value between 0 and 1, which is the percent of max hp | * <code>health</code>: 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''' | '''Examples''' | ||
* <code>set_monster_health</code> | * <code>set_monster_health 1,1</code> | ||
=== set_monster_level === | |||
* <code> | Changes the level of a monster in the current player's party. | ||
* <code> | |||
'''Parameters''' | |||
* <code>slot</code>: The slot the monster appears in. If no slot is specified, all monsters are leveled. | |||
* <code>level</code>: The amount by which to level. If no level is specified, the level is reverted to 1. | |||
'''Examples''' | |||
* <code>set_monster_level 1,100</code> | |||
=== set_monster_level === | === set_monster_level === | ||
Line 1,372: | Line 925: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>level</code>: Number of levels to add. Negative numbers are allowed. | ||
* <code> | * <code>slot</code>: Slot of the monster in the party. If no slot is specified, all monsters are leveled. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_monster_status 5,1</code> | ||
=== set_monster_status === | === set_monster_status === | ||
Line 1,385: | Line 935: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slot</code>: Slot of the monster in the party. If no slot is specified, all monsters are modified. (optional) | ||
* <code>status</code>: | * <code>status</code>: Status to set. If no status is specified, the status is cleared. | ||
'''Examples''' | '''Examples''' | ||
* <code>set_monster_status | * <code>set_monster_status 1,status_blinded</code> | ||
=== | === set_npc_attribute === | ||
Set the given attribute of the | Set the given attribute of the npc to the given value. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>attribute</code>: Name of the attribute. | * <code>attribute</code>: Name of the attribute. | ||
* <code>value</code>: Value of the attribute. | * <code>value</code>: Value of the attribute. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_player_attribute npc_maple,attribute,value</code> | ||
=== | === set_player_attribute === | ||
Set the given attribute of | Set the given attribute of the player character to the given value. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>attribute</code>: Name of the attribute. | * <code>attribute</code>: Name of the attribute. | ||
* <code>value</code>: Value of the attribute. | * <code>value</code>: Value of the attribute. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_player_attribute attribute,value</code> | ||
=== | === set_player_template === | ||
Switch template (sprite and combat_front). | Switch template (sprite and combat_front). | ||
Line 1,455: | Line 972: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>sprite</code>: must be inside mods/tuxemon/sprites, eg: adventurer_brown_back.png -> adventurer | |||
* <code>sprite</code>: must be inside mods/tuxemon/sprites | |||
* <code>combat_front</code>: must be inside mods/tuxemon/gfx/sprites/player, eg: adventurer.png -> adventurer (optional) | * <code>combat_front</code>: must be inside mods/tuxemon/gfx/sprites/player, eg: adventurer.png -> adventurer (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_player_template adventurer,adventurer</code> | ||
=== set_tuxepedia === | === set_tuxepedia === | ||
Line 1,466: | Line 982: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | * <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | ||
* <code> | * <code>string</code>: seen / caught | ||
'''Examples''' | '''Examples''' | ||
* <code>set_tuxepedia | * <code>set_tuxepedia rockitten,caught</code> | ||
=== set_variable === | === set_variable === | ||
Line 1,485: | Line 1,000: | ||
* <code>set_variable talked_to_prof:true</code> | * <code>set_variable talked_to_prof:true</code> | ||
* <code>set_variable environment:grass</code> | * <code>set_variable environment:grass</code> | ||
=== spawn_monster === | === spawn_monster === | ||
Line 1,491: | Line 1,005: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
Line 1,497: | Line 1,011: | ||
=== start_battle === | === start_battle === | ||
Start a 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''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: The NPC's slug as defined in the NPC's JSON file in <code>resources/db/npc</code>. | ||
'''Examples''' | '''Examples''' | ||
* <code>start_battle | * <code>start_battle npc_maple</code> | ||
=== start_cinema_mode === | === start_cinema_mode === | ||
Line 1,529: | Line 1,066: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_id</code>: Id of the monster to store. | ||
* <code>box</code>: An existing box where the monster will be stored. (optional) | * <code>box</code>: An existing box where the monster will be stored. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code>store_monster name_variable</code> | |||
* <code>store_monster name_variable,name_kennel</code> | |||
* <code>store_monster name_variable</code> | |||
* <code>store_monster name_variable,name_kennel</code> | |||
=== teleport_faint === | === teleport_faint === | ||
Line 1,543: | Line 1,077: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>teleport_faint</code> | * <code>teleport_faint</code> | ||
=== teleport === | === teleport === | ||
Line 1,560: | Line 1,093: | ||
* <code>teleport map1.tmx,3,4</code> | * <code>teleport map1.tmx,3,4</code> | ||
* <code>teleport room1.tmx,8,1</code> | * <code>teleport room1.tmx,8,1</code> | ||
=== transfer_money === | === transfer_money === | ||
Performs a mathematical transaction on the player's money. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>transaction</code>: Operator symbol. | ||
* <code>amount</code>: Amount of money. | * <code>amount</code>: Amount of money. | ||
* <code> | * <code>slug</code>: Slug name (e.g. NPC, etc.) (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code>transfer_money player,100,npc_mom</code> (player | * <code>transfer_money +,100,npc_mom</code> (player gets 100 from mom) | ||
* <code>transfer_money -,100,npc_mom</code> (mom gets 100 from player) | |||
* <code>transfer_money +,100</code> (player gets 100) | |||
=== transition_teleport === | === transition_teleport === | ||
Line 1,591: | Line 1,114: | ||
* <code>x</code>: The X-tile coordinate 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>y</code>: The Y-tile coordinate to teleport the player to. | ||
* <code> | * <code>transition_time</code>: The time in seconds the transition will last. | ||
'''Examples''' | '''Examples''' | ||
* <code>teleport map2.tmx,1,6,1.5</code> | * <code>teleport map2.tmx,1,6,1.5</code> | ||
* <code>teleport room1.tmx,8,1,4</code> | * <code>teleport room1.tmx,8,1,4</code> | ||
=== translated_dialog_chain === | |||
Deprecated. Use [#translated_dialog translated_dialog] | |||
=== translated_dialog_choice === | === translated_dialog_choice === | ||
Line 1,609: | Line 1,134: | ||
=== translated_dialog === | === 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''' | '''Parameters''' | ||
* <code> | * <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> | * <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 | * <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 === | ||
Print the current value of Tuxepedia to the console. If no monster is specified, print out values of all Tuxepedia. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>tuxepedia_print</code> | ||
* <code>tuxepedia_print rockitten</code> | |||
=== | === unlock_controls === | ||
Unlock player controls | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>unlock_controls</code> | ||
=== variable_math === | === variable_math === | ||
Line 1,658: | Line 1,187: | ||
* <code>wait 2.0</code> | * <code>wait 2.0</code> | ||
* <code>wait 5.2</code> | * <code>wait 5.2</code> | ||
=== withdraw_monster === | === withdraw_monster === | ||
Line 1,678: | Line 1,192: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_id</code>: The id of the monster to pull (variable). | ||
* <code> | * <code>trainer</code>: Slug of the trainer that will receive the monster. It defaults to the current player. | ||
'''Examples''' | '''Examples''' | ||
* <code>withdraw_monster monster_id[,trainer_slug]</code> | |||
* <code>withdraw_monster | |||