Event Reference Action

From Tuxepedia
Jump to navigation Jump to search

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[edit | edit source]

Adds a collision defined by a specific label. With numbers, it blocks a specific tile.

Parameters

  • label: Name of the obstacle.
  • coord: Coordinates map (single coordinate). (optional)

Examples

  • add_collision obstacle,6,8
  • add_collision wall (in this case must exist a collision zone in the .tmx file)

add_contacts[edit | edit source]

Add contact to the app (Nu Phone). The slug must have the msgid inside the PO.

Parameters

  • slug: slug name (e.g. "npc_maple").
  • phone_number: 3 digits

Examples

  • add_contacts npc_maple,123

add_item[edit | edit source]

Add the specified item to the player's inventory.

Parameters

  • item_name: Monster slug to look up in the monster database or name variable where it's stored the mon_slug.
  • quantity: Quantity of the item to add or to reduce. By default it is 1. (optional)
  • trainer_slug: Slug of the trainer that will receive the item. It defaults to the current player. (optional)

Examples

  • add_item hatchet
  • add_item hatchet,2
  • add_item hatchet,2,npc_maple

add_monster[edit | edit source]

Add the specified monster to the player's party.

Parameters

  • monster_slug: Monster slug to look up in the monster database.
  • monster_level: Level of the added monster.
  • trainer_slug: Slug of the trainer that will receive the monster. It defaults to the current player. (optional)
  • exp_mod: Experience modifier. (optional)
  • money_mod: Money modifier. (optional)

Examples

  • add_monster fruitera,10
  • add_monster fruitera,10,npc_maple,10,27

add_tech[edit | edit source]

Adds a tech to a specific monster.

Parameters

  • variable: Name of the variable where to store the monster id.
  • technique: Slug of the technique (e.g. "bullet").
  • power: Power between 0.0 and 3.0. (optional)
  • potency: Potency between 0.0 and 1.0. (optional)
  • accuracy: Accuracy between 0.0 and 1.0. (optional)

Examples

  • get_player_monster name_variable
  • add_tech name_variable,bullet

breeding[edit | edit source]

Select a monster in the player party filtered by gender and store its id in a variables (breeding_father or breeding_mother)

Parameters

  • gender: Gender (male or female).

Examples

  • breeding male
  • breeding female

call_event[edit | edit source]

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

Parameters

  • event_name: The name of the event whose actions should be executed.

Examples

  • call_event name_event

camera[edit | edit source]

Centers the camera on a specified NPC or the original entity.

Parameters

  • npc_slug: The slug of the character to center the camera on. Defaults to None, which centers the camera on the original entity.

Examples

  • camera npc_slug
  • camera

camera_position[edit | edit source]

Move the camera on a coordinate.

Parameters

  • x,y: the coordinates where the camera needs to be centered.
  • mode: the camera mode, either "fixed" or "free_roaming", default "fixed"

Examples

  • camera_position 6,9
  • camera_position 6,9,free_roaming

change_bg[edit | edit source]

Change the background.

Parameters

  • background:
  • it can be the name of the file (see below note)
  • it can be a RGB color separated by ":" (eg 255:0:0)
  • image: 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

  • change_bg gradient_blue,rockitten
  • change_bg gradient_blue,ceo
  • change_bg gradient_blue
  • change_bg (stop)

change_taste[edit | edit source]

hanges tastes monster.

Parameters

  • variable: Name of the variable where to store the monster id.
  • taste: Warm or cold.

Examples

  • change_taste name_variable,warm

change_state[edit | edit source]

Change to the specified state.

Parameters

  • state_name: The state name to switch to (e.g. PCState).
  • optional: Variable related to specific states (e.g. variable with monster_id for MonsterInfo, monster slug for JournalInfoState and character slug for CharacterState). (Optional)

Examples

  • change_state PCState
  • change_state JournalInfoState,rockitten

char_face[edit | edit source]

Make the character face a certain direction.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • direction: Direction to make the character's face. Can be set to: left, right, up, or down.

Examples

  • char_face player,down
  • char_face npc_maple,right

char_look[edit | edit source]

Make a character look around.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • frequency: 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.
  • directions: the direction the npc is going to look, by default all. (optional)

