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 76: | Line 76: | ||
'''Examples''' | '''Examples''' | ||
* <code>is char_facing_char npc_maple,player</code> | * <code>is char_facing_char npc_maple,player</code> | ||
=== check_char_parameter === | === check_char_parameter === | ||
Line 135: | Line 97: | ||
* <code>is check_evolution player</code> | * <code>is check_evolution player</code> | ||
=== check_mission === | |||
Check to see the player has failed or completed a mission. Check to see if a mission is still pending. | |||
=== check_mission === | |||
Check to see the player has failed or completed a mission. Check to see if a mission is still pending. | |||
'''Parameters''' | '''Parameters''' | ||
Line 158: | Line 110: | ||
* <code>is check_mission player,mission1:mission2,completed</code> | * <code>is check_mission player,mission1:mission2,completed</code> | ||
* <code>is check_mission player,all,completed</code> | * <code>is check_mission player,all,completed</code> | ||
=== current_state === | === current_state === | ||
Line 235: | Line 159: | ||
=== has_monster === | === has_monster === | ||
Checks to see the player has a monster in his party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>monster_slug</code>: The slug of the monster to check for. | |||
* <code>monster_slug</code>: | |||
'''Examples''' | '''Examples''' | ||
* <code>is has_monster | * <code>is has_monster txmn_pigabyte</code> | ||
=== has_party_breeder === | === has_party_breeder === | ||
Check to see if 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). | ||
'''Parameters''' | '''Examples''' | ||
* <code> | * <code>is has_party_breeder</code> | ||
=== has_sprite === | |||
Check to see if a NPC has a specific sprite. | |||
'''Parameters''' | |||
* <code>sprite</code>: Sprite slug (eg. adventurer, heroine, swimmer, etc.) | |||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is has_sprite swimmer</code> | ||
=== has_tech === | === has_tech === | ||
Line 293: | Line 222: | ||
'''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>operator</code>: | * <code>operator</code>: One of "==", "!=", ">", ">=", "<" or "<=". | ||
* <code>amount</code>: Amount of money | * <code>amount</code>: Amount of money. | ||
'''Examples''' | '''Examples''' | ||
* <code>is money_is player,>=,500</code> | * <code>is money_is player,>=,500</code> | ||
=== monster_flair === | === monster_flair === | ||
Line 310: | Line 238: | ||
'''Examples''' | '''Examples''' | ||
* <code>to be defined</code> | * <code>to be defined</code> | ||
=== monster_property === | |||
Check to see if a monster in the party has one of the following property. | |||
'''Parameters''' | |||
* <code>property</code>: Property of the monster to check (e.g. "level"). Valid values are: slug, level, level_reached, stage, shape, taste_cold, taste_warm, type, gender and tech. | |||
* <code>value</code>: Value to compare the property with. | |||
'''Examples''' | |||
* <code>is monster_property level,15</code> | |||
* <code>is monster_property gender,male</code> | |||
* <code>is monster_property stage,standalone</code> | |||
* <code>is monster_property shape,aquatic</code> | |||
=== music_playing === | === music_playing === | ||
Line 319: | Line 260: | ||
'''Examples''' | '''Examples''' | ||
* <code>is music_playing 472452_8-Bit-Ambient.ogg</code> | * <code>is music_playing 472452_8-Bit-Ambient.ogg</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> | |||
=== once === | === once === | ||
Line 344: | Line 294: | ||
=== party_infected === | === party_infected === | ||
Check to see how many monster are infected | Check to see how many monster are infected and stores the iids. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>value</code>: all, some or none. | * <code>value</code>: all, some or none. | ||
Line 354: | Line 303: | ||
=== party_size === | === 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>operator</code>: Numeric comparison operator. Accepted values are <code>less_than</code>, <code>less_or_equal</code>, <code>greater_than</code>, <code>greater_or_equal</code>, <code>equals</code> and <code>not_equals</code>. | * <code>operator</code>: Numeric comparison operator. Accepted values are <code>less_than</code>, <code>less_or_equal</code>, <code>greater_than</code>, <code>greater_or_equal</code>, <code>equals</code> and <code>not_equals</code>. | ||
* <code>party_size</code>: The size of the party to check against. | * <code>party_size</code>: The size of the party to check against. | ||
Line 366: | Line 314: | ||
* <code>is party_size greater_than,4</code> | * <code>is party_size greater_than,4</code> | ||
=== | === player_facing_tile === | ||
Check if | 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>value</code>: value (eg surfable) inside the tileset (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_facing_tile</code> | ||
* <code>is player_facing_tile surfable</code> | |||
=== | === player_facing === | ||
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_in === | ||
Check | Check to see if the player is at the condition position on a specific set of tiles. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>value</code>: value (eg surfable) inside the tileset. | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is player_in surfable</code> | ||
=== | === player_moved === | ||
Check | 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> | * <code>character</code>: Npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is to_talk npc_maple</code> | ||
=== to_use_tile === | |||
Check if we are attempting interact with a map condition tile. | |||
'''Parameters''' | |||
* <code>None</code> | |||
'''Examples''' | |||
* <code>is to_use_tile</code> | |||
=== | === true === | ||
The <code>true</code> condition will always evaluate to *True* (unless the "not" operator is used) | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is true</code> | ||
* <code> | * <code>not true</code> | ||
=== | === tuxepedia === | ||
Check Tuxepedia's progress. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals". | ||
* <code> | * <code>percentage</code>: Number between 0.1 and 1.0 | ||
* <code>total</code>: Total, by default the total number of tuxemon. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is tuxepedia less_than,0.2</code> | ||
* <code>is tuxepedia less_than,0.2,10</code> | |||
=== | === variable_is === | ||
Check an operation over a variable. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>value1</code>: Either a variable or a number. | ||
* <code> | * <code>operation</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals". | ||
* <code> | * <code>value2</code>: Either a variable or a number. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is variable_is [value1],operator,[value2]</code> | ||
=== | === variable_set === | ||
Check to see if <code>variable_name</code> has been set to <code>value</code>. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>variable_name:value</code>: A key, value pair of the variable to look up and the expected value. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is variable_set battle_won:yes</code> | ||
* <code> | * <code>not variable_set current_badges:4</code> | ||
* <code>is variable_set talked_to_prof:false</code> | |||
== 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_collision === | ||
Adds a | Adds a collision defined by a specific label. With numbers, it blocks a specific tile. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>label</code>: Name of the obstacle. | ||
* <code>coord</code>: Coordinates map (single coordinate). (optional) | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>add_collision obstacle,6,8</code> | ||
* <code> | * <code>add_collision wall</code> (in this case must exist a collision zone in the .tmx file) | ||
=== | === add_contacts === | ||
Add contact to the app (Nu Phone). The slug must have the msgid inside the PO. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slug</code>: slug name (e.g. "npc_maple"). | ||
* <code>phone_number</code>: 3 digits | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>add_contacts npc_maple,123</code> | ||
=== | === add_item === | ||
Add the specified item to the player's inventory. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>item_name</code>: Monster slug to look up in the monster database or name variable where it's stored the mon_slug. | ||
* <code>quantity</code>: Quantity of the item to add or to reduce. By default it is 1. (optional) | |||
* <code>trainer_slug</code>: Slug of the trainer that will receive the item. It defaults to the current player. (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>add_item hatchet</code> | ||
* <code>add_item hatchet,2</code> | |||
* <code>add_item hatchet,2,npc_maple</code> | |||
=== | === add_monster === | ||
Add the specified monster to the player's party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: Monster slug to look up in the monster database. | ||
* | * <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> | * <code>exp_mod</code>: Experience modifier. (optional) | ||
* <code>money_mod</code>: Money modifier. (optional) | |||
* | |||
'''Examples''' | |||
* <code>add_monster fruitera,10</code> | |||
* <code>add_monster fruitera,10,npc_maple,10,27</code> | |||
=== add_tech === | |||
Adds a tech to a specific monster. | |||
'''Parameters''' | |||
* <code>monster_id</code>: Id of the monster (name of the variable). | |||
* <code>technique</code>: Slug of the technique (e.g. "bullet"). | |||
'''Parameters''' | * <code>power</code>: Power between 0.0 and 3.0. (optional) | ||
* <code> | * <code>potency</code>: Potency between 0.0 and 1.0. (optional) | ||
* <code> | * <code>accuracy</code>: Accuracy between 0.0 and 1.0. (optional) | ||
* <code>npc_slug</code>: npc slug name (e.g. "npc_maple") - if absent default "player" (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>get_player_monster name_variable</code> | ||
* <code>add_tech name_variable,bullet</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> | * <code>result</code>: One among "won", "lost" or "draw". (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>battles_print</code> | ||
* <code> | * <code>battles_print [character,result]</code> | ||
=== | === breeding === | ||
Select a monster in the player party filtered by gender and store its id in a variables (breeding_father or breeding_mother) | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>gender</code>: Gender (male or female). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>breeding male</code> | ||
* <code> | * <code>breeding female</code> | ||
=== | === 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''' | '''Parameters''' | ||
* <code> | * <code>event_name</code>: The name of the event whose actions should be executed. | ||
'''Examples''' | '''Examples''' | ||
* <code>call_event name_event</code> | |||
* <code> | |||
=== | === change_bg === | ||
Change the background. | |||
'''Parameters''' | |||
* <code>background</code>: | |||
* it can be the name of the file (see below note) | |||
* it can be a RGB color separated by ":" (eg 255:0:0) | |||
* <code>image</code>: monster_slug or template_slug or path | |||
* if path, then "gfx/ui/background/" | |||
* if template (eg. ceo) in "gfx/sprites/player" | |||
* note: the background or image (if not monster or template) must be inside the folder (gfx/ui/background/) | |||
* background size: 240x160 | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>change_bg gradient_blue,rockitten</code> | ||
* <code>change_bg gradient_blue,ceo</code> | |||
* <code>change_bg gradient_blue</code> | |||
* <code>change_bg</code> (stop) | |||
=== | === change_state === | ||
Change to the specified state. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>state_name</code>: The state name to switch to (e.g. PCState). | ||
* <code> | * <code>optional</code>: Variable related to specific states (eg slug for JournalInfoState). (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>change_state PCState</code> | ||
* <code>change_state JournalInfoState,rockitten</code> | |||
=== | === char_face === | ||
Make the character face a certain direction. | |||
'''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>direction</code>: Direction to make the character's face. Can be set to: <code>left</code>, <code>right</code>, <code>up</code>, or <code>down</code>. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_face player,down</code> | ||
* <code>char_face npc_maple,right</code> | |||
=== | === char_look === | ||
Make a character look around. | |||
'''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> | * <code>frequency</code>: Frequency of movements. 0 to stop looking. If set to a different value it will be clipped to the range [0.5, 5]. If not passed the default value is 1. | ||
* <code>directions</code>: the direction the npc is going to look, by default all. (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_look character</code> | ||
* <code>char_look character,,right:left</code> | |||
=== | === char_move === | ||
Relative tile movement for character. | |||
'''Parameters''' | '''Parameters''' | ||
Line 613: | Line 571: | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_move spyder_homemakerpapertown, down 1, right 1, up 1, left 1</code> | ||
=== | === char_plague === | ||
Set the character | Set the character as infected, inoculated or healthy. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | * <code>condition</code>: Infected, inoculated or healthy. | ||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_plague infected,npc_maple</code> | ||
=== | === char_run === | ||
Set the character movement speed to the global run speed. | |||
'''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"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_run npc_mom</code> | ||
=== | === char_speed === | ||
Set the character movement speed to a custom value. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>speed</code>: Speed amount. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_speed npc_mom,0.2</code> | ||
=== | === char_stop === | ||
Make the character stop moving. | |||
'''Parameters''' | '''Parameters''' | ||
- | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_stop</code> | ||
=== | === char_walk === | ||
Set the character movement speed to the global walk speed. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_walk npc_mom</code> | ||
=== | === char_wander === | ||
Make a character wander around the map. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>frequency</code>: Frequency of movements. 0 to stop wandering. If set to a different value it will be clipped to the range [0.5, 5]. If not passed the default value is 1. | ||
* <code>t_bound</code>: Coordinates top_bound vertex (e.g. 5,7) | |||
* <code>b_bound</code>: Coordinates bottom_bound vertex (e.g. 7,9) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>char_wander npc_maple</code> | ||
* <code>char_wander npc_maple,,5,7,7,9</code> | |||
=== | === choice_item === | ||
Ask the player to make a choice among items. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>choices</code>: List of possible choices (item slugs eg: potion:tea), separated by a colon ":". | ||
* <code>variable</code>: Variable to store the result of the choice. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>choice_monster potion:tea,name_variable</code> | ||
=== | === choice_monster === | ||
Ask the player to make a choice among monsters. | |||
'''Parameters''' : | '''Parameters''' | ||
* <code>variable</code>: | * <code>choices</code>: List of possible choices (monster slugs eg: rockitten:apeoro), separated by a colon ":". | ||
* <code>variable</code>: Variable to store the result of the choice. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>choice_monster apeoro:rockitten,name_variable</code> | ||
=== | === choice_npc === | ||
Ask the player to make a choice among NPCs. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>choices</code>: List of possible choices (npc slugs eg: maple:billie), separated by a colon ":". | ||
* <code> | * <code>variable</code>: Variable to store the result of the choice. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>choice_monster billie:maple,name_variable</code> | ||
=== | === clear_kennel === | ||
Clear a kennel. It advisable to save the game and check twice. Remember the main kennel is "Kennel" and without destination (transfer) the monster will be deleted as well as the kennel. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>kennel</code>: The kennel to clear. | |||
* <code> | * <code>transfer</code>: The kennel to transfer the monsters. (optional) | ||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>clear_kennel name_kennel, new_kennel</code> | ||
=== | === clear_tuxepedia === | ||
Clear the key and value in the Tuxepedia dictionary. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>clear_tuxepedia rockitten</code> | ||
=== | === clear_variable === | ||
Clear the value of a variable from the game. | |||
'''Parameters''' | '''Parameters''' : | ||
* <code> | * <code>variable</code>: The variable to clear. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>clear_variable name_variable</code> | ||
=== | === copy_variable === | ||
Copy the value of var2 into var1 (e.g. var1 = var 2). | |||
'''Parameters''' | '''Parameters''' : | ||
* <code> | * <code>var1</code>: The variable to copy to. | ||
* <code>var2</code>: The variable to copy from. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>copy_variable new_variable,old_variable</code> | ||
=== | === create_npc === | ||
Creates an NPC and places them on the current map. | |||
'''Parameters''' | '''Parameters''' | ||
* <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> | * <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>behavior</code>: The NPC's movement behavior. Currently not implemented. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>create_npc Maple,2,3</code> | ||
* <code> | * <code>create_npc Pine,1,6,stand</code> | ||
=== | === delayed_teleport === | ||
Set teleport information. Teleport will be triggered during screen transition. Only use this if followed by a transition. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>map_name</code>: Name of the map to teleport to. | ||
* <code> | * <code>position_x</code>: X position to teleport to. | ||
* <code> | * <code>position_y</code>: Y position to teleport to. | ||
* <code> | |||
* <code> | '''Examples''' | ||
* <code>delayed_teleport cotton_town,10,10</code> | |||
=== evolution === | |||
Checks, asks and evolves. It's the action responsible for evolving monster when one or more conditions are met. It's advisable to use it with the condition <code>is/not check_evolution player</code> | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
'''Examples''' | |||
* <code>evolution player</code> | |||
=== fadeout_music === | |||
Fades out music over <code>x</code> milliseconds. | |||
'''Parameters''' | |||
* <code>time_seconds</code>: Time in milliseconds to fade out the currently playing music. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>fadeout_music 2</code> | ||
=== get_party_monster === | === get_party_monster === | ||
Line 807: | Line 777: | ||
* <code>get_player_monster name_variable,shape,serpent</code> | * <code>get_player_monster name_variable,shape,serpent</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> | ||
=== load_game === | |||
=== load_game === | |||
Loads the game. If the index parameter is absent, then it'll load slot4.save (index = 0 > slot 1, index = 1 > slot 2, index = 2 > slot 3) | Loads the game. If the index parameter is absent, then it'll load slot4.save (index = 0 > slot 1, index = 1 > slot 2, index = 2 > slot 3) | ||
Line 870: | Line 816: | ||
* <code>menu disable,menu_bag</code> | * <code>menu disable,menu_bag</code> | ||
=== | === modify_monster_stats === | ||
Change the stats of a monster in the current player's party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters are touched. (Optional) | ||
* <code> | * <code>stat</code>: A stat among armour, dodge, hp, melee, speed and ranged. If no stat, then all the stats. (Optional) | ||
* <code> | * <code>amount</code>: A/an float/int value, if no amount, then default 1 (+). (Optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>modify_monster_stats</code> | ||
* <code>modify_monster_stats ,,0.25</code> | |||
=== | * <code>modify_monster_stats name_variable,speed,25</code> | ||
* <code>modify_monster_stats name_variable,dodge,-12</code> | |||
* <code>modify_monster_stats name_variable,dodge,-0.4</code> | |||
=== modify_char_attribute === | |||
Modify the given attribute of the 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>character</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_char_attribute character,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> | * <code>money_print player</code> | ||
=== | === open_shop === | ||
Open the shop menu for a NPC. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>menu</code>: Either "buy", "sell" or "both". Default is "both". (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>open_shop npc_maple</code> | ||
=== pathfind === | |||
=== | Moves an NPC to a certain tile on the map. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the NPC to be moved. | ||
* <code> | * <code>tile_pos_x</code>: The X-tile coordinate to have the NPC to walk to. | ||
* <code> | * <code>tile_pos_y</code>: The Y-tile coordinate to have the NPC to walk to. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>pathfind Maple,2,3</code> | ||
* <code>pathfind Pine,1,6</code> | |||
* <code> | |||
=== | === pathfind_to_player === | ||
Pathfind NPC close the player. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>npc_slug</code>: | * <code>npc_slug</code>: Npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>direction</code>: Approaches the player from up, down, left or right. | ||
* <code>distance</code>: How many tiles (2, 3, 4, etc.) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>pathfind_to_player spyder_route2_roddick</code> | ||
* <code>translated_dialog spyder_route2_roddick1</code> | |||
* <code>start_battle spyder_route2_roddick</code> | |||
=== | === pause_music === | ||
Pauses the currently playing music. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>animation_name</code>: The name of the animation to play under <code>resources/animations/tileset</code>. | ||
* <code> | * <code>duration</code>: The amount of time in seconds between each frame. | ||
* <code> | * <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> | * <code>play_map_animation grass,0.1,noloop,player</code> | ||
* <code> | * <code>play_map_animation sign01,0.4,loop,33,10</code> | ||
=== | === play_music === | ||
Plays an audio file. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>filename</code>: Music file to load (slug inside the JSON in db/sound) | ||
* <code> | * <code>volume</code>: Number between 0.0 and 1.0. (optional) | ||
* <code> | * <code>loop</code>: How many times loop, default forever. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>play_music music_mystic_island</code> | ||
=== | === play_sound === | ||
Plays a sound file. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>filename</code>: Sound file to load (slug inside the JSON in db/sound) | ||
* <code>volume</code>: Number between 0.0 and 1.0. (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>play_sound sound_confirm</code> | ||
=== | === player_sprite === | ||
Check the player's sprite | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>sprite</code>: slug of the sprite | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>is player_sprite adventurer</code> | ||
=== | === print === | ||
Print the current value of a game variable to the console. If no variable is specified, print out values of all game variables. | |||
'''Parameters''' : | |||
* <code>variable</code>: Prints out the value of this variable (optional) | |||
'''Parameters''' : | |||
* <code>variable</code>: Prints out the value of this variable (optional) | |||
'''Examples''' | '''Examples''' | ||
Line 1,032: | Line 950: | ||
=== quarantine === | === quarantine === | ||
Quarantine infected monsters. Amount works only for "out", it takes out the amount in a random way. | Quarantine infected monsters. Amount works only for "out", it takes out the amount in a random way. | ||
'''Parameters''' | '''Parameters''' | ||
Line 1,063: | Line 981: | ||
=== 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/route1.json'' | Here is an example encounter file: ''resources/db/encounter/route1.json'' | ||
<code>{"slug":"route1","monsters":[{"monster":"pairagrin","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]}]}</code> | |||
'''Parameters''' | '''Parameters''' | ||
Line 1,151: | Line 1,058: | ||
=== remove_monster === | === remove_monster === | ||
Remove a monster from the party if the monster is there. | Remove a monster from the given trainer's party if the monster is there. Monster is determined by instance_id, which must be passed in a game variable. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>instance_id</code>: Id of the monster to remove. | ||
* <code>trainer_slug</code>: Slug of the trainer. If no trainer slug is passed it defaults to the current player. | |||
'''Examples''' | '''Examples''' | ||
Line 1,180: | Line 1,088: | ||
* <code>remove_state</code> (it removes everything, excluding the basic ones) | * <code>remove_state</code> (it removes everything, excluding the basic ones) | ||
* <code>remove_state JournalInfoState</code> (it removes everything, excluding the basic ones) | * <code>remove_state JournalInfoState</code> (it removes everything, excluding the basic ones) | ||
=== 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,232: | Line 1,131: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>transition_time</code>: Time in seconds - default 2 (optional). | ||
* <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | * <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | ||
Line 1,253: | Line 1,152: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>bubble</code>: dots, drop, exclamation, heart, note, question, sleep, angry, confused, fireworks | * <code>bubble</code>: dots, drop, exclamation, heart, note, question, sleep, angry, confused, fireworks | ||
Line 1,261: | Line 1,160: | ||
* <code>set_bubble player,note</code> (set bubble player) | * <code>set_bubble player,note</code> (set bubble player) | ||
* <code>set_bubble player</code> (remove bubble player) | * <code>set_bubble player</code> (remove bubble player) | ||
=== set_code === | |||
Set a code and checks if it's correct or not. Case Sensitive: ATTENTION and AtTenTION are two different words. | |||
'''Parameters''' | |||
* <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>answer</code>: The right answer to the question. | |||
* <code>variable</code>: Where the result (right/wrong) is saved. | |||
'''Examples''' | |||
* <code>set_code access_code,joke,name_variable</code> | |||
=== set_economy === | === set_economy === | ||
Line 1,266: | Line 1,176: | ||
'''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,307: | Line 1,217: | ||
'''Examples''' | '''Examples''' | ||
* <code>set_layer 255:0:0:128</code> | * <code>set_layer 255:0:0:128</code> | ||
=== set_money === | |||
Set the key and value in the money dictionary. It'll reset the previous amount. | |||
'''Parameters''' | |||
* <code>slug</code>: Slug name (e.g. player or NPC, etc.). | |||
* <code>amount</code>: Amount of money | |||
'''Examples''' | |||
* <code>set_money player,500</code> | |||
=== set_mission === | === set_mission === | ||
Line 1,312: | Line 1,232: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>slug</code>: slug mission | * <code>slug</code>: slug mission | ||
* <code>operation</code>: add, remove or change | * <code>operation</code>: add, remove or change | ||
* <code>status</code>: completed, pending, failed (default pending) | * <code>status</code>: completed, pending, failed (default pending) | ||
* <code>npc_slug</code>: slug name (e.g. "npc_maple"), default player. | |||
'''Examples''' | '''Examples''' | ||
Line 1,321: | Line 1,241: | ||
* <code>set_mission mission1,change,completed</code> | * <code>set_mission mission1,change,completed</code> | ||
=== | === set_monster_flair === | ||
Set | Set a monster's flair to the given value. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters are changed. | ||
* <code> | * <code>category</code>: Category of the monster flair. | ||
* <code>flair</code>: Name of the monster flair. | |||
'''Examples''' | '''Examples''' | ||
* <code>get_player_monster name_variable</code> | |||
* <code>get_player_monster name_variable</code> | |||
* <code>set_monster_flair name_variable,category,flair</code> | * <code>set_monster_flair name_variable,category,flair</code> | ||
=== 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''' | ||
Line 1,380: | Line 1,278: | ||
* <code>get_player_monster name_variable</code> | * <code>get_player_monster name_variable</code> | ||
* <code>set_monster_level name_variable,1</code> | * <code>set_monster_level name_variable,1</code> | ||
=== set_monster_plague === | |||
Cure or infect a monster. | |||
'''Parameters''' | |||
* <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters get the condition. (optional) | |||
* <code>condition</code>: inoculated, healthy or infected, default healthy (optional) | |||
'''Examples''' | |||
* <code>set_monster_plague</code> (all the monsters in the party are healthy) | |||
or | |||
* <code>get_player_monster name_variable</code> | |||
* <code>set_monster_plague name_variable,infected</code> | |||
=== set_monster_status === | === set_monster_status === | ||
Line 1,404: | Line 1,315: | ||
'''Examples''' | '''Examples''' | ||
* <code>set_char_attribute character,attribute,value</code> | * <code>set_char_attribute character,attribute,value</code> | ||
=== set_player_name === | === set_player_name === | ||
Line 1,491: | Line 1,382: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
Line 1,504: | Line 1,395: | ||
'''Examples''' | '''Examples''' | ||
* <code>start_battle | * <code>start_battle npc_maple</code> | ||
* <code>start_battle npc_maple,npc_apple</code> | * <code>start_battle npc_maple,npc_apple</code> | ||
Line 1,529: | Line 1,420: | ||
'''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) | ||
Line 1,543: | Line 1,434: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code>teleport_faint</code> | * <code>teleport_faint</code> | ||
=== teleport === | === teleport === | ||
Line 1,565: | Line 1,455: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>removed</code>: Instance id (name variable). | ||
* <code>added</code>: Slug monster | * <code>added</code>: Slug monster. | ||
'''Examples''' | '''Examples''' | ||
Line 1,574: | Line 1,464: | ||
=== 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,483: | ||
* <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 - default 2. (optional) | ||
* <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | * <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | ||
Line 1,619: | Line 1,511: | ||
* <code>translated_dialog msgid</code> | * <code>translated_dialog msgid</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,678: | Line 1,570: | ||
'''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>get_player_monster name_variable</code> | * <code>get_player_monster name_variable</code> | ||
Line 1,696: | Line 1,588: | ||
=== Battle related === | === Battle related === | ||
* <code>battle_last_result</code>: the result can be <code>won</code>, <code>draw</code>, <code>lost</code> or <code>ran</code>. | |||
other variables include: | |||
* <code>battle_last_monster_name</code> name of the last monster fought. | * <code>battle_last_monster_name</code> name of the last monster fought. | ||
* <code>battle_last_monster_level</code> level of the last monster fought. | * <code>battle_last_monster_level</code> level of the last monster fought. | ||
Line 1,701: | Line 1,596: | ||
* <code>battle_last_monster_category</code> category of the last monster fought. | * <code>battle_last_monster_category</code> category of the last monster fought. | ||
* <code>battle_last_monster_shape</code> shape of the last monster fought. | * <code>battle_last_monster_shape</code> shape of the last monster fought. | ||
* <code>battle_last_trainer</code> slug of the last trainer fought (it applies only to trainer battles). | |||
* <code>battle_last_trainer</code> slug of the last trainer fought | |||
battles | |||
=== Time related === | === Time related === | ||
Line 1,767: | Line 1,655: | ||
Let's say you want to set up and event for trading monsters. You need 3 events after creating the NPC in map. | Let's say you want to set up and event for trading monsters. You need 3 events after creating the NPC in map. | ||
* <code>monster1</code> (monster desired by the NPC) | * <code>monster1</code> (monster desired by the NPC) | ||
* <code>monster2</code> (monster the NPC wants to trade | * <code>monster2</code> (monster the NPC wants to trade) | ||
1st: if the player has the monster | 1st: if the player has the monster | ||
* <code>translated_dialog dialog_npc1</code> | |||
* <code>translated_dialog_choice yes:no,npc_willtrade</code> | |||
* <code>talk npc_slug</code> | |||
* <code>is has_monster monster1</code> | |||
* <code>not variable_set npc_hastraded:yes</code> | |||
2nd: if the player hasn't the monster | 2nd: if the player hasn't the monster | ||
* <code>translated_dialog dialog_npc1</code> | |||
* <code>translated_dialog dialog_npc_nomonster1</code> | |||
* <code>talk npc_slug</code> | |||
* <code>not has_monster monster1</code> | |||
* <code>not variable_set npc_hastraded:yes</code> | |||
3rd: trading part | 3rd: trading part | ||
* <code>translated_dialog dialog_npc_willtrade</code> | |||
* <code>get_player_monster name_variable</code> | |||
* <code>trading name_variable,traded_monster</code> | |||
* <code>set_variable npc_hastraded:yes</code> | |||
* <code>is has_monster monster1</code> | |||
* <code>is variable_set npc_willtrade</code> | |||
* <code>not variable_set npc_hastraded</code> | |||
==== Get Party Monster ==== | ==== Get Party Monster ==== | ||
Let's say you want to add a tech to a monster (NPC). Eg. the NPC [[Rockitten]] needs to know [[Canine]], but [[Rockitten]] is the 4th monster (equal to 3rd slot). | Let's say you want to add a tech to a monster (NPC). Eg. the NPC [[Rockitten]] needs to know [[Canine]], but [[Rockitten]] is the 4th monster (equal to 3rd slot). | ||
* <code>add_monster rockitten,20,npc_slug,27,10</code> | |||
* <code>add_monster vivipere,20,npc_slug,27,10</code> | |||
* <code>add_monster budaye,20,npc_slug,27,10</code> | |||
* <code>add_monster rockitten,20,npc_slug,27,10</code> | |||
* <code>add_monster nut,20,npc_slug,27,10</code> | |||
* <code>get_party_monster npc_slug</code> | |||
* <code>add_tech iid_slot_3,canine,,,,npc_slug</code> here <code>iid_slot_3</code> followed by [[Canine]] | |||
* <code>start_battle npc_slug</code> | |||