|
|
(119 intermediate revisions by the same user not shown) |
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 page under the '''tuxemon/event/conditions''':
| | [[Event Reference Condition]] |
| | |
| === battle_is ===
| |
| Check to see if the player has fought against NPC and won, lost or draw.
| |
| | |
| '''Parameters'''
| |
| * <code>character</code>: Npc slug name (e.g. "npc_maple").
| |
| * <code>result</code>: One among "won", "lost" or "draw".
| |
| | |
| '''Examples'''
| |
| * <code>is battle_is npc_maple,won</code>
| |
| | |
| === button_pressed ===
| |
| Check to see if a particular key has been pressed. E.g. <code>K_RETURN</code>.
| |
| | |
| '''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]
| |
| | |
| '''Examples'''
| |
| * <code>is button_pressed K_RETURN</code>
| |
| * <code>is button_pressed K_ESCAPE</code>
| |
| * <code>not button_pressed K_SPACE</code>
| |
| | |
| === combat_started ===
| |
| Check to see if combat has currently started.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>is combat_started</code>
| |
| | |
| === dialog_open ===
| |
| Check to see if a dialog window is currently open.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>is dialog_open</code>
| |
| * <code>not dialog_open</code>
| |
| | |
| === has_box ===
| |
| Check to see how many monsters are in the box.
| |
| | |
| '''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>value</code>: The value to compare the party with.
| |
| * <code>box</code>: The box name.
| |
| | |
| '''Examples'''
| |
| * <code>is has_box Kennel,less_than,1</code>
| |
| | |
| === has_item ===
| |
| Check to see if a NPC inventory contains something.
| |
| | |
| '''Parameters'''
| |
| * <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 <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>quantity</code>: Quantity to compare with. (optional)
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>monster_slug</code>: The slug of the monster to check for.
| |
| | |
| '''Examples'''
| |
| * <code>is has_monster txmn_pigabyte</code>
| |
| | |
| === has_party_breeder ===
| |
| 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'''
| |
| * <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'''
| |
| * <code>is has_sprite swimmer</code>
| |
| | |
| === has_tech ===
| |
| Check to see if the player has a technique in his party (one of the monsters).
| |
| | |
| '''Parameters'''
| |
| * <code>technique</code>: Technique slug name (e.g. "bullet").
| |
| | |
| '''Examples'''
| |
| * <code>is has_tech bullet</code>
| |
| | |
| === money_is ===
| |
| Check to see if the player has a certain amount of money (pocket).
| |
| | |
| '''Parameters'''
| |
| * <code>slug</code>: Slug name (player).
| |
| * <code>operator</code>: One of "==", "!=", ">", ">=", "<" or "<=".
| |
| * <code>amount</code>: Amount of money.
| |
| | |
| '''Examples'''
| |
| * <code>is money_is player,>=,500</code>
| |
| | |
| === monster_flair ===
| |
| Check to see if the given monster flair matches the expected value.
| |
| | |
| '''Parameters'''
| |
| * <code>slot</code>: Position of the monster in the player monster list.
| |
| * <code>property</code>: Category of the flair.
| |
| * <code>name</code>: Name of the flair.
| |
| | |
| '''Examples'''
| |
| * <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 ===
| |
| Check to see if the specified music file is currently playing.
| |
| | |
| '''Parameters'''
| |
| * <code>music_file</code>: The music file to check.
| |
| | |
| '''Examples'''
| |
| * <code>is music_playing 472452_8-Bit-Ambient.ogg</code>
| |
| | |
| === npc_at ===
| |
| 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'''
| |
| * <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'''
| |
| * <code>is npc_at Maple</code>
| |
| * <code>is npc_at Maple,4,3</code>
| |
| | |
| === npc_exists ===
| |
| Check to see if an NPC exists on the current map with <code>npc_name</code>.
| |
| | |
| '''Parameters'''
| |
| * <code>npc_name</code>: The name of the NPC on the current map.
| |
| | |
| '''Examples'''
| |
| * <code>not npc_exists Apple</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>
| |
| | |
| === npc_facing ===
| |
| Check to see if the npc is facing: <code>up</code>, <code>down</code>, <code>left</code> or <code>right</code>.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the NPC.
| |
| * <code>direction</code>: Direction to check for: (<code>up</code>, <code>down</code>, <code>left</code>, <code>right</code>)
| |
| | |
| '''Examples'''
| |
| * <code>is npc_facing Maple,up</code>
| |
| * <code>not npc_facing Maple,down</code>
| |
| | |
| === once ===
| |
| Checks the date saved in the variables with today's date.
| |
| | |
| '''Parameters'''
| |
| * <code>timeframe</code>: nr of days the event stays "blocked" (eg. 1, 7, etc.)
| |
| * <code>variable</code>: Variable where the date is stored.
| |
| | |
| '''Examples'''
| |
| * <code>set_variable variable_name:today</code>
| |
| * <code>is once 1,variable_name</code> (it blocks the event for 1 day)
| |
| or
| |
| * <code>is once 7,variable_name</code> (it blocks the event for 7 days - 1 week)
| |
| | |
| === party_infected ===
| |
| Check to see how many monster are infected and stores the iids.
| |
| | |
| '''Parameters'''
| |
| * <code>value</code>: all, some or none.
| |
| | |
| '''Examples'''
| |
| * <code>is party_infected some</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'''
| |
| * <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.
| |
| | |
| '''Examples'''
| |
| * <code>is party_size less_than,1</code>
| |
| * <code>not party_size equals,0</code>
| |
| * <code>is party_size greater_than,4</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'''
| |
| * <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'''
| |
| * <code>is player_at</code>
| |
| * <code>is player_at 4,3</code>
| |
| | |
| === player_defeated ===
| |
| Check to see the player has at least one tuxemon, and all tuxemon in their party are defeated.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>is player_defeated</code>
| |
| | |
| === player_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 player_facing_npc Apple</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'''
| |
| * <code>value</code>: value (eg surfable) inside the tileset (optional)
| |
| | |
| '''Examples'''
| |
| * <code>is player_facing_tile</code>
| |
| * <code>is player_facing_tile surfable</code>
| |
| | |
| === player_facing ===
| |
| Check to see where an NPC is facing.
| |
| | |
| '''Parameters'''
| |
| * <code>direction</code>: One of "up", "down", "left" or "right".
| |
| | |
| '''Examples'''
| |
| * <code>is player_facing right</code>
| |
| | |
| === player_in ===
| |
| Check to see if the player is at the condition position on a specific set of tiles.
| |
| | |
| '''Parameters'''
| |
| * <code>value</code>: value (eg surfable) inside the tileset.
| |
| | |
| '''Examples'''
| |
| * <code>is player_in surfable</code>
| |
| | |
| === player_moved ===
| |
| 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'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>is player_moved</code>
| |
| | |
| === to_talk ===
| |
| Check if we are attempting interact with a map condition tile.
| |
| | |
| '''Parameters'''
| |
| * <code>character</code>: Npc slug name (e.g. "npc_maple").
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>is true</code>
| |
| * <code>not true</code>
| |
| | |
| === tuxepedia ===
| |
| Check Tuxepedia's progress.
| |
| | |
| '''Parameters'''
| |
| * <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".
| |
| * <code>percentage</code>: Number between 0.1 and 1.0
| |
| | |
| '''Examples'''
| |
| * <code>is tuxepedia less_than,0.2</code>
| |
| | |
| === variable_is ===
| |
| Check an operation over a variable.
| |
| | |
| '''Parameters'''
| |
| * <code>value1</code>: Either a variable or a number.
| |
| * <code>operation</code>: One of "==", "!=", ">", ">=", "<" or "<=".
| |
| * <code>value2</code>: Either a variable or a number.
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <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>
| |
|
| |
|
| == Action Reference == | | == 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''':
| | [[Event Reference Action]] |
| | |
| === add_collision ===
| |
| Adds a collision defined by a specific label. With numbers, it blocks a specific tile.
| |
| | |
| '''Parameters'''
| |
| * <code>label</code>: Name of the obstacle.
| |
| * <code>coord</code>: Coordinates map (single coordinate). (optional)
| |
| | |
| '''Examples'''
| |
| * <code>add_collision obstacle,6,8</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'''
| |
| * <code>slug</code>: slug name (e.g. "npc_maple").
| |
| * <code>phone_number</code>: 3 digits
| |
| | |
| '''Examples'''
| |
| * <code>add_contacts npc_maple,123</code>
| |
| | |
| === add_item ===
| |
| Add the specified item to the player's inventory.
| |
| | |
| '''Parameters'''
| |
| * <code>item_name</code>: The name of the item to add as defined in the monster JSON under <code>resources/db/item</code>.
| |
| | |
| '''Examples'''
| |
| * <code>add_item hatchet</code>
| |
| | |
| === add_monster ===
| |
| Add the specified monster to the player's party.
| |
| | |
| '''Parameters'''
| |
| * <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>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").
| |
| * <code>power</code>: Power between 0.0 and 3.0. (optional)
| |
| * <code>potency</code>: Potency between 0.0 and 1.0. (optional)
| |
| * <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'''
| |
| * <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'''
| |
| * <code>character</code>: Npc slug name (e.g. "npc_maple"). (optional)
| |
| * <code>result</code>: One among "won", "lost" or "draw". (optional)
| |
| | |
| '''Examples'''
| |
| * <code>battles_print</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'''
| |
| * <code>gender</code>: Gender (male or female).
| |
| | |
| '''Examples'''
| |
| * <code>breeding male</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'''
| |
| * <code>event_id</code>: The id of the event whose actions should be executed.
| |
| | |
| '''Examples'''
| |
| * <code>call_event 11</code>
| |
| * <code>call_event 8</code>
| |
| | |
| === change_bg ===
| |
| Change the background. It's advisable end the bg sequence with "end"
| |
| Eg:
| |
| act1 change_bg filename
| |
| act2 change_bg end
| |
| | |
| '''Parameters'''
| |
| * <code>background</code>: the name of the file without ".PNG". The files must be inside the folder (gfx/ui/background/). Ideal size: 240x160
| |
| | |
| '''Examples'''
| |
| * <code>change_bg background</code>
| |
| | |
| === change_state ===
| |
| Change to the specified state.
| |
| | |
| '''Parameters'''
| |
| * <code>state_name</code>: The state name to switch to (e.g. PCState).
| |
| | |
| '''Examples'''
| |
| * <code>change_state PCState</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'''
| |
| * <code>kennel</code>: The kennel to clear.
| |
| * <code>transfer</code>: The kennel to transfer the monsters. (optional)
| |
| | |
| '''Examples'''
| |
| * <code>clear_kennel name_kennel, new_kennel</code>
| |
| | |
| === clear_tuxepedia ===
| |
| Clear the key and value in the Tuxepedia dictionary.
| |
| | |
| '''Parameters'''
| |
| * <code>monster_slug</code>: Monster slug name (e.g. "rockitten").
| |
| | |
| '''Examples'''
| |
| * <code>clear_tuxepedia rockitten</code>
| |
| | |
| === clear_variable ===
| |
| Clear the value of a variable from the game.
| |
| | |
| '''Parameters''' :
| |
| * <code>variable</code>: The variable to clear.
| |
| | |
| '''Examples'''
| |
| * <code>clear_variable name_variable</code>
| |
| | |
| === copy_variable ===
| |
| Copy the value of var2 into var1 (e.g. var1 = var 2).
| |
| | |
| '''Parameters''' :
| |
| * <code>var1</code>: The variable to copy to.
| |
| * <code>var2</code>: The variable to copy from.
| |
| | |
| '''Examples'''
| |
| * <code>copy_variable new_variable,old_variable</code>
| |
| | |
| === create_npc ===
| |
| Creates an NPC and places them on the current map.
| |
| | |
| '''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>behavior</code>: The NPC's movement behavior. Currently not implemented.
| |
| | |
| '''Examples'''
| |
| * <code>create_npc Maple,2,3</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'''
| |
| * <code>map_name</code>: Name of the map to teleport to.
| |
| * <code>position_x</code>: X position to teleport to.
| |
| * <code>position_y</code>: Y position to teleport to.
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>text</code>: The text to display in a dialog window.
| |
| | |
| '''Examples'''
| |
| * <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 ===
| |
| Fades out music over <code>x</code> milliseconds.
| |
| | |
| '''Parameters'''
| |
| * <code>time_seconds</code>: Time in milliseconds to fade out the currently playing music.
| |
| | |
| '''Examples'''
| |
| * <code>fadeout_music 2</code>
| |
| | |
| === get_party_monster ===
| |
| Saves all the iids (party) in variables. Names are saved in game variables: <code>iid_slot_{index}</code>. Where index is the position in the party (the 1st one is 0, 2nd one is 1, etc.)
| |
| | |
| '''Parameters'''
| |
| * <code>npc_slug</code>: npc slug name (e.g. "npc_maple") - if absent default "player" (optional)
| |
| | |
| '''Examples'''
| |
| * <code>get_party_monster</code>
| |
| * <code>get_party_monster npc_maple</code>
| |
| | |
| === get_player_monster ===
| |
| Select a monster in the player party and store its id in a variable.
| |
| | |
| '''Parameters'''
| |
| * <code>variable_name</code>: Name of the variable where to store the monster id.
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>kennel</code>: Name of the kennel. (optional)
| |
| | |
| '''Examples'''
| |
| * <code>kennel_print</code>
| |
| * <code>kennel_print name_kennel</code>
| |
| | |
| === lock_controls ===
| |
| Lock player controls.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple").
| |
| * <code>attribute</code>: Name of the attribute to modify.
| |
| * <code>value</code>: Value of the attribute modifier.
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>attribute</code>: Name of the attribute to modify.
| |
| * <code>value</code>: Value of the attribute modifier.
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>slug</code>: Slug name (e.g. player or NPC, etc.). (optional)
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <code>name</code>: The name of the npc.
| |
| * <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>npc_face Maple,left</code>
| |
| * <code>npc_face Pine,up</code>
| |
| | |
| === npc_move ===
| |
| Determines the NPC's movement behaviour.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the npc.
| |
| | |
| '''Examples'''
| |
| * <code>npc_move spyder_homemakerpapertown, down 1, right 1, up 1, left 1</code>
| |
| | |
| === npc_plague ===
| |
| Set the NPC as infected, inoculated or healthy.
| |
| | |
| '''Parameters'''
| |
| * <code>condition</code>: Infected, inoculated or healthy
| |
| * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). (optional)
| |
| | |
| '''Examples'''
| |
| * <code>npc_plague spyder_homemakerpapertown</code>
| |
| | |
| === npc_run ===
| |
| Sets the NPC's speed to the universal run speed.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the npc.
| |
| | |
| '''Examples'''
| |
| * <code>npc_run npc_mom</code>
| |
| | |
| === npc_speed ===
| |
| Sets the NPC's walk speed.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the npc.
| |
| | |
| '''Examples'''
| |
| * <code>npc_speed npc_mom, 0.2</code>
| |
| | |
| === npc_walk ===
| |
| Sets the NPC's speed to the universal walk speed.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the npc.
| |
| | |
| '''Examples'''
| |
| * <code>npc_walk npc_mom</code>
| |
| | |
| === npc_wander ===
| |
| Sets the NPC's behaviour to wander about instead of stand in place.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the npc.
| |
| | |
| '''Examples'''
| |
| * <code>npc_wander npc_mom</code>
| |
| | |
| === open_shop ===
| |
| Open the shop menu for a NPC.
| |
| | |
| '''Parameters'''
| |
| * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple").
| |
| * <code>menu</code>: Either "buy", "sell" or "both". Default is "both". (optional)
| |
| | |
| '''Examples'''
| |
| * <code>open_shop npc_maple</code>
| |
| | |
| === pathfind ===
| |
| Moves an NPC to a certain tile on the map.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the NPC to be moved.
| |
| * <code>tile_pos_x</code>: The X-tile coordinate to have the NPC to walk to.
| |
| * <code>tile_pos_y</code>: The Y-tile coordinate to have the NPC to walk to.
| |
| | |
| '''Examples'''
| |
| * <code>pathfind Maple,2,3</code>
| |
| * <code>pathfind Pine,1,6</code>
| |
| | |
| === pathfind_to_player ===
| |
| Pathfind NPC close the player.
| |
| | |
| '''Parameters'''
| |
| * <code>npc_slug</code>: Npc slug name (e.g. "npc_maple").
| |
| * <code>direction</code>: Approaches the player from up, down, left or right.
| |
| * <code>distance</code>: How many tiles (2, 3, 4, etc.)
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <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.
| |
| | |
| '''Parameters'''
| |
| * <code>filename</code>: The name of the music file to play under "music/"
| |
| | |
| '''Examples'''
| |
| * <code>play_music 472452_8-Bit-Ambient.ogg</code>
| |
| | |
| === play_sound ===
| |
| Plays an audio file located under "sounds/".
| |
| | |
| '''Parameters'''
| |
| * <code>filename</code>: The name of the sound file to play under "sounds/"
| |
| | |
| '''Examples'''
| |
| * <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 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)
| |
| | |
| '''Examples'''
| |
| * <code>print</code>
| |
| * <code>print name_variable</code>
| |
| | |
| === quarantine ===
| |
| Quarantine infected monsters. Amount works only for "out", it takes out the amount in a random way.
| |
| | |
| '''Parameters'''
| |
| * <code>value</code>: in or out
| |
| * <code>amount</code>: number of monsters (optional)
| |
| | |
| '''Examples'''
| |
| * <code>quarantine out</code> everything out (player's party -> if full, then box)
| |
| * <code>quarantine out,5</code> eg. box contains 30 monsters <code>quarantine out,5</code>, it means 5 monsters by random
| |
| | |
| === quit ===
| |
| Completely quit the game.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>quit</code>
| |
| | |
| === random_battle ===
| |
| Start random battle with a random npc with a determined number of monster in a certain range of levels.
| |
| | |
| '''Parameters'''
| |
| * <code>nr_txmns</code>: Number of tuxemon (1 to 6).
| |
| * <code>min_level</code>: Minimum level of the party.
| |
| * <code>max_level</code>: Maximum level of the party.
| |
| | |
| '''Examples'''
| |
| * <code>random_battle 6,1,99</code>
| |
| | |
| === 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>player_at</code> and <code>player_moved</code> conditions.
| |
| | |
| Here is an example encounter file:
| |
| | |
| ''resources/db/encounter/route1.json''
| |
| | |
| json
| |
| {
| |
| "monster": "aardorn",
| |
| "encounter_rate": 3.5,
| |
| "daytime": true,
| |
| "exp_req_mod": 1,
| |
| "level_range": [
| |
| 2,
| |
| 4
| |
| ]
| |
| },
| |
| | |
| '''Parameters'''
| |
| * <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).
| |
| | |
| '''Examples'''
| |
| * <code>random_encounter route1</code>
| |
| * <code>random_encounter route1,20</code>
| |
| | |
| === random_integer ===
| |
| Randomly choose an integer between 2 numbers (inclusive), and set the key in the player.game_variables dictionary to be this value. For example, 'random_integer xyz,1,6' will set the value of the game variable 'xyz' to be either 1, 2, 3, 4, 5, or 6.
| |
| | |
| '''Parameters'''
| |
| * <code>variable</code>: Name of the variable.
| |
| * <code>lower_bound</code>: Lower bound of range to return an integer between (inclusive)
| |
| * <code>upper_bound</code>: Upper bound of range to return an integer between (inclusive)
| |
| | |
| '''Examples'''
| |
| * <code>random_integer name_variable,1,9</code>
| |
| | |
| === random_monster ===
| |
| Add a monster to the specified trainer's party if there is room.
| |
| | |
| '''Parameters'''
| |
| * <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>exp_mod</code>: Experience modifier. (optional)
| |
| * <code>money_mod</code>: Money modifier. (optional)
| |
| * <code>shape</code>: Shape (eg. varmint, brute, etc.). (optional)
| |
| * <code>evo</code>: Stage (eg. basic, stage1, etc.). (optional)
| |
| | |
| '''Examples'''
| |
| * <code>random_monster 10</code>
| |
| * <code>random_monster 10,npc_maple</code>
| |
| * <code>random_monster 10,npc_maple,10,27</code>
| |
| * <code>random_monster 10,npc_maple,10,27,aquatic,basic</code>
| |
| * <code>random_monster 10,npc_maple,,,brute,basic</code>
| |
| | |
| === remove_collision ===
| |
| Removes a collision defined by a specific label.
| |
| | |
| '''Parameters''' :
| |
| * <code>label</code>: Name of the obstacle.
| |
| | |
| '''Examples'''
| |
| * <code>remove_collision obstacle</code> (it can one added with add_collision or an existing zone in the .tmx file).
| |
| | |
| === remove_contacts ===
| |
| Remove contact from the app (Nu Phone).
| |
| | |
| '''Parameters''' :
| |
| * <code>slug</code>: slug name (e.g. "npc_maple").
| |
| | |
| '''Examples'''
| |
| * <code>remove_contacts npc_maple</code>
| |
| | |
| === remove_monster ===
| |
| 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'''
| |
| * <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'''
| |
| * <code>get_player_monster name_variable</code>
| |
| * <code>remove_monster name_variable</code>
| |
| | |
| === remove_npc ===
| |
| Removes an NPC from the current map.
| |
| | |
| '''Parameters'''
| |
| * <code>name</code>: The name of the NPC to remove.
| |
| | |
| '''Examples'''
| |
| * <code>remove_npc Maple</code>
| |
| * <code>remove_npc Pine</code>
| |
| | |
| === rename_monster ===
| |
| Open the monster menu and text input screens to rename a selected monster.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>rename_monster</code>
| |
| | |
| === rename_player ===
| |
| Open the text input screen to rename the player.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>rename_player</code>
| |
| | |
| === rumble ===
| |
| Rumble available controllers with rumble support.
| |
| | |
| '''Parameters'''
| |
| * <code>duration</code>: Time in seconds to rumble for.
| |
| * <code>power</code>: Percentage of power to rumble.
| |
| | |
| '''Examples'''
| |
| * <code>rumble duration,power</code>
| |
| | |
| === screen_transition ===
| |
| Fades the screen to black and back over <code>x</code> seconds.
| |
| | |
| '''Parameters'''
| |
| * <code>transition_time</code>: Time in seconds to fade the screen to black.
| |
| | |
| '''Examples'''
| |
| * <code>screen_transition 2</code>
| |
| | |
| === set_battle ===
| |
| Set the key in the player.battle_history dictionary.
| |
| | |
| '''Parameters'''
| |
| * <code>character</code>: Npc slug name (e.g. "npc_maple").
| |
| * <code>result</code>: One among "won", "lost" or "draw"
| |
| | |
| '''Examples'''
| |
| * <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'''
| |
| * <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 the economy (prices of items) of the npc or player.
| |
| | |
| '''Parameters'''
| |
| * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple").
| |
| * <code>economy_slug</code>: Slug of an economy.
| |
| | |
| '''Examples'''
| |
| * <code>set_economy spyder_shopkeeper,spyder_candy_scoop</code>
| |
| | |
| === set_kennel_visible ===
| |
| Set the kennel visible or hidden.
| |
| | |
| From hidden to visible: set_kennel_visible name_kennel,true
| |
| From visible to hidden: set_kennel_visible name_kennel,false
| |
| | |
| '''Parameters'''
| |
| * <code>kennel</code>: Name of the kennel.
| |
| * <code>visible</code>: true/false.
| |
| | |
| '''Examples'''
| |
| * <code>set_kennel_visible name_kennel,true</code>
| |
| * <code>set_kennel_visible name_kennel,false</code>
| |
| | |
| === set_kennel ===
| |
| Create a new kennel. If the kennel is visible, then it's advisable to create a msgid in the en_US PO file.
| |
| | |
| msgid "kennel_name"
| |
| msgstr "Kennel Name"
| |
| | |
| '''Parameters'''
| |
| * <code>kennel</code>: Name of the kennel.
| |
| * <code>visible</code>: true/false.
| |
| | |
| '''Examples'''
| |
| * <code>set_kennel new_kennel,true</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_monster_flair ===
| |
| Set a monster's flair to the given value.
| |
| | |
| '''Parameters'''
| |
| * <code>slot</code>: Slot of the monster in the party.
| |
| * <code>category</code>: Category of the monster flair.
| |
| * <code>flair</code>: Name of the monster flair.
| |
| | |
| '''Examples'''
| |
| * <code>set_monster_flair 1,category,flair</code>
| |
| | |
| === 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'''
| |
| * <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 to be restored to. If no health is specified, the hp is maxed out.
| |
| | |
| '''Examples'''
| |
| * <code>set_monster_health 1,1</code>
| |
| === set_monster_level ===
| |
| Changes the level of a monster in the current player's party.
| |
| | |
| '''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 ===
| |
| Change the level of a monster in the current player's party.
| |
| | |
| '''Parameters'''
| |
| * <code>level</code>: Number of levels to add. Negative numbers are allowed.
| |
| * <code>slot</code>: Slot of the monster in the party. If no slot is specified, all monsters are leveled. (optional)
| |
| | |
| '''Examples'''
| |
| * <code>set_monster_status 5,1</code>
| |
| | |
| === set_monster_plague ===
| |
| Cure or infect a monster.
| |
| | |
| '''Parameters'''
| |
| * <code>condition</code>: inoculated, healthy or infected
| |
| * <code>slot</code>: Slot of the monster in the party. If no slot is specified, all monsters are touched by the action. (optional)
| |
| | |
| '''Examples'''
| |
| * <code>set_monster_plague infected</code>
| |
| * <code>set_monster_plague inoculated,1</code>
| |
| | |
| === set_monster_status ===
| |
| Change the status of a monster in the current player's party.
| |
| | |
| '''Parameters'''
| |
| * <code>slot</code>: Slot of the monster in the party. If no slot is specified, all monsters are modified. (optional)
| |
| * <code>status</code>: Status to set. If no status is specified, the status is cleared.
| |
| | |
| '''Examples'''
| |
| * <code>set_monster_status 1,status_blinded</code>
| |
| | |
| === set_npc_attribute ===
| |
| Set the given attribute of the npc to the given value.
| |
| | |
| '''Parameters'''
| |
| * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple").
| |
| * <code>attribute</code>: Name of the attribute.
| |
| * <code>value</code>: Value of the attribute.
| |
| | |
| '''Examples'''
| |
| * <code>set_player_attribute npc_maple,attribute,value</code>
| |
| | |
| === set_player_attribute ===
| |
| Set the given attribute of the player character to the given value.
| |
| | |
| '''Parameters'''
| |
| * <code>attribute</code>: Name of the attribute.
| |
| * <code>value</code>: Value of the attribute.
| |
| | |
| '''Examples'''
| |
| * <code>set_player_attribute attribute,value</code>
| |
| | |
| === set_player_template ===
| |
| Switch template (sprite and combat_front).
| |
| | |
| Please remember that if you change the combat_front, automatically will change the combat_back.
| |
| Eg if you set the sprite xxx, then it's going to add _back.png -> xxx_back.png
| |
| | |
| if you choose a feminine sprite, then it's advisable: heroine
| |
| if you choose a masculine sprite, then it's advisable: adventurer
| |
| | |
| '''Parameters'''
| |
| * <code>sprite</code>: must be inside mods/tuxemon/sprites, eg: adventurer_brown_back.png -> adventurer
| |
| * <code>combat_front</code>: must be inside mods/tuxemon/gfx/sprites/player, eg: adventurer.png -> adventurer (optional)
| |
| | |
| '''Examples'''
| |
| * <code>set_player_template default</code> this will set the default sprite (chosen at the beginning).
| |
| * <code>set_player_template adventurer,adventurer</code>
| |
| | |
| === set_tuxepedia ===
| |
| Set the key and value in the Tuxepedia dictionary.
| |
| | |
| '''Parameters'''
| |
| * <code>monster_slug</code>: Monster slug name (e.g. "rockitten").
| |
| * <code>string</code>: seen / caught
| |
| | |
| '''Examples'''
| |
| * <code>set_tuxepedia rockitten,caught</code>
| |
| | |
| === 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>
| |
| * <code>set_variable whatever:today</code>: whatever stores today's date (use in combination with condition <code>once</code>)
| |
| | |
| === spawn_monster ===
| |
| Breed a new monster. Add a new monster, created by breeding the two given monsters (identified by instance_id, stored in a variable) and adds it to the given character's party (identified by slug). The parents must be in either the trainer's party, or a storage box owned by the trainer.
| |
| | |
| '''Parameters'''
| |
| * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple").
| |
| | |
| '''Examples'''
| |
| * <code>spawn_monster</code>
| |
| | |
| === 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
| |
| {
| |
| "slug": "maple_girl",
| |
| "template": [
| |
| {
| |
| "sprite_name": "girl1",
| |
| "combat_front": "heroine",
| |
| "slug": "heroine"
| |
| }
| |
| ],
| |
| "monsters": [
| |
| {
| |
| "name": "Snowball",
| |
| "slug": "bamboon",
| |
| "level": 5,
| |
| "money_mod": 10,
| |
| "exp_req_mod": 27,
| |
| "gender": "male"
| |
| }
| |
| ]
| |
| }
| |
| | |
| '''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 ===
| |
| Start cinema mode by animating black bars to narrow the aspect ratio.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>start_cinema_mode</code>
| |
| | |
| === stop_cinema_mode ===
| |
| Stop cinema mode by animating black bars back to the normal aspect ratio.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>stop_cinema_mode</code>
| |
| | |
| === store_monster ===
| |
| Store a monster in a box. Save the player's monster with the given instance_id to the named storage box, removing it from the player party.
| |
| | |
| '''Parameters'''
| |
| * <code>monster_id</code>: Id of the monster to store.
| |
| * <code>box</code>: An existing box where the monster will be stored. (optional)
| |
| | |
| '''Examples'''
| |
| * <code>get_player_monster name_variable</code>
| |
| then:
| |
| * <code>store_monster name_variable</code>
| |
| or
| |
| * <code>store_monster name_variable,name_kennel</code>
| |
| | |
| === teleport_faint ===
| |
| Teleport the player to the point in the teleport_faint variable. Usually used to teleport to the last visited Tuxcenter, as when all monsters in the party faint.
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>teleport_faint</code>
| |
| | |
| === 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>
| |
| | |
| === trading ===
| |
| Select a monster in the player party and trade. It's advisable to use it with the condition <code>not has_monster monster_slug</code>.
| |
| | |
| '''Parameters'''
| |
| * <code>remove_monster</code>: Slug monster.
| |
| * <code>add_monster</code>: Slug monster.
| |
| | |
| '''Examples'''
| |
| * <code>trading rockitten,nut</code> (removes Rockitten and adds Nut)
| |
| | |
| === transfer_money ===
| |
| Performs a mathematical transaction on the player's money.
| |
| | |
| '''Parameters'''
| |
| * <code>transaction</code>: Operator symbol.
| |
| * <code>amount</code>: Amount of money.
| |
| * <code>slug</code>: Slug name (e.g. NPC, etc.) (optional)
| |
| | |
| '''Examples'''
| |
| * <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 ===
| |
| 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 ===
| |
| Print the current value of Tuxepedia to the console. If no monster is specified, print out values of all Tuxepedia.
| |
| | |
| '''Parameters'''
| |
| * <code>monster_slug</code>: Monster slug name (e.g. "rockitten").
| |
| | |
| '''Examples'''
| |
| * <code>tuxepedia_print</code>
| |
| * <code>tuxepedia_print rockitten</code>
| |
| | |
| === unlock_controls ===
| |
| Unlock player controls
| |
| | |
| '''Parameters'''
| |
| * <code>None</code>
| |
| | |
| '''Examples'''
| |
| * <code>unlock_controls</code>
| |
| | |
| === variable_math ===
| |
| Performs a mathematical operation on the key in the player.game_variables dictionary.
| |
| | |
| '''Parameters'''
| |
| * <code>variable_name</code>
| |
| * <code>operation</code>: +, -, * or /
| |
| * <code>value</code>
| |
| | |
| '''Examples'''
| |
| * <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>
| |
| | |
| === wild_encounter ===
| |
| Start an encounter with a single wild monster.
| |
| | |
| '''Parameters'''
| |
| * <code>monster_slug</code>: Monster slug, if missing, then random.
| |
| * <code>monster_level</code>: Level of the added monster.
| |
| * <code>exp_mod</code>: Experience modifier
| |
| * <code>mon_mod</code>: Money modifier
| |
| * <code>env</code>: Environment (grass default) -> [[Battle Terrain]]
| |
| | |
| '''Examples'''
| |
| * <code>wild_encounter rockitten,5</code>
| |
| * <code>wild_encounter rockitten,5,2,2,desert</code>
| |
| | |
| === withdraw_monster ===
| |
| Pull a monster from the given trainer's storage and puts it in their party.
| |
| | |
| '''Parameters'''
| |
| * <code>monster_id</code>: The id of the monster to pull (variable).
| |
| * <code>trainer</code>: Slug of the trainer that will receive the monster. It defaults to the current player.
| |
| | |
| '''Examples'''
| |
| * <code>get_player_monster name_variable</code>
| |
| then
| |
| * <code>withdraw_monster name_variable</code>
| |
| or
| |
| * <code>withdraw_monster name_variable,npc_maple</code>
| |
|
| |
|
| == Variables == | | == Variables == |
Line 1,389: |
Line 19: |
|
| |
|
| === 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,397: |
Line 24: |
| * <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). | | |
| | trainer battles: |
| | * <code>battle_last_trainer</code> slug of the last trainer fought |
| | battles PC vs NPC (eg player vs npc_maple or npc_maple vs player) |
| | * <code>battle_last_result</code>: the result can be <code>won</code> or <code>draw</code> |
| | battles NPC vs NPC (eg npc_maple vs npc_apple) or PC vs NPC (eg player vs npc_maple or npc_maple vs player) |
| | * <code>battle_last_loser</code> slug of the last trainer fought ("player" for the player) |
| | * <code>battle_last_winner</code> slug of the last trainer fought ("player" for the player) |
|
| |
|
| === Time related === | | === Time related === |
| | * <code>weekday</code> tracks the day of the week (Monday, Tuesday, etc.) |
| * <code>hour</code> tracks the hour | | * <code>hour</code> tracks the hour |
| * <code>day_of_year</code> tracks the days in a year (1 to 365/366) | | * <code>day_of_year</code> tracks the days in a year (1 to 365/366) |
Line 1,409: |
Line 44: |
|
| |
|
| === Campaign related === | | === Campaign related === |
| * <code>steps</code> the results shows the number of the steps.
| |
| * <code>gender_choice</code> the result can be <code>gender_male</code> or <code>gender_female</code>, depending on the player's choice at the beginning. Useful to create different events for gender. | | * <code>gender_choice</code> the result can be <code>gender_male</code> or <code>gender_female</code>, depending on the player's choice at the beginning. Useful to create different events for gender. |
|
| |
|
Line 1,417: |
Line 51: |
| * <code>party_level_average</code> the result shows the average level in the player's party. | | * <code>party_level_average</code> the result shows the average level in the player's party. |
|
| |
|
| === Examples ===
| | == Examples == |
|
| |
|
| ==== Battle ==== | | ==== Battle ==== |
Line 1,444: |
Line 78: |
| while if you want to grant the access only during the night: | | while if you want to grant the access only during the night: |
| * <code>is variable_set stage_of_day:night</code> | | * <code>is variable_set stage_of_day:night</code> |
| | |
| | ==== Steps Countdown ==== |
| | Let's say you want to trigger an event after 1234 steps: |
| | * <code>set_variable steps_whatever:1234</code> |
| | <code>steps_</code> followed by your variable <code>whatever</code>. |
| | * <code>is variable_is steps_whatever,equals,0.0</code>: Checking for the results, separate event. |
| | |
| | Note: you can replace <code>equals</code> with: <code>less_than</code>, <code>less_or_equal</code>, <code>greater_than</code>, <code>greater_or_equal</code>, and <code>not_equals</code>. |
|
| |
|
| ==== Trading ==== | | ==== Trading ==== |
| 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>monster2</code> (monster the NPC wants to trade in exchange) |
|
| |
|
| 1st: if the player has the monster | | 1st: if the player has the monster |
| * <code>translated_dialog dialog_npc1</code>
| | <property name="act10" value="translated_dialog dialog_npc1"/> |
| * <code>translated_dialog_choice yes:no,npc_willtrade</code>
| | <property name="act20" value="translated_dialog_choice yes:no,npc_willtrade"/> |
| * <code>talk npc_slug</code>
| | <property name="behav10" value="talk npc_slug"/> |
| * <code>is has_monster monster1</code>
| | <property name="cond10" value="is has_monster player,monster1"/> |
| * <code>not variable_set npc_hastraded:yes</code>
| | <property name="cond20" value="not variable_set npc_hastraded:yes"/> |
| 2nd: if the player hasn't the monster | | 2nd: if the player hasn't the monster |
| * <code>translated_dialog dialog_npc1</code>
| | <property name="act10" value="translated_dialog dialog_npc1"/> |
| * <code>translated_dialog dialog_npc_nomonster1</code>
| | <property name="act20" value="translated_dialog dialog_npc_nomonster1"/> |
| * <code>talk npc_slug</code>
| | <property name="behav10" value="talk npc_slug"/> |
| * <code>not has_monster monster1</code>
| | <property name="cond10" value="not has_monster player,monster1"/> |
| * <code>not variable_set npc_hastraded:yes</code>
| | <property name="cond20" value="not variable_set npc_hastraded:yes"/> |
| 3rd: trading part | | 3rd: trading part |
| * <code>translated_dialog dialog_npc_willtrade</code>
| | <property name="act10" value="translated_dialog dialog_npc_willtrade"/> |
| * <code>trading monster1,monster2</code>
| | <property name="act20" value="get_player_monster name_variable"/> |
| * <code>set_variable npc_hastraded:yes</code>
| | <property name="act30" value="trading name_variable,traded_monster"/> |
| * <code>is has_monster monster1</code>
| | <property name="act40" value="set_variable npc_hastraded:yes"/> |
| * <code>is variable_set npc_willtrade</code>
| | <property name="cond10" value="is has_monster player,monster1"/> |
| * <code>not variable_set npc_hastraded</code>
| | <property name="cond20" value="is variable_set npc_willtrade"/> |
| | <property name="cond30" value="not variable_set npc_hastraded"/> |
|
| |
|
| ==== 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>
| | <property name="act10" value="add_monster rockitten,20,npc_slug,27,10"/> |
| * <code>add_monster vivipere,20,npc_slug,27,10</code>
| | <property name="act20" value="add_monster vivipere,20,npc_slug,27,10"/> |
| * <code>add_monster budaye,20,npc_slug,27,10</code>
| | <property name="act30" value="add_monster budaye,20,npc_slug,27,10"/> |
| * <code>add_monster rockitten,20,npc_slug,27,10</code>
| | <property name="act40" value="add_monster rockitten,20,npc_slug,27,10"/> |
| * <code>add_monster nut,20,npc_slug,27,10</code>
| | <property name="act50" value="add_monster nut,20,npc_slug,27,10"/> |
| * <code>get_party_monster npc_slug</code>
| | <property name="act60" value="get_party_monster npc_slug"/> |
| * <code>add_tech iid_slot_3,canine,,,,npc_slug</code> here <code>iid_slot_3</code> followed by [[Canine]]
| | <property name="act70" value="add_tech iid_slot_3,canine"/> ---> iid_slot_3 followed by [[Canine]] |
| * <code>start_battle npc_slug</code>
| | <property name="act80" value="start_battle player,npc_slug"/> |
| | |
| | ==== Battle Among NPCs (the player watches without interacting) ==== |
| | (eg npc_maple vs npc_apple) |
| | |
| | <property name="act10" value="create_npc npc_maple,0,7,stand"/> |
| | <property name="act20" value="create_npc npc_apple,0,8,stand"/> |
| | <property name="act30" value="add_monster chloragon,3,npc_maple"/> |
| | <property name="act40" value="add_monster rockitten,3,npc_apple"/> |
| | <property name="act50" value="start_battle npc_maple,npc_apple"/> |
| | separate event, multiple endings, if npc_maple wins |
| | <property name="cond1" value="is variable_set battle_last_winner:npc_maple"/> |
| | separate event, multiple endings, if npc_apple wins |
| | <property name="cond1" value="not variable_set battle_last_winner:npc_maple"/> |
| | separate event, multiple endings, if no-one wins |
| | <property name="cond1" value="is variable_set battle_last_result:draw"/> |