Examples

  • char_look character
  • char_look character,,right:left

char_move[edit | edit source]

Relative tile movement for character.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").

Examples

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

char_plague[edit | edit source]

Set the entire party as infected or inoculated or healthy.

Parameters

  • plague_slug: The slug of the plague to target.
  • condition: Infected, inoculated, or None (removes the plague from the character, indicating a healthy state). (optional)
  • character: Either "player" or npc slug name (e.g. "npc_maple"). (optional)

Examples

  • char_plague plague_slug,infected,npc_maple

char_position[edit | edit source]

Set the position of a character.

Parameters

  • character: Either "player" or character slug name (e.g. "npc_maple").
  • tile_pos_x: X position to set the character to.
  • tile_pos_y: Y position to set the character to.

Examples

  • char_position npc_maple,6,9

char_run[edit | edit source]

Set the character movement speed to the global run speed.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").

Examples

  • char_run npc_mom

char_speed[edit | edit source]

Set the character movement speed to a custom value.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • speed: Speed amount.

Examples

  • char_speed npc_mom,0.2

char_stop[edit | edit source]

Make the character stop moving.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").

Examples

  • char_stop npc_mom

char_walk[edit | edit source]

Set the character movement speed to the global walk speed.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").

Examples

  • char_walk npc_mom

char_wander[edit | edit source]

Make a character wander around the map.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • frequency: 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.
  • t_bound: Coordinates top_bound vertex (e.g. 5,7)
  • b_bound: Coordinates bottom_bound vertex (e.g. 7,9)

Examples

  • char_wander npc_maple
  • char_wander npc_maple,,5,7,7,9

choice_item[edit | edit source]

Ask the player to make a choice among items.

Parameters

  • choices: List of possible choices (item slugs eg: potion:tea), separated by a colon ":".
  • variable: Variable to store the result of the choice.

Examples

  • choice_monster potion:tea,name_variable

choice_monster[edit | edit source]

Ask the player to make a choice among monsters.

Parameters

  • choices: List of possible choices (monster slugs eg: rockitten:apeoro), separated by a colon ":".
  • variable: Variable to store the result of the choice.

Examples

  • choice_monster apeoro:rockitten,name_variable

choice_npc[edit | edit source]

Ask the player to make a choice among NPCs.

Parameters

  • choices: List of possible choices (npc slugs eg: maple:billie), separated by a colon ":".
  • variable: Variable to store the result of the choice.

Examples

  • choice_monster billie:maple,name_variable

clear_kennel[edit | edit source]

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

  • kennel: The kennel to clear.
  • transfer: The kennel to transfer the monsters. (optional)

Examples

  • clear_kennel name_kennel, new_kennel

clear_tuxepedia[edit | edit source]

Clear the key and value in the Tuxepedia dictionary.

Parameters

  • monster_slug: Monster slug name (e.g. "rockitten").

Examples

  • clear_tuxepedia rockitten

clear_variable[edit | edit source]

Clear the value of a variable from the game.

Parameters

  • variable: The variable to clear.

Examples

  • clear_variable name_variable

copy_variable[edit | edit source]

Copy the value of var2 into var1 (e.g. var1 = var 2).

Parameters

  • var1: The variable to copy to.
  • var2: The variable to copy from.

Examples

  • copy_variable new_variable,old_variable

create_kennel[edit | edit source]

Creates a new kennel. It's advisable to create a msgid in the en_US PO file.

msgid "kennel_name" msgstr "Kennel Name"

Parameters

  • kennel: Name of the kennel.

Examples

  • create_kennel new_kennel

create_npc[edit | edit source]

Creates an NPC and places them on the current map.

Parameters

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

Examples

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

delayed_teleport[edit | edit source]

Set teleport information. Teleport will be triggered during screen transition. Only use this if followed by a transition.

Parameters

  • map_name: Name of the map to teleport to.
  • position_x: X position to teleport to.
  • position_y: Y position to teleport to.

Examples

  • delayed_teleport cotton_town,10,10

evolution[edit | edit source]

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 is/not check_evolution player

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters get experience.
  • evolution: Slug of the evolution.

Examples

  • evolution player
  • evolution player,name_variable,rockat

