Difference between revisions of "Event Reference Condition"
Jaskrendix (talk | contribs) (update) |
Jaskrendix (talk | contribs) |
||
| (23 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Here is a list of currently implemented conditions. New event conditions can be created by creating a new page under the '''tuxemon/event/conditions''': | Here is a list of currently implemented conditions. New event conditions can be created by creating a new page under the '''tuxemon/event/conditions''': | ||
== | == battle_outcome == | ||
Check to see if a character has fought against another one and won, lost or draw. | Check to see if a character has fought against another one and won, lost or draw. | ||
| Line 10: | Line 10: | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is battle_outcome player,won,npc_maple</code> (has player won against npc_maple in the last fight?) | ||
== battle_outcome_count == | |||
Checks if a character has achieved a specific battle outcome a minimum number of times against a specific opponent. | |||
'''Parameters''' | |||
* <code>fighter_slug</code>: The slug of the battle participant (e.g., "player"). | |||
* <code>outcome</code>: The desired battle outcome ("won", "lost", or "draw"). | |||
* <code>opponent_slug</code>: The slug of the opponent (e.g., "npc_maple"). | |||
* <code>count</code>: Minimum number of times the outcome must have occurred. | |||
'''Examples''' | |||
* <code>is battle_outcome_count player,won,npc_maple,2</code> (checks if the 'player' has won at least 2 times against 'npc_maple'.) | |||
== bill_exist == | |||
Check to see if a bill exists. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>bill_slug</code>: The slug of the bill | |||
'''Examples''' | |||
* <code>is bill_exist player,bill_slug</code> | |||
== bill_is == | |||
Check to see if a bill exists and has a certain amount. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>bill_slug</code>: The slug of the bill | |||
* <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals". | |||
* <code>amount</code>: Amount of money or value stored in variable. | |||
'''Examples''' | |||
* <code>is bill_is player,bill_slug,>=,500</code> | |||
* <code>is bill_is player,bill_slug,equals,name_variable</code> (name_variable:75) | |||
== button_combo == | |||
Check to see if a particular sequence of buttons was pressed. | |||
'''Parameters''' | |||
* <code>buttons</code>: A sequence of button/intention keys (E.g. "up:down:interact"). | |||
'''Examples''' | |||
* <code>is bill_is up:down:interact</code> | |||
== button_count == | |||
Check to see how many time a particular button was pressed. | |||
'''Parameters''' | |||
* <code>button</code>: A button/intention key (E.g. "up"). | |||
* <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals". | |||
* <code>amount</code>: The number of times the button was pressed. | |||
'''Examples''' | |||
* <code>is button_count up,70</code> | |||
== button_held == | |||
Check to see if a particular key was held for a certain number of frames. | |||
'''Parameters''' | |||
* <code>button</code>: A button/intention key (E.g. "up"). | |||
* <code>frames</code>: The number of frames the button must be held. | |||
'''Examples''' | |||
* <code>is button_held up,500</code> | |||
== button_pressed == | == button_pressed == | ||
| Line 22: | Line 87: | ||
* <code>is button_pressed INTERACT</code> | * <code>is button_pressed INTERACT</code> | ||
* <code>not button_pressed DOWN</code> | * <code>not button_pressed DOWN</code> | ||
== camera_at == | |||
Check to see if the camera is at the position on the map. | |||
'''Parameters''' | |||
* <code>pos_x</code>: X position of the camera. | |||
* <code>pos_y</code>: Y position of the camera. | |||
'''Examples''' | |||
* <code>is camera_at 15,15</code> | |||
== char_at_position == | |||
Check to see if the character is at the position on the map. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>character</code>: X position to set the character to. | |||
* <code>tile_pos_x</code>: Y position to set the character to. | |||
'''Examples''' | |||
* <code>is char_at_position player,6,9</code> | |||
== char_at == | == char_at == | ||
| Line 90: | Line 176: | ||
* <code>is char_in npc_maple,surfable</code> | * <code>is char_in npc_maple,surfable</code> | ||
== | == char_in_boundary == | ||
Checks if a character is within a specific named boundary. | |||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character_name</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
* <code>boundary_name</code>: The name of the boundary to check (e.g., "safe_zone"). | |||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is char_in_boundary npc_maple,safe_zone</code> | ||
== | == char_moved == | ||
Check to see | Check to see the character has just moved into this tile. Using this condition will prevent a condition like "char_at" from constantly being true every single frame. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | * <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | ||
'''Examples''' | '''Examples''' | ||
* <code>is | * <code>is char_moved player</code> | ||
== char_sprite == | == char_sprite == | ||
| Line 141: | Line 226: | ||
== check_max_tech == | == check_max_tech == | ||
Condition to check whether a character (player or NPC) has at least one Tuxemon with more techniques than a specified threshold. This condition is used in event scripting to trigger actions based on the number of techniques a Tuxemon possesses. If the condition is met, the matching monsters are stored in the session's `event_data` dictionary under the key `"check_max_tech"`. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>nr</code>: | * <code>character</code>: Either "player" or NPC slug name (e.g. "npc_maple"). | ||
* <code>nr</code>: Optional integer specifying the minimum number of techniques. Defaults to the constant MAX_MOVES. | |||
'''Examples''' | '''Examples''' | ||
* <code>is check_max_tech</code> | * <code>is check_max_tech player</code> | ||
* <code>is check_max_tech 2</code> | * <code>is check_max_tech npc_maple,2</code> | ||
== check_mission == | == check_mission == | ||
Check | Check mission status for one or more missions. | ||
'''Parameters''' | '''Parameters''' | ||
* <code>character</code>: Either "player" or | * <code>character</code>: Either "player" or NPC slug (e.g. "npc_maple") | ||
* <code>method</code>: Mission or | * <code>method</code>: Mission slug(s), colon-separated (e.g. "mission1:mission2") or "all" | ||
* <code> | * <code>status</code>: One of ["pending", "completed", "failed"] | ||
* <code>mode</code>: "any" (default) or "all": "any" returns True if at least one mission matches status OR "all" returns True only if all listed missions match status | |||
'''Examples''' | '''Examples''' | ||
* <code>is check_mission player,mission1,completed</code> | * <code>is check_mission player,mission1,completed</code> | ||
* <code>is check_mission player,mission1, | * <code>is check_mission player,mission1:mission2,completed,all</code> | ||
* <code>is check_mission player, | * <code>is check_mission player,all,pending</code> | ||
* <code>is check_mission | * <code>is check_mission npc_maple,missionA:missionB,failed,any</code> | ||
== check_party_parameter == | == check_party_parameter == | ||
| Line 176: | Line 263: | ||
'''Examples''' | '''Examples''' | ||
* <code>check_party_parameter player,level,5,equals,1</code> (is there 1 monster in the party at level 5? True/False) | * <code>check_party_parameter player,level,5,equals,1</code> (is there 1 monster in the party at level 5? True/False) | ||
== check_teleport_faint == | |||
Check to see if teleport_faint exists and has a particular value. If the teleport_faint does not exist it will return ``False``. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>map_name</code>: The name of the map to validate against. | |||
* <code>x</code>: The x-coordinate to validate against. | |||
* <code>y</code>: The y-coordinate to validate against. | |||
'''Examples''' | |||
* <code>is check_teleport_faint player,map_name.tmx,1,10</code> | |||
== check_world == | == check_world == | ||
| Line 191: | Line 290: | ||
* <code>is check_world</code> | * <code>is check_world</code> | ||
* <code>is check_world layer,255:255:255:0</code> | * <code>is check_world layer,255:255:255:0</code> | ||
== cooldown_days == | |||
Checks if a specified number of days has passed since the event last ran. | |||
'''Parameters''' | |||
* <code>timeframe</code>: the number of days the event should be on cooldown. | |||
* <code>variable</code>: game variable where the cooldown date is stored. | |||
'''Examples''' | |||
* <code>set_variable variable_name:today</code> | |||
* <code>is cooldown_days 1,variable_name</code> (it blocks the event for 1 day) | |||
or | |||
* <code>is cooldown_days 7,variable_name</code> (it blocks the event for 7 days - 1 week) | |||
== current_state == | == current_state == | ||
| Line 201: | Line 313: | ||
* <code>is current_state DialogState</code> | * <code>is current_state DialogState</code> | ||
* <code>is current_state CombatState:DialogState</code> | * <code>is current_state CombatState:DialogState</code> | ||
== faction_reputation == | |||
Checks if an NPC's reputation meets a threshold. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals". | |||
* <code>threshold</code>: A string representation of an integer (e.g. "30", "-100"). Will be parsed and used as a numeric threshold in comparison. | |||
'''Examples''' | |||
* <code>is faction_reputation npc_maple,less_than,30</code> | |||
* <code>is faction_reputation npc_maple,less_or_equal,60</code> | |||
== has_bag == | == has_bag == | ||
| Line 310: | Line 434: | ||
== location_type == | == location_type == | ||
Determines whether the player is currently in a specified location type. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>slug</code>: | * <code>slug</code>: A string identifier for the location type. Acceptable values: "all" (matches any location) | ||
'''Examples''' | '''Examples''' | ||
| Line 332: | Line 456: | ||
== monster_flair == | == monster_flair == | ||
Check | Check if any monster in the character's party has a flair matching the given category and name. | ||
'''Parameters''' | '''Parameters''' | ||
* <code> | * <code>character</code>: Either "player" or an NPC slug name (e.g. "npc_maple"). | ||
* <code> | * <code>category</code>: Category of the flair to check. | ||
* <code>name</code>: Name of the flair. | * <code>name</code>: Name of the flair to match. | ||
'''Behavior''' | |||
* Returns True if any monster in the character's party has a flair in the given category with the specified name. | |||
* Returns False if no match is found or the character is invalid. | |||
'''Examples''' | '''Examples''' | ||
* <code> | * <code>monster_flair player,category,name</code> | ||
== music_playing == | == music_playing == | ||
| Line 350: | Line 478: | ||
'''Examples''' | '''Examples''' | ||
* <code>is music_playing 472452_8-Bit-Ambient.ogg</code> | * <code>is music_playing 472452_8-Bit-Ambient.ogg</code> | ||
== one_of == | == one_of == | ||
| Line 397: | Line 512: | ||
* <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> | ||
== party_status == | |||
Check how many monsters in a character's party have a specific status. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>operator</code>: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals". | |||
* <code>value</code>: Integer to compare against. | |||
* <code>status_name</code>: Slug of the status to check (e.g. "poison"). | |||
'''Examples''' | |||
* <code>is party_status plague_slug,less_than,3,poison</code> | |||
== step_tracker == | |||
Evaluates whether a step tracker exists for a character or if a milestone has been reached. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or an NPC slug name (e.g., "npc_maple"). | |||
* <code>tracker_id</code>: Unique name for identifying the step tracker. | |||
* <code>milestone</code>: Step milestone to check. | |||
'''Examples''' | |||
* <code>is step_tracker npc_maple,tracker_id,50</code> | |||
* <code>not step_tracker npc_maple,tracker_id,100</code> | |||
== tile_property_updated == | |||
Checks whether all relevant tiles in the world have been modified with a specific property. | |||
'''Parameters''' | |||
* <code>label</code>: The property name to check (e.g., terrain type). | |||
* <code>moverate</code>: The expected movement rate value. | |||
'''Examples''' | |||
* <code>is tile_property_updated surfable,1.0</code> | |||
== timestamp_cooldown == | |||
Checks if a specified number of seconds has passed since the event last ran. This allows for more precise cooldowns than the "once per day" check. | |||
'''Parameters''' | |||
* <code>timeframe</code>: The number of seconds the event should be on cooldown. | |||
* <code>variable</code>: The game variable where the cooldown timestamp is stored. | |||
'''Examples''' | |||
* <code>is timestamp_cooldown 69,variable_name</code> | |||
== to_use_tile == | == to_use_tile == | ||
| Line 406: | Line 565: | ||
'''Examples''' | '''Examples''' | ||
* <code>is to_use_tile</code> | * <code>is to_use_tile</code> | ||
== tracker == | |||
Check to see if tracker exists. | |||
'''Parameters''' | |||
* <code>character</code>: Either "player" or npc slug name (e.g. "npc_maple"). | |||
* <code>map_name</code>: The name of the map to validate against. | |||
'''Examples''' | |||
* <code>is tracker player,paper_town</code> | |||
== true == | == true == | ||
| Line 428: | Line 597: | ||
* <code>is tuxepedia less_than,0.2</code> | * <code>is tuxepedia less_than,0.2</code> | ||
* <code>is tuxepedia less_than,0.2,10</code> | * <code>is tuxepedia less_than,0.2,10</code> | ||
== variable_highest == | |||
Check if a specific variable is the highest among the others. | |||
'''Parameters''' | |||
* <code>key_to_check</code>: Key to check. | |||
* <code>keys_to_check</code>: List of the keys among to check separated by ':' | |||
'''Examples''' | |||
* <code>is variable_highest jimmy,arthur:jimmy:clara</code> | |||
== variable_is == | == variable_is == | ||
| Line 439: | Line 618: | ||
'''Examples''' | '''Examples''' | ||
* <code>is variable_is [value1],operator,[value2]</code> | * <code>is variable_is [value1],operator,[value2]</code> | ||
== variable_lowest == | |||
Check if a specific variable is the lowest among the others. | |||
'''Parameters''' | |||
* <code>key_to_check</code>: Key to check. | |||
* <code>keys_to_check</code>: List of the keys among to check separated by ':' | |||
'''Examples''' | |||
* <code>is variable_lowest jimmy,arthur:jimmy:clara</code> | |||
== variable_set == | == variable_set == | ||
Checks if one or more player game variables exist and optionally match specified values. If a variable does not exist, the condition returns `False`. | |||
'''Parameters''' | '''Parameters''' | ||
* <code>variable_name:value</code>: | * <code>variable_name:value</code>: | ||
* <code>variable_name</code>: The variable to check. | |||
* <code>value</code>: Optional value to check against. If omitted, the condition only checks for the variable's existence. | |||
The condition returns `True` if all specified variables exist and match their given values (if provided). Otherwise, it returns `False`. | |||
'''Examples''' | '''Examples''' | ||
* <code>is variable_set battle_won:yes</code> | * <code>is variable_set battle_won:yes</code> | ||
* <code>not variable_set current_badges:4</code> | * <code>not variable_set current_badges:4</code> | ||
* <code>is variable_set | * <code>is variable_set <variable>[:value],[<variable>[:value] ...]</code> | ||
Latest revision as of 08:13, 1 November 2025
Here is a list of currently implemented conditions. New event conditions can be created by creating a new page under the tuxemon/event/conditions:
battle_outcome[edit | edit source]
Check to see if a character has fought against another one and won, lost or draw.
Parameters
fighter: Npc slug name (e.g. "npc_maple").outcome: One among "won", "lost" or "draw".opponent: Npc slug name (e.g. "npc_maple").
Examples
is battle_outcome player,won,npc_maple(has player won against npc_maple in the last fight?)
battle_outcome_count[edit | edit source]
Checks if a character has achieved a specific battle outcome a minimum number of times against a specific opponent.
Parameters
fighter_slug: The slug of the battle participant (e.g., "player").outcome: The desired battle outcome ("won", "lost", or "draw").opponent_slug: The slug of the opponent (e.g., "npc_maple").count: Minimum number of times the outcome must have occurred.
Examples
is battle_outcome_count player,won,npc_maple,2(checks if the 'player' has won at least 2 times against 'npc_maple'.)
bill_exist[edit | edit source]
Check to see if a bill exists.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").bill_slug: The slug of the bill
Examples
is bill_exist player,bill_slug
bill_is[edit | edit source]
Check to see if a bill exists and has a certain amount.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").bill_slug: The slug of the billoperator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".amount: Amount of money or value stored in variable.
Examples
is bill_is player,bill_slug,>=,500is bill_is player,bill_slug,equals,name_variable(name_variable:75)
button_combo[edit | edit source]
Check to see if a particular sequence of buttons was pressed.
Parameters
buttons: A sequence of button/intention keys (E.g. "up:down:interact").
Examples
is bill_is up:down:interact
button_count[edit | edit source]
Check to see how many time a particular button was pressed.
Parameters
button: A button/intention key (E.g. "up").operator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".amount: The number of times the button was pressed.
Examples
is button_count up,70
button_held[edit | edit source]
Check to see if a particular key was held for a certain number of frames.
Parameters
button: A button/intention key (E.g. "up").frames: The number of frames the button must be held.
Examples
is button_held up,500
button_pressed[edit | edit source]
Check to see if a particular key has been pressed. E.g. K_RETURN.
Parameters
key: A pygame key constant such asK_RETURN. For a list of all possible keys, refer to the Pygame Key Page or at the constants in tuxemon/platform/const/intentions.py
Examples
is button_pressed K_RETURNis button_pressed INTERACTnot button_pressed DOWN
camera_at[edit | edit source]
Check to see if the camera is at the position on the map.
Parameters
pos_x: X position of the camera.pos_y: Y position of the camera.
Examples
is camera_at 15,15
char_at_position[edit | edit source]
Check to see if the character is at the position on the map.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").character: X position to set the character to.tile_pos_x: Y position to set the character to.
Examples
is char_at_position player,6,9
char_at[edit | edit source]
Check to see if the character is at the condition position on the map.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is char_at Maple
char_defeated[edit | edit source]
Check to see the character has at least one tuxemon, and all tuxemon in their party are defeated.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is char_defeated player
char_exists[edit | edit source]
Check to see if a character object exists in the current list of NPCs.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
not char_exists npc_maple
char_facing[edit | edit source]
Check to see where a character is facing.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").direction: One of "up", "down", "left" or "right".
Examples
is char_facing npc_maple,upnot char_facing npc_maple,down
char_facing_char[edit | edit source]
Check to see the character is next to and facing a particular character.
Parameters
character1: Either "player" or npc slug name (e.g. "npc_maple").character2: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is char_facing_char npc_maple,player
char_facing_tile[edit | edit source]
Check to see if a character is facing a tile position.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is char_facing_tile npc_maple
char_in[edit | edit source]
Check to see if the character is at the condition position on a specific set of tiles.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").value: value (eg surfable) inside the tileset.
Examples
is char_in npc_maple,surfable
char_in_boundary[edit | edit source]
Checks if a character is within a specific named boundary.
Parameters
character_name: Either "player" or npc slug name (e.g. "npc_maple").boundary_name: The name of the boundary to check (e.g., "safe_zone").
Examples
is char_in_boundary npc_maple,safe_zone
char_moved[edit | edit source]
Check to see the character has just moved into this tile. Using this condition will prevent a condition like "char_at" from constantly being true every single frame.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is char_moved player
char_sprite[edit | edit source]
Check the character's sprite
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").sprite: NPC's sprite (eg maniac, florist, etc.)
Examples
is char_sprite player,adventurer
check_char_parameter[edit | edit source]
Check the parameter's value of the character against a given value.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").parameter: Name of the parameter to check (eg. "name", "steps", etc.).value: Given value to check.
Examples
is check_char_parameter player,name,alpha
check_evolution[edit | edit source]
Check to see the character has at least one tuxemon evolving. If yes, it'll save the monster and the evolution inside a list. The list will be used by the event action evolution.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is check_evolution player
check_max_tech[edit | edit source]
Condition to check whether a character (player or NPC) has at least one Tuxemon with more techniques than a specified threshold. This condition is used in event scripting to trigger actions based on the number of techniques a Tuxemon possesses. If the condition is met, the matching monsters are stored in the session's `event_data` dictionary under the key `"check_max_tech"`.
Parameters
character: Either "player" or NPC slug name (e.g. "npc_maple").nr: Optional integer specifying the minimum number of techniques. Defaults to the constant MAX_MOVES.
Examples
is check_max_tech playeris check_max_tech npc_maple,2
check_mission[edit | edit source]
Check mission status for one or more missions.
Parameters
character: Either "player" or NPC slug (e.g. "npc_maple")method: Mission slug(s), colon-separated (e.g. "mission1:mission2") or "all"status: One of ["pending", "completed", "failed"]mode: "any" (default) or "all": "any" returns True if at least one mission matches status OR "all" returns True only if all listed missions match status
Examples
is check_mission player,mission1,completedis check_mission player,mission1:mission2,completed,allis check_mission player,all,pendingis check_mission npc_maple,missionA:missionB,failed,any
check_party_parameter[edit | edit source]
Check to see the player has failed or completed a mission. Check to see if a mission is still pending.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").attribute: Name of the monster attribute to check (e.g. level).value: Value to check (related to the attribute) (e.g. 5 - level).operator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".times: Value to check with operator (how many times in the party?).
Examples
check_party_parameter player,level,5,equals,1(is there 1 monster in the party at level 5? True/False)
check_teleport_faint[edit | edit source]
Check to see if teleport_faint exists and has a particular value. If the teleport_faint does not exist it will return ``False``.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").map_name: The name of the map to validate against.x: The x-coordinate to validate against.y: The y-coordinate to validate against.
Examples
is check_teleport_faint player,map_name.tmx,1,10
check_world[edit | edit source]
Check some world's parameter against a given value.
Parameters
parameter: Name of the parameter to check (eg. "layer", etc.).value: Given value to check.
Supported parameters
- layer: color value which is used to overlay the world
- bubble: speech bubble of an npc
Examples
is check_worldis check_world layer,255:255:255:0
cooldown_days[edit | edit source]
Checks if a specified number of days has passed since the event last ran.
Parameters
timeframe: the number of days the event should be on cooldown.variable: game variable where the cooldown date is stored.
Examples
set_variable variable_name:todayis cooldown_days 1,variable_name(it blocks the event for 1 day)
or
is cooldown_days 7,variable_name(it blocks the event for 7 days - 1 week)
current_state[edit | edit source]
Check to see if one or multiple state/states has/have been started or not.
Parameters
state: Either "CombatState", "DialogState", etc
Examples
is current_state DialogStateis current_state CombatState:DialogState
faction_reputation[edit | edit source]
Checks if an NPC's reputation meets a threshold.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").operator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".threshold: A string representation of an integer (e.g. "30", "-100"). Will be parsed and used as a numeric threshold in comparison.
Examples
is faction_reputation npc_maple,less_than,30is faction_reputation npc_maple,less_or_equal,60
has_bag[edit | edit source]
Check to see how many items are in the character's bag. It doesn't count invisible items.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").operator: Numeric comparison operator. Accepted values areless_than,less_or_equal,greater_than,greater_or_equal,equalsandnot_equals.value: The value to compare the bag with.
Examples
is has_bag player,equals,5(player's bag: 5 potions and 2 tuxeball (5 items), in this case is true because 5 = 5)is has_bag player,equals,9(player's bag: 5 potions and 2 tuxeball (5 items), in this case is false because 9 != 5)
has_item[edit | edit source]
Check to see if a NPC inventory contains something.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").item: The item slug name (e.g. "item_cherry").operator: Numeric comparison operator. Accepted values areless_than,less_or_equal,greater_than,greater_or_equal,equalsandnot_equals.quantity: Quantity to compare with. (optional)
Examples
is has_item player,potionis has_item player,potion,greater_than,2
has_kennel[edit | edit source]
Check to see how many monsters are in the character's box.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").operator: Numeric comparison operator. Accepted values areless_than,less_or_equal,greater_than,greater_or_equal,equalsandnot_equals.value: The value to compare the party with.box: The box name.
Examples
is has_kennel player,Kennel,less_than,1
has_monster[edit | edit source]
Check to see if a character has a monster in its party.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").monster_slug: Monster slug name (e.g. "rockitten").
Examples
is has_monster player,rockitten
has_party_breeder[edit | edit source]
Check to see if the character has a male and female monsters not basic (first evolution stage) in the party.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").
Examples
is has_party_breeder player
has_tech[edit | edit source]
Check to see if the player has a technique in his party (one of the monsters).
Parameters
technique: Technique slug name (e.g. "bullet").
Examples
is has_tech bullet
has_tuxepedia[edit | edit source]
Check if a monster is registered in Tuxepedia.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").monster: Monster slug name (e.g. "rockitten").label: Either "seen" or "caught".
Examples
is has_tuxepedia player,rockitten,caught
kennel[edit | edit source]
Check if a kennel is hidden or visible.
Note: This condition checks if the kennel is in the HIDDEN_LIST. If the kennel is in the list, it is considered hidden; otherwise, it is considered visible.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").kennel: The name of the kennel to check.option: The expected visibility of the kennel ("hidden" or "visible") or existence of it ("exist").
Examples
is kennel player,Kennel,hiddenis kennel player,Kennel,visibleis kennel player,Kennel,exist
location_inside[edit | edit source]
Check to see if the player is inside.
Examples
is location_inside
location_name[edit | edit source]
Check to see if the player is in a certain location name.
Parameters
technique: Slug name. It's the name inside the maps. eg.<property name="slug" value="routeb"/>, so slug = routeb
Examples
is location_name routebis location_name routea:routeb
location_type[edit | edit source]
Determines whether the player is currently in a specified location type.
Parameters
slug: A string identifier for the location type. Acceptable values: "all" (matches any location)
Examples
is location_type townis location_type town:shop:clinic
money_is[edit | edit source]
Check to see if the player has a certain amount of money (pocket).
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").operator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".amount: Amount of money or value stored in variable.
Examples
is money_is player,>=,500is money_is player,equals,name_variable(name_variable:75)
monster_flair[edit | edit source]
Check if any monster in the character's party has a flair matching the given category and name.
Parameters
character: Either "player" or an NPC slug name (e.g. "npc_maple").category: Category of the flair to check.name: Name of the flair to match.
Behavior
- Returns True if any monster in the character's party has a flair in the given category with the specified name.
- Returns False if no match is found or the character is invalid.
Examples
monster_flair player,category,name
music_playing[edit | edit source]
Check to see if the specified music file is currently playing.
Parameters
music_file: The music file to check.
Examples
is music_playing 472452_8-Bit-Ambient.ogg
one_of[edit | edit source]
Check to see if at least 1 among multiple values in a variable is True. If the variable does not exist it will return ``False``.
Parameters
variable: The variable to check.values: Value to check for (multiple values separated by ":").
Examples
is one_of stage_of_day,afternoon:dusk:morning
party_infected[edit | edit source]
Check to see how many monster are infected in the character's party.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").plague_slug: The slug of the plague to target.value: all, some or none.
Examples
is party_infected plague_slug,some
party_size[edit | edit source]
Check the character's party size. The check parameter can be: equals, less_than, or greater_than.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").operator: Numeric comparison operator. Accepted values areless_than,less_or_equal,greater_than,greater_or_equal,equalsandnot_equals.party_size: The size of the party to check against.
Examples
is party_size less_than,1not party_size equals,0is party_size greater_than,4
party_status[edit | edit source]
Check how many monsters in a character's party have a specific status.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").operator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".value: Integer to compare against.status_name: Slug of the status to check (e.g. "poison").
Examples
is party_status plague_slug,less_than,3,poison
step_tracker[edit | edit source]
Evaluates whether a step tracker exists for a character or if a milestone has been reached.
Parameters
character: Either "player" or an NPC slug name (e.g., "npc_maple").tracker_id: Unique name for identifying the step tracker.milestone: Step milestone to check.
Examples
is step_tracker npc_maple,tracker_id,50not step_tracker npc_maple,tracker_id,100
tile_property_updated[edit | edit source]
Checks whether all relevant tiles in the world have been modified with a specific property.
Parameters
label: The property name to check (e.g., terrain type).moverate: The expected movement rate value.
Examples
is tile_property_updated surfable,1.0
timestamp_cooldown[edit | edit source]
Checks if a specified number of seconds has passed since the event last ran. This allows for more precise cooldowns than the "once per day" check.
Parameters
timeframe: The number of seconds the event should be on cooldown.variable: The game variable where the cooldown timestamp is stored.
Examples
is timestamp_cooldown 69,variable_name
to_use_tile[edit | edit source]
Check if we are attempting interact with a map condition tile.
Parameters
None
Examples
is to_use_tile
tracker[edit | edit source]
Check to see if tracker exists.
Parameters
character: Either "player" or npc slug name (e.g. "npc_maple").map_name: The name of the map to validate against.
Examples
is tracker player,paper_town
true[edit | edit source]
The true condition will always evaluate to *True* (unless the "not" operator is used)
Parameters
None
Examples
is truenot true
tuxepedia[edit | edit source]
Check Tuxepedia's progress.
Parameters
operator: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".percentage: Number between 0.1 and 1.0total: Total, by default the total number of tuxemon.
Examples
is tuxepedia less_than,0.2is tuxepedia less_than,0.2,10
variable_highest[edit | edit source]
Check if a specific variable is the highest among the others.
Parameters
key_to_check: Key to check.keys_to_check: List of the keys among to check separated by ':'
Examples
is variable_highest jimmy,arthur:jimmy:clara
variable_is[edit | edit source]
Check an operation over a variable.
Parameters
value1: Either a variable or a number.operation: Numeric comparison operator. Accepted values are "less_than", "less_or_equal", "greater_than", "greater_or_equal", "equals" and "not_equals".value2: Either a variable or a number.
Examples
is variable_is [value1],operator,[value2]
variable_lowest[edit | edit source]
Check if a specific variable is the lowest among the others.
Parameters
key_to_check: Key to check.keys_to_check: List of the keys among to check separated by ':'
Examples
is variable_lowest jimmy,arthur:jimmy:clara
variable_set[edit | edit source]
Checks if one or more player game variables exist and optionally match specified values. If a variable does not exist, the condition returns `False`.
Parameters
variable_name:value:variable_name: The variable to check.value: Optional value to check against. If omitted, the condition only checks for the variable's existence.
The condition returns `True` if all specified variables exist and match their given values (if provided). Otherwise, it returns `False`.
Examples
is variable_set battle_won:yesnot variable_set current_badges:4is variable_set <variable>[:value],[<variable>[:value] ...]