Editing Event Reference
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 134: | Line 134: | ||
'''Examples''' | '''Examples''' | ||
* <code>is check_evolution player</code> | * <code>is check_evolution player</code> | ||
=== check_mission === | === check_mission === | ||
Line 158: | Line 148: | ||
* <code>is check_mission player,mission1:mission2,completed</code> | * <code>is check_mission player,mission1:mission2,completed</code> | ||
* <code>is check_mission player,all,completed</code> | * <code>is check_mission player,all,completed</code> | ||
=== current_state === | === current_state === | ||
Line 245: | Line 207: | ||
=== has_party_breeder === | === has_party_breeder === | ||
Check to see if the | Check to see if the player has a male and female monster in the party (monster not basic, basic is the first step in the evolution stage). | ||
'''Examples''' | '''Examples''' | ||
* <code>is has_party_breeder | * <code>is has_party_breeder</code> | ||
=== has_tech === | === has_tech === | ||
Line 293: | Line 252: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>operator</code>: | * <code>operator</code>: One of "==", "!=", ">", ">=", "<" or "<=". | ||
* <code>amount</code>: Amount of money | * <code>amount</code>: Amount of money. | ||
'''Examples''' | '''Examples''' | ||
* <code>is money_is player,>=,500</code> | * <code>is money_is player,>=,500</code> | ||
=== monster_flair === | === monster_flair === | ||
Line 311: | Line 269: | ||
* <code>to be defined</code> | * <code>to be defined</code> | ||
=== music_playing === | === monster_property === | ||
Check to see if the specified music file is currently playing. | 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''' | '''Parameters''' | ||
Line 344: | Line 315: | ||
=== party_infected === | === party_infected === | ||
Check to see how many monster are infected | Check to see how many monster are infected and stores the iids. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>value</code>: all, some or none. | * <code>value</code>: all, some or none. | ||
Line 354: | Line 324: | ||
=== party_size === | === party_size === | ||
Perform a check on the player's party size. The <code>check</code> parameter can be: <code>equals</code>, <code>less_than</code>, or <code>greater_than</code>. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>operator</code>: Numeric comparison operator. Accepted values are <code>less_than</code>, <code>less_or_equal</code>, <code>greater_than</code>, <code>greater_or_equal</code>, <code>equals</code> and <code>not_equals</code>. | * <code>operator</code>: Numeric comparison operator. Accepted values are <code>less_than</code>, <code>less_or_equal</code>, <code>greater_than</code>, <code>greater_or_equal</code>, <code>equals</code> and <code>not_equals</code>. | ||
* <code>party_size</code>: The size of the party to check against. | * <code>party_size</code>: The size of the party to check against. | ||
Line 365: | Line 334: | ||
* <code>not party_size equals,0</code> | * <code>not party_size equals,0</code> | ||
* <code>is party_size greater_than,4</code> | * <code>is party_size greater_than,4</code> | ||
=== to_talk === | |||
Check if a character is attempting to talk to another character. | |||
'''Parameters''' | |||
* <code>character1</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>character2</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
'''Examples''' | |||
* <code>is to_talk player,npc_maple</code> | |||
=== to_use_tile === | === to_use_tile === | ||
Line 475: | Line 454: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_id</code>: Id of the monster (name of the variable). | ||
* <code>technique</code>: Slug of the technique (e.g. "bullet"). | * <code>technique</code>: Slug of the technique (e.g. "bullet"). | ||
* <code>power</code>: Power between 0.0 and 3.0. (optional) | * <code>power</code>: Power between 0.0 and 3.0. (optional) | ||
* <code>potency</code>: Potency between 0.0 and 1.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>accuracy</code>: Accuracy between 0.0 and 1.0. (optional) | ||
* <code>npc_slug</code>: npc slug name (e.g. "npc_maple") - if absent default "player" (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code>get_player_monster name_variable</code> | * <code>get_player_monster name_variable</code> | ||
* <code>add_tech name_variable,bullet</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 === | === breeding === | ||
Line 523: | Line 514: | ||
* <code>change_bg gradient_blue</code> | * <code>change_bg gradient_blue</code> | ||
* <code>change_bg</code> (stop) | * <code>change_bg</code> (stop) | ||
=== change_state === | === change_state === | ||
Line 539: | Line 520: | ||
'''Parameters''' | '''Parameters''' | ||
* <code>state_name</code>: The state name to switch to (e.g. PCState). | * <code>state_name</code>: The state name to switch to (e.g. PCState). | ||
* <code>optional</code>: Variable related to specific states ( | * <code>optional</code>: Variable related to specific states (eg slug for JournalInfoState). (optional) | ||
'''Examples''' | '''Examples''' | ||
Line 610: | Line 591: | ||
'''Parameters''' | '''Parameters''' | ||
- | |||
'''Examples''' | '''Examples''' | ||
* <code>char_stop | * <code>char_stop</code> | ||
=== char_walk === | === char_walk === | ||
Line 746: | Line 727: | ||
'''Examples''' | '''Examples''' | ||
* <code>fadeout_music 2</code> | * <code>fadeout_music 2</code> | ||
=== get_party_monster === | === get_party_monster === | ||
Line 807: | Line 762: | ||
* <code>get_player_monster name_variable,shape,serpent</code> | * <code>get_player_monster name_variable,shape,serpent</code> | ||
=== | === kennel_print === | ||
Print all the kennels or one. It returns <name, qty, visible/hidden>, where *qty = number of monsters inside. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>kennel</code>: Name of the kennel. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>kennel_print</code> | ||
* <code> | * <code>kennel_print name_kennel</code> | ||
=== load_game === | === load_game === | ||
Line 870: | Line 801: | ||
* <code>menu disable,menu_bag</code> | * <code>menu disable,menu_bag</code> | ||
=== modify_char_attribute === | === modify_monster_stats === | ||
Change the stats of a monster in the current player's party. | |||
'''Parameters''' | |||
* <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters are touched. (Optional) | |||
* <code>stat</code>: A stat among armour, dodge, hp, melee, speed and ranged. If no stat, then all the stats. (Optional) | |||
* <code>amount</code>: A/an float/int value, if no amount, then default 1 (+). (Optional) | |||
'''Examples''' | |||
* <code>modify_monster_stats</code> | |||
* <code>modify_monster_stats ,,0.25</code> | |||
* <code>modify_monster_stats name_variable,speed,25</code> | |||
* <code>modify_monster_stats name_variable,dodge,-12</code> | |||
* <code>modify_monster_stats name_variable,dodge,-0.4</code> | |||
=== modify_char_attribute === | |||
Modify the given attribute of the character by modifier. By default this is achieved via addition, but prepending a '%' will cause it to be multiplied by the attribute. | 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. | ||
Line 881: | Line 827: | ||
* <code>modify_char_attribute character,attribute,value</code> | * <code>modify_char_attribute character,attribute,value</code> | ||
=== | === money_print === | ||
Print the current value of money dictionary to the console. If no entity is specified, print out values of all money dictionary. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>slug</code>: Slug name (e.g. player or NPC, etc.). | * <code>slug</code>: Slug name (e.g. player or NPC, etc.). (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>money_print</code> | ||
* <code> | * <code>money_print player</code> | ||
=== | === open_shop === | ||
Open the shop menu for a NPC. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>menu</code>: Either "buy", "sell" or "both". Default is "both". (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>open_shop npc_maple</code> | ||
=== | === pathfind === | ||
Moves an NPC to a certain tile on the map. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the NPC to be moved. | ||
* <code> | * <code>tile_pos_x</code>: The X-tile coordinate to have the NPC to walk to. | ||
* <code>tile_pos_y</code>: The Y-tile coordinate to have the NPC to walk to. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>pathfind Maple,2,3</code> | ||
* <code> | * <code>pathfind Pine,1,6</code> | ||
=== pathfind_to_player === | |||
=== | Pathfind NPC close the player. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>npc_slug</code>: Npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>direction</code>: Approaches the player from up, down, left or right. | ||
* <code> | * <code>distance</code>: How many tiles (2, 3, 4, etc.) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>pathfind_to_player spyder_route2_roddick</code> | ||
* <code> | * <code>translated_dialog spyder_route2_roddick1</code> | ||
* <code> | * <code>start_battle spyder_route2_roddick</code> | ||
=== pause_music === | |||
Pauses the currently playing music. | |||
=== | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>pause_music</code> | ||
=== | === play_map_animation === | ||
Plays an animation on the map. The <code>position</code> parameter can also be <code>player</code> if you want to draw the animation at the player's location. Loop can be either <code>loop</code> or <code>noloop</code>. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>animation_name</code>: The name of the animation to play under <code>resources/animations/tileset</code>. | ||
* <code> | * <code>duration</code>: The amount of time in seconds between each frame. | ||
* <code>loop</code>: Whether or not to loop the animation. Can be either <code>loop</code> or <code>noloop</code> to loop the animation. | |||
* <code>position</code>: The position to draw the animation. Can either be an <code>x,y</code> coordinate or <code>player</code> to draw the animation over the player. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>play_map_animation grass,0.1,noloop,player</code> | ||
* <code>play_map_animation sign01,0.4,loop,33,10</code> | |||
=== | === play_music === | ||
Plays an audio file. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>filename</code>: Music file to load (slug inside the JSON in db/sound) | ||
* <code> | * <code>volume</code>: Number between 0.0 and 1.0. (optional) | ||
* <code> | * <code>loop</code>: How many times loop, default forever. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>play_music music_mystic_island</code> | ||
=== | === play_sound === | ||
Plays a sound file. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>filename</code>: Sound file to load (slug inside the JSON in db/sound) | ||
* <code> | * <code>volume</code>: Number between 0.0 and 1.0. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>play_sound sound_confirm</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''' | '''Parameters''' : | ||
* <code> | * <code>variable</code>: Prints out the value of this variable (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>value</code>: in or out | ||
* <code>amount</code>: number of monsters (optional) | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>quarantine out</code> everything out (player's party -> if full, then box) | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>nr_txmns</code>: Number of tuxemon (1 to 6). | ||
* <code> | * <code>min_level</code>: Minimum level of the party. | ||
* <code>max_level</code>: Maximum level of the party. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <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>char_at</code> and <code>char_moved</code> conditions. | |||
''' | Here is an example encounter file: ''resources/db/encounter/route1.json'' | ||
<code>{"slug":"route1","monsters":[{"monster":"pairagrin","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]}]}</code> | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>encounter_slug</code>: Slug of the encounter list. | ||
* <code> | * <code>total_prob</code>: Total sum of the probabilities. (optional) | ||
* <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>random_encounter route1</code> | ||
* <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''' | '''Parameters''' | ||
* <code> | * <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''' | '''Examples''' | ||
* <code> | * <code>random_integer name_variable,1,9</code> | ||
=== | === random_item === | ||
Pick a random item from a list and add it to the trainer's inventory. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>item_slug</code>: Item name to look up in the item database (multiple items separated by ":"). | ||
* <code> | * <code>quantity</code>: Quantity of the item to add or to reduce. By default it is 1. (optional) | ||
* <code> | * <code>trainer_slug</code>: Slug of the trainer that will receive the item. It defaults to the current player. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>random_item potion:tea:revive</code> (adds 1 potion or tea or revive to the trainer's inventory). | ||
* <code>random_item potion:tea:revive,2</code> (adds 2 potions or teas or revives to the trainer's inventory). | |||
* <code>random_item potion:tea:revive,2,npc_maple</code> (adds 2 potions or teas or revives to the maple's inventory). | |||
* <code>random_item potion:tea:revive,,npc_maple</code> (adds 1 potion or tea or revive to the maple's inventory). | |||
=== | === random_monster === | ||
Add a monster to the specified trainer's party if there is room. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_level</code>: Level of the added monster. | ||
* <code> | * <code>trainer_slug</code>: Slug of the trainer that will receive the monster. It defaults to the current player. (optional) | ||
* <code> | * <code>exp_mod</code>: Experience modifier. (optional) | ||
* <code>money_mod</code>: Money modifier. (optional) | |||
* <code>shape</code>: Shape (eg. varmint, brute, etc.). (optional) | |||
* <code>evo</code>: Stage (eg. basic, stage1, etc.). (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>random_monster 10</code> | ||
* <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''' | '''Parameters''' : | ||
* <code>slug</code>: slug name (e.g. "npc_maple"). | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>instance_id</code>: Id of the monster to remove. | ||
* <code>trainer_slug</code>: Slug of the trainer. If no trainer slug is passed it defaults to the current player. | |||
* <code>trainer_slug</code>: Slug of the trainer | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>get_player_monster name_variable</code> | ||
* <code> | * <code>remove_monster name_variable</code> | ||
=== | === remove_npc === | ||
Removes an NPC from the current map. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>name</code>: The name of the NPC to remove. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>remove_npc Maple</code> | ||
* <code> | * <code>remove_npc Pine</code> | ||
=== | === remove_state === | ||
Change to the specified state. | |||
'''Parameters''' : | '''Parameters''' | ||
* <code> | * <code>state_name</code>: The state name to switch to (e.g. PCState). | ||
* <code>optional</code>: Variable related to specific states (eg slug for JournalInfoState). | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>remove_state</code> (it removes everything, excluding the basic ones) | ||
* <code>remove_state JournalInfoState</code> (it removes everything, excluding the basic ones) | |||
=== | === rename_monster === | ||
Open the monster menu and text input screens to rename a selected monster. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>rename_monster</code> | ||
=== | === rename_player === | ||
Open the text input screen to rename the player. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>rename_player</code> | ||
=== | === rumble === | ||
Rumble available controllers with rumble support. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>duration</code>: Time in seconds to rumble for. | ||
* <code>power</code>: Percentage of power to rumble. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>rumble duration,power</code> | ||
=== | === save_game === | ||
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''' | '''Parameters''' | ||
* <code> | * <code>index</code>: Selected index. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>save_game</code> (it's going to save slot4.save) | ||
* <code> | * <code>save_game 1</code> (it's going to save slot2.save) | ||
=== | === screen_transition === | ||
Fades the screen to black and back over <code>x</code> seconds. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>transition_time</code>: Time in seconds - default 2 (optional). | ||
* <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>screen_transition 2</code> | ||
=== | === set_battle === | ||
Append a new element in player.battles. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>fighter</code>: Npc slug name (e.g. "npc_maple"). | ||
* <code>result</code>: One among "won", "lost" or "draw" | |||
* <code>opponent</code>: Npc slug name (e.g. "npc_maple"). | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_battle player,won,npc_maple</code> (player won against npc_maple) | ||
=== | === set_bubble === | ||
Put a bubble above player sprite. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>bubble</code>: dots, drop, exclamation, heart, note, question, sleep, angry, confused, fireworks | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_bubble spyder_shopassistant</code> (remove bubble NPC) | ||
* <code>set_bubble spyder_shopassistant,note</code> (set bubble NPC) | |||
* <code>set_bubble player,note</code> (set bubble player) | |||
* <code>set_bubble player</code> (remove bubble player) | |||
=== | === set_code === | ||
Set a code and checks if it's correct or not. Case Sensitive: ATTENTION and AtTenTION are two different words. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>question</code>: The question the player needs to reply. (eg. "access_code") then you create the msgid "access_code" inside the English PO file, as follows: msgid "access_code" and msgstr "Here the actual question?" | ||
* <code> | * <code>answer</code>: The right answer to the question. | ||
* <code>variable</code>: Where the result (right/wrong) is saved. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_code access_code,joke,name_variable</code> | ||
=== | === set_economy === | ||
Set the economy (prices of items) of the npc or player. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>economy_slug</code>: Slug of an economy. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>kennel</code>: Name of the kennel. | ||
* <code> | * <code>visible</code>: true/false. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>kennel</code>: Name of the kennel. | ||
* <code> | * <code>visible</code>: true/false. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_kennel new_kennel,true</code> | ||
=== | === set_layer === | ||
Allows to change the color of the transparent layer. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>rgb</code>: color (eg red > 255,0,0,128 > 255:0:0:128) - default transparent | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_layer 255:0:0:128</code> | ||
=== | === set_money === | ||
Set the | Set the key and value in the money dictionary. It'll reset the previous amount. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slug</code>: Slug name (e.g. player or NPC, etc.). | ||
* <code> | * <code>amount</code>: Amount of money | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_money player,500</code> | ||
=== | === set_mission === | ||
Set | Set mission. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>slug</code>: slug mission | ||
* <code> | * <code>operation</code>: add, remove or change | ||
* <code>status</code>: completed, pending, failed (default pending) | |||
* <code>character</code>: slug name (e.g. "npc_maple"), default player. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_mission mission1</code> | ||
* <code> | * <code>set_mission mission1,change,completed</code> | ||
=== | === set_monster_flair === | ||
Set a monster's flair to the given value. | |||
'''Parameters''' | |||
* <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters are changed. | |||
* <code>category</code>: Category of the monster flair. | |||
'''Parameters''' | * <code>flair</code>: Name of the monster flair. | ||
* <code> | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>get_player_monster name_variable</code> | ||
* <code>set_monster_flair name_variable,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''' | '''Parameters''' | ||
* <code> | * <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters are healed. (optional) | ||
* <code>health</code>: 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''' | '''Examples''' | ||
* <code> | * <code>set_monster_health</code> (heals all the monsters in the party) | ||
or | |||
* <code>get_player_monster name_variable</code> | |||
* <code>set_monster_health name_variable,1</code> | |||
=== | === set_monster_level === | ||
Change the level of a monster in the current player's party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters are changed. (optional) | ||
* <code> | * <code>levels_added</code>: Number of levels to add. Negative numbers are allowed. Default 1. (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_monster_level</code> (all the monsters in the party level up by 1) | ||
* <code> | or | ||
* <code>get_player_monster name_variable</code> | |||
* <code>set_monster_level name_variable,1</code> | |||
=== | === set_monster_plague === | ||
Cure or infect a monster. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters get the condition. (optional) | ||
* <code> | * <code>condition</code>: inoculated, healthy or infected, default healthy (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_monster_plague</code> (all the monsters in the party are healthy) | ||
* <code> | or | ||
* <code>get_player_monster name_variable</code> | |||
* <code>set_monster_plague name_variable,infected</code> | |||
=== | === set_monster_status === | ||
Change the status of a monster in the current player's party. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>variable</code>: Name of the variable where to store the monster id. | * <code>variable</code>: Name of the variable where to store the monster id. If no variable is specified, all monsters get/lose status.. (optional) | ||
* <code>status</code>: Inoculated, healthy or infected, default healthy (optional) | |||
* <code> | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_monster_status</code> (all the monsters in the party lose their status) | ||
or | |||
=== | * <code>get_player_monster name_variable</code> | ||
Set | * <code>set_monster_status name_variable,status_blinded</code> | ||
=== set_char_attribute === | |||
Set the given attribute of the character to the given value. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>attribute</code>: Name of the attribute. | ||
* <code> | * <code>value</code>: Value of the attribute. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_char_attribute character,attribute,value</code> | ||
=== | === set_player_name === | ||
Set | Set player name without opening the input screen. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>choice</code>: Single name or multiple names separated by ":" (random choice). NB: the names must be in the en_US PO file. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_player_name jimmy</code> | ||
* <code>set_player_name jimmy:richard:linus</code> (random choice among jimmy, richard and linus) | |||
* <code> | |||
=== | === set_random_variable === | ||
Set the key in the player.game_variables dictionary with a random value. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>variable</code>: Name of the variable | * <code>variable</code>: Name of the variable. | ||
* <code> | * <code>values</code>: Multiple values of the variable separated with ":". | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_random_variable alpha,one:two:three</code> (variable "alpha" can be "alpha:one" or "alpha:two" or "alpha:three"). | ||
=== | === set_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''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>sprite</code>: must be inside mods/tuxemon/sprites (default = original), eg: adventurer_brown_back.png -> adventurer | ||
* <code> | * <code>combat_front</code>: must be inside mods/tuxemon/gfx/sprites/player, eg: adventurer.png -> adventurer (optional) | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_template player,adventurer,adventurer</code> | ||
=== | === set_tuxepedia === | ||
Set the | Set the key and value in the Tuxepedia dictionary. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code> | * <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | ||
* <code> | * <code>label</code>: seen / caught | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>set_tuxepedia player,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''' | '''Parameters''' | ||
* <code> | * <code>variable_name:value</code>: A key, value pair of the <code>variable_name</code> to set with <code>value</code>. | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>spawn_monster</code> | ||
=== | === start_battle === | ||
Start a battle between two characters and switch to the combat module. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character1</code>: Either "player" or character slug name (e.g. "npc_maple"). | ||
* <code> | * <code>character2</code>: Either "player" or character slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>start_battle npc_maple</code> | ||
* <code>start_battle npc_maple,npc_apple</code> | |||
=== | === start_cinema_mode === | ||
Start cinema mode by animating black bars to narrow the aspect ratio. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>start_cinema_mode</code> | ||
=== | === stop_cinema_mode === | ||
Stop cinema mode by animating black bars back to the normal aspect ratio. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>monster_id</code>: Id of the monster to store. | ||
* <code>box</code>: An existing box where the monster will be stored. (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>get_player_monster name_variable</code> | ||
then: | |||
* <code> | * <code>store_monster name_variable</code> | ||
* <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''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>map_name</code>: The map file to teleport the player to. | ||
* <code> | * <code>x</code>: The X-tile coordinate to teleport the player to. | ||
* <code>y</code>: The Y-tile coordinate to teleport the player to. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>teleport map1.tmx,3,4</code> | ||
* <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''' | '''Parameters''' | ||
* <code> | * <code>removed</code>: Instance id (name variable). | ||
* <code>added</code>: Slug monster. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>get_player_monster name_variable</code> | ||
then | |||
* <code>trading name_variable,nut</code> | |||
=== | === transfer_money === | ||
Performs a mathematical transaction on the player's money. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>transaction</code>: Operator symbol. | ||
* <code>amount</code>: Amount of money. | |||
* <code>slug</code>: Slug name (e.g. NPC, etc.) (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <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''' | '''Parameters''' | ||
* <code> | * <code>map_name</code>: The map file to teleport the player to. | ||
* <code> | * <code>x</code>: The X-tile coordinate to teleport the player to. | ||
* <code>y</code>: The Y-tile coordinate to teleport the player to. | |||
* <code>transition_time</code>: The time in seconds - default 2. (optional) | |||
* <code>rgb</code>: color (eg red > 255,0,0 > 255:0:0) - default rgb(255,255,255) (optional) | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>teleport map2.tmx,1,6,1.5</code> | ||
* <code>teleport room1.tmx,8,1,4</code> | |||
* <code> | |||
=== | === translated_dialog_choice === | ||
Asks the player to select a choice. The translations for the text are looked up based on a given key. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <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''' | '''Examples''' | ||
* <code> | * <code>translated_dialog_choice yes:no,myvariable</code> | ||
=== | === translated_dialog === | ||
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''' | '''Parameters''' | ||
* <code> | * <code>text</code>: The msgid in the PO file. | ||
* <code> | * <code>avatar</code>: 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. | ||
* <code> | * <code>style</code>: a predefined style in db/dialogue/dialogue.json | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>translated_dialog msgid</code> | ||
=== | === tuxepedia_print === | ||
Print the current value of Tuxepedia to the console. If no monster is specified, print out values of all Tuxepedia. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_slug</code>: Monster slug name (e.g. "rockitten"). | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>tuxepedia_print</code> | ||
* <code>tuxepedia_print rockitten</code> | |||
* <code> | |||
=== | === unlock_controls === | ||
Unlock player controls | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>None</code> | ||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>unlock_controls</code> | ||
=== variable_math === | |||
=== variable_math === | |||
Performs a mathematical operation on the key in the player.game_variables dictionary. | Performs a mathematical operation on the key in the player.game_variables dictionary. | ||
Line 1,678: | Line 1,546: | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>monster_id</code>: The id of the monster to pull (variable). | ||
* <code> | * <code>trainer</code>: Slug of the trainer that will receive the monster. It defaults to the current player. | ||
'''Examples''' | '''Examples''' | ||
* <code>get_player_monster name_variable</code> | * <code>get_player_monster name_variable</code> | ||
Line 1,767: | Line 1,635: | ||
Let's say you want to set up and event for trading monsters. You need 3 events after creating the NPC in map. | Let's say you want to set up and event for trading monsters. You need 3 events after creating the NPC in map. | ||
* <code>monster1</code> (monster desired by the NPC) | * <code>monster1</code> (monster desired by the NPC) | ||
* <code>monster2</code> (monster the NPC wants to trade | * <code>monster2</code> (monster the NPC wants to trade) | ||
1st: if the player has the monster | 1st: if the player has the monster | ||
* <code>translated_dialog dialog_npc1</code> | |||
* <code>translated_dialog_choice yes:no,npc_willtrade</code> | |||
* <code>talk npc_slug</code> | |||
* <code>is has_monster monster1</code> | |||
* <code>not variable_set npc_hastraded:yes</code> | |||
2nd: if the player hasn't the monster | 2nd: if the player hasn't the monster | ||
* <code>translated_dialog dialog_npc1</code> | |||
* <code>translated_dialog dialog_npc_nomonster1</code> | |||
* <code>talk npc_slug</code> | |||
* <code>not has_monster monster1</code> | |||
* <code>not variable_set npc_hastraded:yes</code> | |||
3rd: trading part | 3rd: trading part | ||
* <code>translated_dialog dialog_npc_willtrade</code> | |||
* <code>get_player_monster name_variable</code> | |||
* <code>trading name_variable,traded_monster</code> | |||
* <code>set_variable npc_hastraded:yes</code> | |||
* <code>is has_monster monster1</code> | |||
* <code>is variable_set npc_willtrade</code> | |||
* <code>not variable_set npc_hastraded</code> | |||
==== Get Party Monster ==== | ==== Get Party Monster ==== | ||
Let's say you want to add a tech to a monster (NPC). Eg. the NPC [[Rockitten]] needs to know [[Canine]], but [[Rockitten]] is the 4th monster (equal to 3rd slot). | Let's say you want to add a tech to a monster (NPC). Eg. the NPC [[Rockitten]] needs to know [[Canine]], but [[Rockitten]] is the 4th monster (equal to 3rd slot). | ||
* <code>add_monster rockitten,20,npc_slug,27,10</code> | |||
* <code>add_monster vivipere,20,npc_slug,27,10</code> | |||
* <code>add_monster budaye,20,npc_slug,27,10</code> | |||
* <code>add_monster rockitten,20,npc_slug,27,10</code> | |||
* <code>add_monster nut,20,npc_slug,27,10</code> | |||
* <code>get_party_monster npc_slug</code> | |||
* <code>add_tech iid_slot_3,canine,,,,npc_slug</code> here <code>iid_slot_3</code> followed by [[Canine]] | |||
* <code>start_battle npc_slug</code> | |||
==== Battle Among NPCs (the player watches without interacting) ==== | ==== Battle Among NPCs (the player watches without interacting) ==== | ||
Line 1,807: | Line 1,675: | ||
<property name="act10" value="create_npc npc_maple,0,7,stand"/> | <property name="act10" value="create_npc npc_maple,0,7,stand"/> | ||
<property name="act20" value="create_npc npc_apple,0,8,stand"/> | <property name="act20" value="create_npc npc_apple,0,8,stand"/> | ||
<property name="act30" value="add_monster chloragon,3,npc_maple"/> | <property name="act30" value="add_monster chloragon,3,npc_maple,80,100"/> | ||
<property name="act40" value="add_monster rockitten,3,npc_apple"/> | <property name="act40" value="add_monster rockitten,3,npc_apple,80,100"/> | ||
<property name="act50" value="start_battle | <property name="act50" value="start_battle speck,acolyte"/> | ||
separate event, multiple endings, if npc_maple wins | separate event, multiple endings, if npc_maple wins | ||
<property name="cond1" value="is variable_set battle_last_winner:npc_maple"/> | <property name="cond1" value="is variable_set battle_last_winner:npc_maple"/> | ||
separate event, multiple endings, if npc_apple wins | separate event, multiple endings, if npc_apple wins | ||
<property name="cond1" value=" | <property name="cond1" value="is variable_set battle_last_winner:npc_apple"/> | ||
separate event, multiple endings, if no-one wins | separate event, multiple endings, if no-one wins | ||
<property name="cond1" value="is variable_set battle_last_result:draw"/> | <property name="cond1" value="is variable_set battle_last_result:draw"/> |