fadeout_music[edit | edit source]

Fades out music over x milliseconds.

Parameters

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

Examples

  • fadeout_music 2

format_variable[edit | edit source]

Format the value of a variable from the game (eg. float or int).

Parameters

  • variable: The variable to format.
  • type_format: Kind of format (float or int).

Examples

  • format_variable name_variable,int
  • format_variable name_variable,float

get_monster_tech[edit | edit source]

Select a tech among the monster's moves. It allows filtering: slug, element, range.

Parameters

  • variable_name: Variable where to store the technique id.
  • monster_id: Variable where is stored the monster id.
  • filter_name: the name of the first filter (optional)
  • value_name: the actual value to filter (optional)
  • extra: used to filter more (optional)

Examples

  • get_monster_tech name_variable,monster_id
  • get_monster_tech name_variable,monster_id,element,water
  • get_monster_tech name_variable,monster_id,power,less_than,1.6

get_party_monster[edit | edit source]

Saves all the iids (party) in variables. Names are saved in game variables: iid_slot_{index}. Where index is the position in the party (the 1st one is 0, 2nd one is 1, etc.)

Parameters

  • npc_slug: npc slug name (e.g. "npc_maple") - if absent default "player" (optional)

Examples

  • get_party_monster
  • get_party_monster npc_maple

get_player_monster[edit | edit source]

Select a monster in the player party and store its id in a variable.

It allows filtering: slug, gender, evolution_stage, element, shape, taste_warm, taste_cold, level, weight, height, max_hp, current_hp, armour, dodge, melee, ranged and speed.

For the definition: level, weight, height, max_hp, current_hp, armour, dodge, melee, ranged and speed (all numeric values) is necessary to use a numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".

Note:

  • let's say a player doesn't has no options, then the variable will result as: name_variable:no_option
  • let's say a player has options, but clicks return, then the variable will result as: name_variable:no_choice

Parameters

  • variable_name: Name of the variable where to store the monster id.
  • filter_name: the name of the first filter (optional)
  • value_name: the actual value to filter (optional)
  • extra: used to filter more (optional)

Examples

  • get_player_monster name_variable
  • get_player_monster name_variable,speed,more_than,50
  • get_player_monster name_variable,level,less_than,15
  • get_player_monster name_variable,shape,serpent
  • get_player_monster name_variable,shape,serpent

give_experience[edit | edit source]

Gives experience points to the monster.

Parameters

  • variable: Name of the variable where to store the monster id.
  • exp: Name of the variable where to store the experience points or directly the number of points. Negative value will result in 0.

Examples

  • give_experience name_variable,steps_variable"
  • give_experience name_variable,420

info[edit | edit source]

Records monster's attribute values inside a game variable. It allows to record the monster's owner attribute values too.

Parameters

  • variable: Name of the variable where to store the monster id.
  • attribute: The attribute to check (level, speed, etc.).

Examples

  • info name_variable,level -> if the monster is lv 4, then it'll create a variable called: "info_level:4"
  • info name_variable,owner_steps -> if the owner walked 69 steps, then it'll create a variable called: "info_owner_steps:69"

input_variable[edit | edit source]

Set a code and checks if it's correct or not. The player's output will be by default lowercase.

Parameters

  • question: 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?"
  • variable: Name of the variable where to store the output.
  • escape: Whether the input can be closed or not. Default False.

Examples

  • input_variable access_code,response_question
  • input_variable access_code,response_question,escape

load_game[edit | edit source]

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)

Parameters

  • index: Selected index. (optional)

Examples

  • load_game (it's going to load slot4.save)
  • load_game 0 (it's going to load slot1.save)

lock_controls[edit | edit source]

Lock player controls.

Parameters

  • None

Examples

  • lock_controls

menu[edit | edit source]

Enable/disable one or more menu.

Parameters

  • act: enable or disable
  • menu: specific menu (menu_monster, menu_bag, menu_player, exit, menu_options, menu_save, menu_load, menu_missions) without specification, everything disabled

Examples

  • menu disable,menu_bag

modify_char_attribute[edit | edit source]

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

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • attribute: Name of the attribute to modify.
  • value: Value of the attribute modifier.

Examples

  • modify_char_attribute character,attribute,value

modify_money[edit | edit source]

Add or remove an amount of money for a wallet (slug).

Parameters

  • slug: Slug name (e.g. player or NPC, etc.).
  • amount: Amount of money to add/remove (-/+)
  • variable: Name of the variable where to store the amount.

Examples

  • modify_money npc_maple,100
  • modify_money npc_maple,-50
  • modify_money player,,name_variable

modify_monster_bond[edit | edit source]

Add or remove an amount of money for a wallet (slug).

Parameters

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters are touched.
  • amount: An int or float value, if no amount, then default 1 (int).

Examples

  • modify_monster_bond
  • modify_monster_bond name_variable,25
  • modify_monster_bond name_variable,-0.5

modify_monster_health[edit | edit source]

Modify the hp of a monster in the current player's party.

Parameters

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters are healed.
  • health: A float value between 0 and 1, which is the percent of max hp to be restored to. A int value, which is the number of HP to be restored to. If no health is specified, the hp is maxed out.

Examples

  • modify_monster_health
  • modify_monster_health ,0.25


modify_monster_stats[edit | edit source]

Change the stats of a monster in the current player's party.

Parameters

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters are touched. (Optional)
  • stat: A stat among armour, dodge, hp, melee, speed and ranged. If no stat, then all the stats. (Optional)
  • amount: A/an float/int value, if no amount, then default 1 (+). (Optional)

Examples

  • modify_monster_stats
  • modify_monster_stats ,,0.25
  • modify_monster_stats name_variable,speed,25
  • modify_monster_stats name_variable,dodge,-12
  • modify_monster_stats name_variable,dodge,-0.4

open_shop[edit | edit source]

Open the shop menu for a NPC.

Parameters

  • npc_slug: Either "player" or npc slug name (e.g. "npc_maple").
  • menu: Either "buy", "sell" or "both". Default is "both". (optional)

Examples

  • open_shop npc_maple

overwrite_tech[edit | edit source]

Overwrite / replace a technique with another.

Parameters

  • removed: Name of the variable where to store the tech id.
  • added: Slug technique.

Examples

  • overwrite_tech name_variable,peck

pathfind[edit | edit source]

Moves an NPC to a certain tile on the map.

Parameters

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

Examples

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

pathfind_to_player[edit | edit source]

Pathfind NPC close the player.

Parameters

  • npc_slug: Npc slug name (e.g. "npc_maple").
  • direction: Approaches the player from up, down, left or right.
  • distance: How many tiles (2, 3, 4, etc.)

Examples

  • pathfind_to_player spyder_route2_roddick
  • translated_dialog spyder_route2_roddick1
  • start_battle player,spyder_route2_roddick

pause_music[edit | edit source]

Pauses the currently playing music.

Parameters

  • None

Examples

  • pause_music

play_map_animation[edit | edit source]

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

Parameters

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

Examples

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

play_music[edit | edit source]

Plays an audio file.

Parameters

  • filename: The name of the music file to play.
  • volume: A value between 0.0 and 1.0 that adjusts the music volume. (optional)
  • loop: The number of times to loop the music. Default is to loop forever. (optional)
  • fade_ms: The time in milliseconds to fade in the music before reaching maximum volume. (optional)

Examples

  • play_music music_mystic_island

play_sound[edit | edit source]

Plays a sound file.

Parameters

  • filename: Sound file to load (slug inside the JSON in db/sound)
  • volume: Number between 0.0 and 1.0. (optional)

Examples

  • play_sound sound_confirm

print[edit | edit source]

Print the current value of a game variable to the console. If no variable is specified, print out values of all game variables.

Parameters

  • variable: Prints out the value of this variable (optional)

Examples

  • print
  • print name_variable

quarantine[edit | edit source]

Quarantine or release monsters infected with a specific plague.

Parameters

  • plague_slug: The slug of the plague to target.
  • value: "in" to quarantine infected monsters, "out" to release them.
  • amount: (Optional, only for "out") The number of monsters to release randomly.

Examples

  • quarantine plague_slug,out everything out (player's party -> if full, then box)
  • quarantine plague_slug,out,5 eg. box contains 30 monsters quarantine out,5, it means 5 monsters by random

quit[edit | edit source]

Completely quit the game.

Parameters

  • None

Examples

  • quit

random_battle[edit | edit source]

Start random battle with a random npc with a determined number of monster in a certain range of levels.

Parameters

  • nr_txmns: Number of tuxemon (1 to 6).
  • min_level: Minimum level of the party.
  • max_level: Maximum level of the party.

Examples

  • random_battle 6,1,99

random_encounter[edit | edit source]

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

Here is an example encounter file: resources/db/encounter/route1.json

 "slug": "route1",
 "monsters": [
   {
     "monster": "pairagrin",
     "encounter_rate": 3.5,
     "variable": "daytime:true",
     "exp_req_mod": 1,
     "level_range": [
       2,
       4
     ]
   },

Parameters

  • encounter_slug: Slug of the encounter list.
  • total_prob: Total sum of the probabilities. (optional)
  • rgb: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional)

Examples

  • random_encounter route1
  • random_encounter route1,20

random_integer[edit | edit source]

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

  • variable: Name of the variable.
  • lower_bound: Lower bound of range to return an integer between (inclusive)
  • upper_bound: Upper bound of range to return an integer between (inclusive)

Examples

  • random_integer name_variable,1,9

random_item[edit | edit source]

Pick a random item from a list and add it to the trainer's inventory.

Parameters

  • item_slug: Item name to look up in the item database (multiple items separated by ":").
  • quantity: Quantity of the item to add or to reduce. By default it is 1. (optional)
  • trainer_slug: Slug of the trainer that will receive the item. It defaults to the current player. (optional)

Examples

  • random_item potion:tea:revive (adds 1 potion or tea or revive to the trainer's inventory).
  • random_item potion:tea:revive,2 (adds 2 potions or teas or revives to the trainer's inventory).
  • random_item potion:tea:revive,2,npc_maple (adds 2 potions or teas or revives to the maple's inventory).
  • random_item potion:tea:revive,,npc_maple (adds 1 potion or tea or revive to the maple's inventory).

random_monster[edit | edit source]

Add a monster to the specified trainer's party if there is room.

Parameters

  • monster_level: Level of the added monster.
  • trainer_slug: Slug of the trainer that will receive the monster. It defaults to the current player. (optional)
  • exp_mod: Experience modifier. (optional)
  • money_mod: Money modifier. (optional)
  • shape: Shape (eg. varmint, brute, etc.). (optional)
  • evo: Stage (eg. basic, stage1, etc.). (optional)

Examples

  • random_monster 10
  • random_monster 10,npc_maple
  • random_monster 10,npc_maple,10,27
  • random_monster 10,npc_maple,10,27,aquatic,basic
  • random_monster 10,npc_maple,,,brute,basic

remove_collision[edit | edit source]

Removes a collision defined by a specific label.

Parameters

  • label: Name of the obstacle.

Examples

  • remove_collision obstacle (it can one added with add_collision or an existing zone in the .tmx file).

remove_contacts[edit | edit source]

Remove contact from the app (Nu Phone).

Parameters

  • slug: slug name (e.g. "npc_maple").

Examples

  • remove_contacts npc_maple

remove_monster[edit | edit source]

Remove a monster from the party if the monster is there.

Parameters

  • variable: Name of the variable where to store the monster id.

Examples

  • get_player_monster name_variable
  • remove_monster name_variable

remove_npc[edit | edit source]

Removes an NPC from the current map.

Parameters

  • name: The name of the NPC to remove.

Examples

  • remove_npc Maple
  • remove_npc Pine

remove_state[edit | edit source]

Change to the specified state.

Parameters

  • state_name: The state name to switch to (e.g. PCState).
  • optional: Variable related to specific states (eg slug for JournalInfoState).

Examples

  • remove_state (it removes everything, excluding the basic ones)
  • remove_state JournalInfoState (it removes everything, excluding the basic ones)

remove_tech[edit | edit source]

Remove a specific technique from a specific monster.

Parameters

  • tech_id: Name of the variable where to store the tech id.

Examples

  • remove_tech name_variable

rename_monster[edit | edit source]

Open the text input screen to rename the monster.

Parameters

  • variable: Name of the variable where to store the monster id.

Examples

  • rename_monster name_variable

rename_player[edit | edit source]

Open the text input screen to rename the player.

Parameters

  • None

Examples

  • rename_player

rumble[edit | edit source]

Rumble available controllers with rumble support.

Parameters

  • duration: Time in seconds to rumble for.
  • power: Percentage of power to rumble.

Examples

  • rumble duration,power

save_game[edit | edit source]

Saves the game. If the index parameter is absent, then it'll create slot4.save (index = 0 > slot 1, index = 1 > slot 2, index = 2 > slot 3)

Parameters

  • index: Selected index. (optional)

Examples

  • save_game (it's going to save slot4.save)
  • save_game 1 (it's going to save slot2.save)

screen_transition[edit | edit source]

Fades the screen to black and back over x seconds.

Parameters

  • trans_time: Time in seconds - default 0.3 (optional).
  • rgb: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional)

Examples

  • screen_transition 2

set_battle[edit | edit source]

Append a new element in player.battles.

Parameters

  • fighter: Npc slug name (e.g. "npc_maple").
  • result: One among "won", "lost" or "draw"
  • opponent: Npc slug name (e.g. "npc_maple").

Examples

  • set_battle player,won,npc_maple (player won against npc_maple)

set_bubble[edit | edit source]

Put a bubble above player sprite.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • bubble: dots, drop, exclamation, heart, note, question, sleep, angry, confused, fireworks

Examples

  • set_bubble spyder_shopassistant (remove bubble NPC)
  • set_bubble spyder_shopassistant,note (set bubble NPC)
  • set_bubble player,note (set bubble player)
  • set_bubble player (remove bubble player)

set_economy[edit | edit source]

Set the economy (prices of items) of the npc or player.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • economy_slug: Slug of an economy.

Examples

  • set_economy spyder_shopkeeper,spyder_candy_scoop

set_kennel_visible[edit | edit source]

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

  • kennel: Name of the kennel.
  • visible: true/false.

Examples

  • set_kennel_visible name_kennel,true
  • set_kennel_visible name_kennel,false

set_layer[edit | edit source]

Allows to change the color of the transparent layer.

Parameters

  • rgb: color (eg red > 255,0,0,128 > 255:0:0:128) - default transparent

Examples

  • set_layer 255:0:0:128

set_mission[edit | edit source]

Set mission.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • slug: slug mission
  • operation: add, remove or change
  • status: completed, pending, failed (default pending)

Examples

  • set_mission mission1
  • set_mission mission1,change,completed

set_money[edit | edit source]

Set an amount of money for a specific slug.

Parameters

  • slug: Slug name (e.g. player or NPC, etc.).
  • amount: Amount of money (>= 0) (default 0)

Examples

  • set_money player
  • set_money player,500

set_monster_attribute[edit | edit source]

Set the given attribute of the monster to the given value.

Parameters

  • variable: Name of the variable where to store the monster id.
  • attribute: Name of the attribute.
  • value: Value of the attribute.

Examples

  • set_monster_attribute name_variable,name,jimmy (the monster will be named jimmy)

set_monster_flair[edit | edit source]

Set a monster's flair to the given value.

Parameters

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters are changed.
  • category: Category of the monster flair.
  • flair: Name of the monster flair.

Examples

  • get_player_monster name_variable
  • set_monster_flair name_variable,category,flair

set_monster_health[edit | edit source]

Set 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

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters are healed. (optional)
  • health: A float value between 0 and 1, which is the percent of max hp to be restored to. A int value, which is the number of HP to be restored to. If no health is specified, the hp is maxed out. (optional)

Examples

  • set_monster_health (heals all the monsters in the party)

or

  • get_player_monster name_variable
  • set_monster_health name_variable,1

set_monster_level[edit | edit source]

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

Parameters

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters are changed. (optional)
  • levels_added: Number of levels to add. Negative numbers are allowed. Default 1. (optional)

Examples

  • set_monster_level (all the monsters in the party level up by 1)

or

  • get_player_monster name_variable
  • set_monster_level name_variable,1

set_monster_plague[edit | edit source]

Set a monster's plague to the given condition. To get the mechanics going, it's crucial to know that must be a technique called 'plague_slug' (eg. spyderbite).

Parameters

  • variable: Name of the variable where to store the monster id.
  • plague_slug: The slug of the plague to target.
  • condition: Infected, inoculated, or None (removes the plague from the character, indicating a healthy state). (optional)

Examples

  • get_player_monster name_variable
  • set_monster_plague name_variable,spyderbite,infected

set_monster_status[edit | edit source]

Change the status of a monster in the current player's party.

Parameters

  • variable: Name of the variable where to store the monster id. If no variable is specified, all monsters get/lose status.. (optional)
  • status: Inoculated, healthy or infected, default healthy (optional)

Examples

  • set_monster_status (all the monsters in the party lose their status)

or

  • get_player_monster name_variable
  • set_monster_status name_variable,status_blinded

set_char_attribute[edit | edit source]

Set the given attribute of the character to the given value.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • attribute: Name of the attribute.
  • value: Value of the attribute.

Examples

  • set_char_attribute character,attribute,value

set_party_attribute[edit | edit source]

Set the given attribute of party's monsters to the given value.

Parameters

  • character: Either "player" or character slug name (e.g. "npc_maple").
  • attribute: Name of the attribute.
  • value: Value of the attribute.

Examples

  • set_party_attribute player,name,jimmy (all the monsters in the party will be named jimmy)

set_party_status[edit | edit source]

Records important information about all monsters in the party (eg average level of the party, etc.)

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").

Examples

  • set_party_status player

set_player_name[edit | edit source]

Set player name without opening the input screen.

Parameters

  • choice: Single name or multiple names separated by ":" (random choice). NB: the names must be in the en_US PO file.

Examples

  • set_player_name jimmy
  • set_player_name jimmy:richard:linus (random choice among jimmy, richard and linus)

set_random_variable[edit | edit source]

Set the key in the player.game_variables dictionary with a random value.

Parameters

  • variable: Name of the variable.
  • values: Multiple values of the variable separated with ":".

Examples

  • set_random_variable alpha,one:two:three (variable "alpha" can be "alpha:one" or "alpha:two" or "alpha:three").

set_template[edit | edit source]

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

By using default: set_template player,default it's going to reassign the default sprite

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • sprite: must be inside mods/tuxemon/sprites, eg: adventurer_brown_back.png -> adventurer
  • combat_front: must be inside mods/tuxemon/gfx/sprites/player, eg: adventurer.png -> adventurer (optional)

Examples

  • set_template player,adventurer,adventurer

set_tuxepedia[edit | edit source]

Set the key and value in the Tuxepedia dictionary.

Parameters

  • character: Either "player" or npc slug name (e.g. "npc_maple").
  • monster_slug: Monster slug name (e.g. "rockitten").
  • label: seen / caught

Examples

  • set_tuxepedia player,rockitten,caught

set_variable[edit | edit source]

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

Also used to set the environment.

Parameters

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

Examples

  • set_variable battle_won:yes
  • set_variable talked_to_prof:true
  • set_variable environment:grass
  • set_variable whatever:today: whatever stores today's date (use in combination with condition once)

spawn_monster[edit | edit source]

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

  • character: Either "player" or npc slug name (e.g. "npc_maple"). The one who is going to receive the new born.

Examples

  • spawn_monster

start_battle[edit | edit source]

Start a battle between two characters and switch to the combat module.

Parameters

  • character1: Either "player" or character slug name (e.g. "npc_maple").
  • character2: Either "player" or character slug name (e.g. "npc_maple").

Examples

  • start_battle player,npc_maple
  • start_battle npc_maple,npc_apple

start_cinema_mode[edit | edit source]

Start cinema mode by animating black bars to narrow the aspect ratio. For a cinematic experience, specify the width of the horizontal and vertical black bars as a ratio of the screen resolution. For example, to achieve a 2.39:1 aspect ratio on a 1920x1080 screen, you would set the horizontal ratio to 0.42 (1920 / 1080 * (16/9 - 2.39/1)) and the vertical ratio to 0 (no vertical bars). By default only bar up and down.

Parameters

  • aspect_y_ratio: The width of the horizontal black bars as a ratio of the screen resolution. Default standard cinema mode.
  • aspect_x_ratio: The width of the vertical black bars as a ratio of the screen resolution. Default None.

Examples

  • start_cinema_mode default, bar up and down
  • start_cinema_mode ,2.0 bar left and right
  • start_cinema_mode 2.0 bar up and down
  • start_cinema_mode 2.0,2.0 bar up, down, left and right


stop_cinema_mode[edit | edit source]

Stop cinema mode by animating black bars back to the normal aspect ratio.

Parameters

  • None

Examples

  • stop_cinema_mode

store_monster[edit | edit source]

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

  • variable: Name of the variable where to store the monster id.
  • box: An existing box where the monster will be stored. (optional)

Examples

  • get_player_monster name_variable

then:

  • store_monster name_variable

or

  • store_monster name_variable,name_kennel

teleport_faint[edit | edit source]

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

  • trans_time: Transition time in seconds - default 0.3.

Examples

  • teleport_faint
  • teleport_faint 6.9

teleport[edit | edit source]

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

Parameters

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

Examples

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

trading[edit | edit source]

Select a monster in the player party and trade. It's advisable to use it with the condition not has_monster monster_slug.

Parameters

  • variable: Name of the variable where to store the monster id (removed).
  • added: Slug monster or Name of the variable where to store the monster id (added).

Examples

  • get_player_monster name_variable

then

  • trading name_variable,nut

transfer_money[edit | edit source]

Transfer money between entities. Both entities needs to have a wallet.

Parameters

  • slug1: Slug name (e.g. NPC, etc.)
  • amount: Amount of money.
  • slug2: Slug name (e.g. NPC, etc.)

Examples

  • transfer_money player,100,npc_mom (player transfers 100 to mom)

transition_teleport[edit | edit source]

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

Parameters

  • map_name: The map file to teleport the player to.
  • x: The X-tile coordinate to teleport the player to.
  • y: The Y-tile coordinate to teleport the player to.
  • trans_time: The time in seconds - default 2. (optional)
  • rgb: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional)

Examples

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

translated_dialog_choice[edit | edit source]

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

Parameters

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

Examples

  • translated_dialog_choice yes:no,myvariable

translated_dialog[edit | edit source]

Open a dialog window with translated text according to the passed translation key. Parameters passed to the translation string will also be checked if a translation key exists.

Parameters

  • text: The msgid in the PO file.
  • avatar: If it is a number, the monster is the corresponding monster slot in the player's party. If it is a string, we're referring to a monster by name.
  • style: a predefined style in db/dialogue/dialogue.json

Examples

  • translated_dialog msgid

unlock_controls[edit | edit source]

Unlock player controls

Parameters

  • None

Examples

  • unlock_controls

unpause_music[edit | edit source]

Unpause the current (paused) music playback.

Parameters

  • None

Examples

  • pause_music

update_tile_properties[edit | edit source]

Update tile properties. Enable movement and/or the moverate. moverate 0 = not accessible. The surface keys supported are: surfable, walkable and climbable.

Parameters

  • label: Name of the property
  • moverate: Value of the moverate (eg 1 equal moverate, default 1)

Examples

  • update_tile_properties surfable,0.5

variable_math[edit | edit source]

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

Parameters

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

Examples

  • variable_math badge_count,+,1

wait[edit | edit source]

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

Parameters

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

Examples

  • wait 2.0
  • wait 5.2

wild_encounter[edit | edit source]

Start an encounter with a single wild monster.

Parameters

  • monster_slug: Monster slug.
  • monster_level: Level of monster.
  • exp_mod: Experience modifier. (optional)
  • mon_mod: Money modifier. (optional)
  • env: Environment (grass default) -> Battle Terrain (optional)
  • rgb: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional)

Examples

  • wild_encounter rockitten,5
  • wild_encounter rockitten,5,2,2,desert

withdraw_monster[edit | edit source]

Pull a monster from the given trainer's storage and puts it in their party.

Parameters

  • variable: Name of the variable where to store the monster id.
  • character: Either "player" or npc slug name (e.g. "npc_maple"). The one who is going to receive the monster.

Examples

  • get_player_monster name_variable

then

  • withdraw_monster name_variable

or

  • withdraw_monster name_variable,npc_maple