M.U.G.E.N, (c) Elecbyte 1999-2013
Documentation for version 1.1 (2013)
Updated 09 June 2013
Contents
This is an alphabetical index of function-type triggers. For details on use of function-type triggers in expressions, see the expression documentation. Unless otherwise specified, we will use P1 to represent the player who is evaluating the trigger, and P2 to represent his opponent (usually the closest opponent when in team mode).
Some triggers are nonstandard and cannot take expressions as their arguments. These are marked with a (*) in the index. Some triggers are deprecated; these are marked with a (**). Use of these triggers is not encouraged, as support for them may be removed in future versions of the engine.
Old-style triggers, marked (***), appear only in clauses of the form (trigger) (relational operator) (value). See section 8 of exp.doc for more details.
Triggers used for math are marked with (math).
For all triggers, bottom will be returned if the trigger is redirected to a nonexistent destination, or if the ID number for the redirection evaluates to bottom. This is not listed in the error conditions for each trigger.
Computes the absolute value of its argument.
Computes the arccosine (in radians) of the specified argument.
Example:
value = acos(1) Sets value to the arccosine of 1, which is approximately 0.0 (possibly with some rounding error.)
Returns the difficulty level of the player's AI.
Example:
trigger1 = Random < AILevel * 10 Triggers with 10% probability at AILevel 1, 20% at AILevel 2, etc.
Returns 1 if the player is still able to fight, 0 if the player has been KOed.
Example:
trigger1 = Alive = 0 Triggers if the player has been KOed.
Returns the current animation action number of the player.
Example:
trigger1 = Anim = 200 Triggers if the player is currently in action 200.
Gets the animation-time elapsed since the start of a specified element of the current animation action. Useful for synchronizing events to elements of an animation action. (reminder: first element of an action is element 1, not 0)
AnimElemTime has similar functionality to AnimElem, but can take expressions as its argument.
Trigger in Format 1 is true if the player's animation is at the start of the element number specified by value1. In other words, if value1 is equal to n, it is true on the first game-tick of the nth element of the animation.
Trigger in Format 2 compares the player's animation-time to t+value2, where t is time of the start of the element number specified by value1.
Examples:
trigger1 = AnimElem = 2 True on the first game-tick that the player's animation is on element 2. Is equivalent to saying: trigger1 = AnimElem = 2, = 0 trigger1 = AnimElem = 2, = 4 True 4 game-ticks after the start of the player's second animation element. trigger1 = AnimElem = 2, >= 0 trigger1 = AnimElem = 3, < 0 True for the whole of the second element of the player's animation, assuming there is a third element. If a third element does not exist, the second line should read, trigger1 = AnimTime <= 0
Returns the number of the animation element in the current action that would be displayed at the specified time. The argument to AnimElemNo represents the time to check, expressed in game ticks, relative to the present.
Examples:
trigger1 = AnimElemNo(0) = 2 True when the animation element to be displayed 0 ticks in the future (i.e., now) is element 2. This is equivalent to: trigger1 = AnimElem = 2, >= 0 trigger1 = AnimElem = 3, < 0 trigger1 = AnimElemNo(2) = 4 True when the animation element that will be displayed two ticks from now is element 4. This is equivalent to: trigger1 = AnimElem = 4, >= -2 trigger1 = AnimElem = 5, < -2
Gets the animation-time elapsed since the start of a specified element of the current animation action. Useful for synchronizing events to elements of an animation action. (reminder: first element of an action is element 1, not 0)
Examples:
trigger1 = AnimElemTime(2) = 0 True on the first game-tick that the player's animation is on element 2. Is equivalent to saying: trigger1 = AnimElem = 2 trigger1 = AnimElemTime(2) = 4 True 4 game-ticks after the start of the player's second animation element. trigger1 = AnimElemTime(2) >= 0 trigger1 = AnimElemTime(3) < 0 True for the whole of the second element of the player's animation, assuming there is a third element. If a third element does not exist, the second line will evaluate to bottom and hence trigger1 will never trigger. In this case, the second line should read, trigger1 = AnimTime <= 0
Returns 1 if the specified animation action exists for the player. The result of this trigger is undefined if the player has been placed in a custom state by a successful hit. In this situation, use SelfAnimExist.
Example:
trigger1 = !AnimExist(200) Triggers if the player is missing action 200.
Gives the difference between the looptime of the current animation action and the player's animation-time. Useful for knowing when the end of the animation has been reached. (Animation-time is the time in game-ticks that the player has spent within the current animation action.) The name may be confusing. Try to think of it as "time from the end of the animation". During the animation, AnimTime will always return a non-positive number.
Example:
trigger1 = AnimTime = 0 Triggers when the animation-time is equal to the animation action's looptime, ie. the end of the action has been reached.
Computes the arcsine (in radians) of the specified argument.
Example:
value = asin(1) Sets value to the arcsine of 1, which is approximately pi/2 (possibly with some rounding error.)
Computes the arctangent (in radians) of the specified argument.
Example:
value = atan(1) Sets value to the arccosine of 1, which is approximately pi/4 (possibly with some rounding error.)
Returns the player's author's name (specified in the .DEF file). This may also be useful for telling apart characters with the same name but different authors.
Example:
trigger1 = Authorname = "Suika" Returns true if the character's author is named Suika.
BackEdge returns the x position of the edge of the screen that is behind the player, in absolute stage coordinates.
Example:
trigger1 = Pos X + CameraPos X < BackEdge Triggers if the player is to the left of the back edge of the screen.
BackEdgeBodyDist gives the distance from the back of the player, as determined by the end of his width bar, to the back edge of the screen.
Example:
trigger1 = BackEdgeBodyDist < 30 Triggers if the back of the player’s width bar is within 30 pixels of the edge of the screen in back of him.
BackEdgeDist gives the distance between the x-axis of the player and the edge of the screen behind of the player.
Example:
trigger1 = BackEdgeDist < 30 Triggers if the x-axis of the player is within 30 pixels of the edge of the screen in back of him.
BottomEdge returns the y position of the bottom edge of the screen, in absolute stage coordinates.
Example:
trigger1 = Pos Y < BottomEdge Triggers if the player is above the bottom edge of the screen.
Gets the value of the camera's position relative to the stage.
The home position of the camera is 0, 0. The value of "CameraPos X" increases as the camera moves to the right. The value of "CameraPos Y" decreases as the camera moves upwards.
The units of the position returned is in the coordspace of the player.
Example:
trigger1 = CameraPos X >= 0 True when the camera is to the left of the center of the stage.
Gets the value of the camera's zoom factor.
Example:
fvar(1) = CameraZoom * ScreenWidth Sets fvar(1) to the distance between the left and right edges of the screen. The expression "CameraZoom * ScreenWidth" is equivalent to the GameWidth trigger.
If the player is currently in a falling state, returns 1 if he is currently able to recover, and 0 if he is not currently able to recover. If the player is not currently falling, the output of this trigger is undefined.
Implements the "ceiling" function. Returns the least integer which is greater than or equal to the specified argument.
Example:
1. value = ceil(5.5) Sets value to 6. 2. value = ceil(-2) Sets value to -2.
Triggers if the user has input the specified command.
Example:
trigger1 = Command = "fireball motion" True if the user inputs the command corresponding to the command name "fireball motion".
This trigger takes three arguments. The first argument is a condition argument. If the condition is true (i.e., nonzero), Cond evaluates and returns the second argument. If the condition is false, Cond evaluates and returns the third argument. If the condition is bottom, then Cond returns bottom without evaluating the second or third arguments.
In all cases, any unused argument(s) are not evaluated. Therefore, Cond can be used instead of IfElse to avoid any side effects that would be caused by evaluating the unused argument (e.g., variable assignment, or performing a computation that would cause bottom to be generated).
Example:
value = Cond(var(3),1,2) Sets value to 1 if var(3) is not zero, and sets value to 2 if var(3) is 0.
Returns the value of one of the player's constants.
Error conditions: none
The following values of param_name return values specified in the [Data] group in the player's constants.
The following values of param_name return values specified in the [Size] group in the player's constants.
The following values of param_name return values specified in the [Velocity] group in the player's constants.
The following values of param_name return values specified in the [Movement] group in the player's constants.
Example:
trigger1 = Const(velocity.walk.fwd.x) > 4 Triggers if the forward walking velocity is greater than 4.
Converts a value from the 240p coordinate space to the player's coordinate space. The conversion ratio between coordinate spaces is the ratio of their widths.
Example:
value = Const240p(3) Sets value 3 if the player has a coordinate space of 320x240 (240p). Sets value 6 if the player has a coordinate space of 640x480 (480p). Sets value 12 if the player has a coordinate space of 1280x720 (720p).
Converts a value from the 480p coordinate space to the player's coordinate space. The conversion ratio between coordinate spaces is the ratio of their widths.
Example:
value = Const480p(6) Sets value 3 if the player has a coordinate space of 320x240 (240p). Sets value 6 if the player has a coordinate space of 640x480 (480p). Sets value 12 if the player has a coordinate space of 1280x720 (720p).
Converts a value from the 720p coordinate space to the player's coordinate space. The conversion ratio between coordinate spaces is the ratio of their widths.
Example:
value = Const720p(12) Sets value 3 if the player has a coordinate space of 320x240 (240p). Sets value 6 if the player has a coordinate space of 640x480 (480p). Sets value 12 if the player has a coordinate space of 1280x720 (720p).
Computes the cosine of the specified argument (in radians.)
Example:
value = cos(0) Sets value to the cosine of 0, which is approximately 1.0 (possibly with some rounding error.)
Returns the control flag of p1.
Example:
trigger1 = Ctrl Triggers if the player has control.
Returns 1 if the player (or the player's team, in team mode) has ended the round in a draw, 0 otherwise.
Examples:
trigger1 = DrawGame Triggers if the player (or team) ended round in a draw.
Returns the value of e (2.718281828...)
Computes the exponential of the argument (e raised to the power of the argument.) This produces slightly more accurate results than the equivalent expression e**(argument).
Example:
value = exp(4-var(0)) Sets value to e raised to the quantity 4-var(0).
Returns 1 if the player is facing to the right, and -1 if the player is facing to the left.
Example:
Trigger = Facing = -1 Triggers if the player is facing toward the left of the screen.
Implements the floor function. Returns the greatest integer less than or equal to its argument.
Examples:
1. value=floor(5.5) Sets value to 5. 2. value=floor(-2) Sets value to -2.
FrontEdge returns the x position of the edge of the screen that is in front the player, in absolute stage coordinates.
Example:
trigger1 = facing * (Pos X + CameraPos X) < facing * (FrontEdge) Triggers if the player is behind the front edge of the screen.
FrontEdgeBodyDist gives the distance between the front of the player (as determined by the front edge of his width bar) and the edge of the screen.
Example:
trigger1 = FrontEdgeBodyDist < 30 Triggers if the front of the player is within 30 pixels of the edge of the screen in front of him.
FrontEdgeDist gives the distance between the x-axis of the player and the edge of the screen in front of the player.
Example:
trigger1 = FrontEdgeDist < 30 Triggers if the x-axis of the player is within 30 pixels of the edge of the screen in front of him.
This trigger takes a mandatory variable number as an argument. It returns the value of the player's specified float variable.
Example:
trigger1 = FVar(5) = -1.23 Triggers if the value of float variable 5 is -1.23.
Returns the current height of the game space in the player's local coordinate space. The game space is defined as the currently-visible area of the stage in which players interact. The dimensions of the game space at a zoom factor of 1.0 is specified by the GameWidth and GameHeight parameters in mugen.cfg.
GameWidth and GameHeight scale inversely with the zoom factor of the camera. For example, if the camera zoom factor is 0.5, the values returned by GameWidth and GameHeight will be double that of at zoom factor 1.
ScreenWidth and ScreenHeight are the equivalent triggers that are not affected by the camera zoom factor.
Example:
trigger1 = ScreenPos Y < GameHeight / 2 Triggers if the player is above the center of the screen.
Returns the total number of ticks that have elapsed in the game so far.
Example:
trigger1 = (GameTime % 27) = 0 Triggers every 27th game tick.
Returns the current width of the game space in the player's local coordinate space. The game space is defined as the currently-visible area of the stage in which players interact. The dimensions of the game space at a zoom factor of 1.0 is specified by the GameWidth and GameHeight parameters in mugen.cfg.
GameWidth and GameHeight scale inversely with the zoom factor of the camera. For example, if the camera zoom factor is 0.5, the values returned by GameWidth and GameHeight will be double that of at zoom factor 1.
ScreenWidth and ScreenHeight are the equivalent triggers that are not affected by the camera zoom factor.
Example:
trigger1 = ScreenPos X >= GameWidth / 2 Triggers if the player is to the right of the center of the screen.
When the player is in a gethit state, returns the value of the specified hit parameter.
Example:
trigger1 = GetHitVar(yvel) < -5.5 Triggers if the hit's specified y velocity is less than -5.5.
Returns the number times the player's current attack move has hit one or more opponents. This value is valid only for a single state; after any state change, it resets to 0. To prevent it from resetting to 0, set hitcountpersist in the StateDef (see cns documentation for details). The HitCount and UniqHitCount triggers differ only when the player is hitting more than one opponent. In the case where the player is hitting two opponents with the same attack, HitCount will increase by 1 for every hit, while UniqHitCount increases by 2.
Example:
trigger1 = HitCount > 8 Triggers when more than 8 hits have been dealt to the opponent since the start of the player's attack move.
Checks the attribute parameter of the player's currently-active HitDef. If the player is not currently attacking, then no parameters will match. Can be used for simple move-interrupts from weaker to stronger attacks in the CMD file.
Note: HitDefAttr != value1, value2 is logically equivalent to !(HitDefAttr = value1, value2).
A set of 2-character strings, separated by commas. Each 2-character string must be of the form described: The first character is either "N" for "normal", "S" for "special", or "H" for "hyper". The second character must be either "A" for "attack" (a normal hit attack) or "T" for "throw". For example, "NA, ST" is for normal attacks and special throws.
Assuming the attribute of the player's HitDef is in the form:
arg1, arg2
then the trigger condition is determined to be true only if arg1 is a subset of value1, AND arg2 is a subset of value2.
See the "attr" parameter of the HitDef controller in Appendix B for details.
Example:
trigger1 = HitDefAttr = A, HA Triggers when the player is in an attack state, where the current HitDef has the following attributes: 1. is an aerial attack and 2. is a hyper (super) attack trigger1 = HitDefAttr = SC, NA, SA Triggers when the player is in an attack state, where the current HitDef has the following attributes: 1. is either a standing or a crouching attack and 2. is either a normal attack or a special attack
If the player is currently in a gethit state, returns the fall flag of the hit. The output of this trigger is undefined if the player is not in a gethit state. For an explanation of the fall flag, see the HitDef documentation.
Example:
trigger1 = !HitFall Triggers if the hit did not put the player into a fall state.
If the player is in a gethit state, returns 1 when the hittime has expired, and 0 otherwise. For an explanation of hittime, see the HitDef documentation.
Example:
trigger1 = HitOver = 1 Triggers when the player’s hittime has expired.
Returns the time until the player's hitpause expires. The player enters a hitpause when his attack comes in contact with an opponent. The initial hitpause time is equal to the first value of the pausetime parameter in the player's HitDef. If ignorehitpause is not set, this will always return 0.
Example:
trigger1 = HitPauseTime = 0 Triggers when the player is not paused for a hit.
If the player is in a gethit state, returns 1 if the hit shake (the period when he is shaking in place) has ended, and 0 otherwise.
Example:
trigger1 = HitShakeOver = 0 Triggers if the player is still shaking from the hit.
Gets the value of the velocity imparted to the player by a hit. You must specify the component that you want to check, eg. "HitVel Y" to check the vertical velocity component.
Example:
trigger1 = HitVel X > 0.5 True when the player's gethit x-velocity is greater than 0.5 pixels per tick.
Returns the ID number of the player. The ID number is unique for every player throughout the course of a match. Any helper that is created during this time will also receive its own unique ID number. This trigger may be useful for getting opponents' ID numbers, to be later used with the "playerID" redirection keyword (see exp docs). Do not confuse playerID with targetID.
Example:
value = ID This sets value to the ID number of the current player. value = EnemyNear, ID This sets value to the ID number of the nearest opponent.
This trigger takes three arguments. If the first is nonzero, IfElse returns the value of the second argument. Else, it returns the value of the third argument. All arguments are evaluated prior to execution of IfElse. In particular, any side effects caused by evaluation of the arguments (such as variable assignment, or performing a computation that generates a warning) will occur. If you wish to avoid these side effects, then use Cond.
Example:
value = ifelse(var(3),1,2) Sets value to 1 if var(3) is not zero, and sets value to 2 if var(3) is 0.
Returns 1 if the player is within guarding distance of an opponent's physical or projectile attack. The guarding distance is the value of the guard.dist parameter of the opponent's HitDef. Returns 0 if out of guard distance, or the opponent is not attacking.
This trigger takes an optional ID number as an argument. If the ID number is omitted, IsHelper returns 1 if the player is a helper character, and 0 otherwise. If the ID number is included, then IsHelper returns 1 if the player is a helper character with the specified ID number, and 0 otherwise.
Examples:
1. trigger1 = !IsHelper Triggers if the player is not a helper-type character. 2. trigger1 = IsHelper(1234) Triggers if the player is a helper character with ID number 1234.
Returns 1 if the player's team is considered the "home team". In arcade modes, the computer is always considered the home team. In versus modes, P1's side (left) is the home team.
LeftEdge returns the x position of the left edge of the screen, in absolute stage coordinates.
Example:
trigger1 = Pos X + CameraPos X < LeftEdge Triggers if the player is to the left of the left edge of the screen.
Returns the player's life.
Example:
trigger1 = life <= 10 Triggers if the player has 10 or less life points remaining.
Returns the maximum amount of life the player can have. This is normally the value of the "life" parameter in the [Data] group of the player variables, but may be different in situations such as team modes.
Example:
trigger1 = life < lifemax / 4 Triggers if the player has less than 1/4 of his maximum life.
Returns the natural logarithm of its argument. This produces slightly more accurate results than the otherwise equivalent expression log(e,(argument)).
Example:
value = ln(time) Sets value to the natural logarithm of the player's statetime.
Takes two arguments a and b, and returns the base-a logarithm of b.
Example:
value=log(2,64) Sets value to the base 2 log of 64, which is 6.0.
Returns 1 if the player (or the player's team, in team mode) has lost the round, 0 otherwise. Can be suffixed with "KO" or "Time" to return 1 only when the round has been lost by a KO or by time expiring, respectively.
Examples:
1. trigger1 = Lose Triggers if the player (or his team) has lost the round. 2. trigger1 = !LoseKO Triggers if the player (or his team) has not lost the round by a KO. For example, this will trigger if the player's team has not yet lost the round, or if they have lost the round by time over.
Returns the current match number.
Returns 1 if the match has ended. (For example, in the case of a best-of-three match, this will return true when one of the players or teams has won two rounds.)
Example:
trigger1 = !matchover Triggers if the match is not over. For instance, the current round may not yet have ended, or it may have ended without deciding the match.
This trigger is valid only when the player is in an attack state. MoveContact gives a non-zero value if P2 has either been hit, or has guarded P1's attack. It gives 0 otherwise. P1 is the player, and P2 is his opponent. Typically used with the "StateNo" and "Command" triggers for detecting move-interrupts in the CMD file.
On attack contact, MoveContact returns 1. After contact, MoveContact's return value will increase by 1 for each game tick that P1 is not paused (P1 gets paused on contact; see pausetime parameter in HitDef controller). The values of MoveGuarded, MoveHit and MoveReversed increment in the same fashion.
Note 1: the values of MoveContact, MoveGuarded, MoveHit and MoveReversed are set simultaneously. For example, if one HitDef in a move hits successfully, MoveHit will return non-zero. If a following HitDef in the same move is guarded, MoveGuarded will return non-zero, and the other three triggers will return 0.
Note 2: the values of the four Move* triggers reset to 0 and stop incrementing after a state transition. See "movehitpersist" parameter for StateDefs (CNS docs) for how to override this behavior.
Examples:
trigger1 = MoveContact True if P1's attack did not miss P2. trigger1 = MoveContact = 1 True from the time P1's attack came in contact with P2, until just after P1's pausetime wears off.
This trigger is valid only when the player is in an attack state. MoveGuarded gives a non-zero value if P2 is guarding, or has guarded, P1's attack. It gives 0 otherwise. P1 is the player, and P2 is his opponent. Typically used with the "StateNo" and "Command" triggers for detecting move-interrupts in the CMD file.
Example:
trigger1 = MoveGuarded True if P1's attack was guarded by P2.
This trigger is valid only when the player is in an attack state. MoveHit gives a non-zero value if P2 has been hit by P1's attack. It gives 0 otherwise. Typically used with the "StateNo" and "Command" triggers for detecting move-interrupts in the CMD file.
Example:
trigger1 = MoveHit True if P1's attack connected successfully with P2.
MoveType gives the player's move-type. Refer to the section on StateDef in the CNS documentation for more details on MoveType. Useful for "move interrupts" in the CMD file.
Example:
trigger1 = movetype != H Triggers if the player is not currently in a gethit-type state.
This trigger is valid only when the player is in an attack state. MoveReversed gives a non-zero value if P1's attack has been reversed by P2. It gives 0 otherwise.
Example:
trigger1 = MoveReversed True if P1's attack was reversed by P2.
Returns the player's name (the internal name specified in the .DEF file, which may not be the same as the displayed name).
Example:
trigger1 = Name = "Kumquat" Returns true if the player is named Kumquat.
NumEnemy returns the number of opponents that exist. Neutral players and normal helpers are not considered opponents.
Examples:
trigger1 = NumEnemy = 2 trigger1 = enemynear(1), name = "Squash" Triggers if there are 2 opponents, and the second-closest one is named Squash.
This trigger takes an ID number as an optional argument. If the ID number is omitted, NumExplod returns the number of explods owned by the player. If the ID number is included, then NumExplod returns the number of explods with that ID number that are owned by the player. The ID number must be greater than -1. An ID number of -1 or less will give the same behavior as if the ID number is omitted.
Examples:
1. trigger1 = NumExplod >= 4 Triggers if the player currently owns 4 or more explods. 2. trigger1 = NumExplod(1234) >= 4 Triggers if the player currently owns 4 or more explods with ID 1234.
This trigger takes an ID number as an optional argument. If the ID number is omitted, then NumHelper returns the total number of helpers currently owned by the player. If the ID number is included, then NumHelper returns the total number of helpers with that ID number owned by the player. The ID number must be greater than 0. If the ID number is 0 or less, then all helpers are counted.
Examples:
1. trigger1 = NumHelper < 2 Triggers if the player now has less than 2 helpers. 2. trigger1 = NumHelper(1234) < 2 Triggers if the player now has less than 2 helpers with ID 1234.
NumPartner returns the number of partners that exist. Neutral players and normal helpers are not considered partners.
Examples:
trigger1 = NumPartner = 1 trigger1 = partner, life < 200 Triggers if the player has a partner with less than 200 life
Returns the total number of projectiles currently owned by the player.
Example:
trigger1 = NumProj = 0 Triggers if the player has no currently active projectiles.
This trigger takes an ID number as a required argument. It returns the number of projectiles currently owned by the player and having the specified ID number.
Example:
trigger1 = NumProjID(1234) = 1 Triggers if there the player currently owns exactly 1 projectile with the ID number 1234.
This trigger takes an ID number as an optional argument. If the ID number is omitted, NumTarget returns the current number of targets for the player. If the ID number is included, then NumTarget returns the number of targets for the player which have that target ID number. The ID number must be greater than -1. An ID number of -1 or less will give the same behavior as if the ID number is omitted.
Examples:
1. trigger1 = NumExplod >= 4 Triggers if the player currently owns 4 or more explods. 2. trigger1 = NumExplod(1234) >= 4 Triggers if the player currently owns 4 or more explods with ID 1234.
This is an alias for the Name trigger. See "Name".
Returns the distance of P2 from P1, where P1 is the player, and P2 is his opponent. P2BodyDist is useful in the CMD for cases where P1 has an attack that is different when performed close to P2.
For comparing the Y-distance, P2BodyDist gives the difference in the heights of the players' Y-axes. A negative value means that P2 is above P1.
For comparing the X-distance, P2BodyDist gives the X-distance of P2's front from P1's front. So, if the players are standing right next to each other, then P2BodyDist is 0. Remember that you can set the width of the player in "front.width", etc. under [Size] in the player variables.
See also P2Dist.
Example:
trigger1 = P2BodyDist X < 30 Triggers if the front of P2 is within 30 pixels of the front of P1.
Returns the distance of P2 from P1, where P1 is the player, and P2 is his opponent.
For comparing the Y-distance, P2Dist gives the difference in the heights of the players' Y-axes. A negative value means that P2 is above P1.
For comparing the X-distance, P2Dist gives the X-distance of P2's axis from P1's axis. A positive value indicates P2 is in front of P1. See also P2BodyDist.
Example:
trigger1 = P2Dist Y <= -12 True if P2 is at least 12 pixels higher up than P1.
Same as Life, except that this returns the opponent's life.
Same as MoveType, except that this returns the opponent's movetype.
Same as P1Name, except that this returns the name of the primary opponent (the opponent in versus mode, or the first opponent in team mode).
If there is no primary opponent, then p2name = "name" returns 0 no matter what name is specified. Similarly, p2name != "name" will return 1 no matter what name is specified.
Same as StateNo, except that this returns the opponent's state number.
Same as StateType, except that this returns the opponent's state type.
Same as P1Name, except that this returns the name of the player's teammate, if present.
If there is no teammate, then p3name = "name" returns 0 no matter what name is specified. Similarly, p3name != "name" will return 1 no matter what name is specified.
Same as P1Name, except that this returns the name of the secondary opponent, if present.
If there is no secondary opponent, then p4name = "name" returns 0 no matter what name is specified. Similarly, p4name != "name" will return 1 no matter what name is specified.
Returns the palette number of the player (i.e., the color scheme chosen for the character during character select.)
Example:
trigger1 = PalNo = 5 Returns true if the current palette number is 5.
This trigger is only valid for helper-type characters. ParentDist returns the distance from the helper to its parent. It works similarly to P2Dist.
Example:
trigger1 = ParentDist X != 0 Triggers if the parent is not at the exact same x-position as the helper character.
This trigger returns the numeric value of pi (3.141593...)
Gets the value of the player's position. You must specify the component that you want to check, eg. "Pos Y" to check the Y-position.
For "Pos X", the value is relative to the center of the screen (value 0). Negative is left, positive is right.
Due to historical reasons, "Pos X" does not return absolute position of the player (i.e. relative to the center of the stage), which may be the more intuitive behavior. To get the absolute position of the player, use "Pos X + CameraPos X".
For "Pos Y", the value is relative to the floor. Negative is higher up, positive is below the floor.
Example:
trigger1 = Pos Y >= 0 True when the player is below the floor.
Returns the amount of power the player has.
Example:
trigger1 = power >= 1000 True if player has at least 1000 power (level 1).
Returns the maximum amount of power the player can have. This is normally 3000 (level 3).
Example:
trigger1 = power < powermax / 2 True if player has less than half his maximum power.
Returns 1 if a player with the specified ID number exists, 0 otherwise. This ID number is obtained using the "ID" trigger (see ID). Do not confuse PlayerID with TargetID.
Example:
trigger1 = PlayerIDExist(var(4)) Triggers if a player with an ID number equal to the value of var(4) exists.
Returns the number of the state that the player was last in. The results of this trigger are not guaranteed to be accurate.
Example:
trigger1 = PrevStateNo = [200,650] Returns true if the player's last state number is between 200 and 650, inclusive.
This trigger takes an required nonnegative ID number as an argument. If the player's last projectile to make any kind of contact was cancelled by an opponent's projectile and had the specified ID number, then ProjCancelTime returns the number of ticks since that contact occurred. If the specified ID number is 0, then the projectile ID is not checked. If no projectile meets all the above conditions, then ProjCancelTime returns -1.
Examples:
1. trigger1 = ProjCancelTime(1234) = 1 Triggers if a projectile with ID 1234 was just cancelled by an opponent's projectile. 2. trigger1 = ProjCancelTime(0) != -1 && ProjCancelTime(0) < 15 Triggers if any of the player's projectiles were cancelled within last 15 ticks.
This trigger takes an optional ID number as a suffix. If the ID number is omitted, ProjContact returns true if any of the player's projectiles either successfully hit the opponent or were guarded by the opponent. When the ID number is specified, ProjContact returns true only if any of the player's projectiles with the specified ID number either successfully hit the opponent or was guarded.
ProjContact will trigger once for each hit of the projectile, so a multi-hit projectile can trigger multiple times.
The first form of ProjContact shown above is only valid for one tick after contact, unlike MoveContact.
For the second form, ProjContact returns true if the projectile made contact n ticks ago, where n is a nonnegative number satisfying the relation "n [oper] value2".
Specifying an ID number of 0 gives the same behavior as if the ID number is omitted (check all projectiles).
Examples:
1. trigger1 = ProjContact1234 = 1 Triggers if a projectile with ID 1234 just made contact with the opponent. 2. trigger1 = ProjContact456 = 0, < 15 Triggers if no projectile with ID 456 made contact in the last 15 ticks.
This trigger takes an required nonnegative ID number as an argument. If the player's last projectile to make any kind of contact, made contact with the opponent and had the specified ID number, then ProjContactTime returns the number of ticks since that contact occurred. If the specified ID number is 0, then the projectile ID is not checked. If no projectile meets all the above conditions, then ProjContactTime returns -1.
Examples:
1. trigger1 = ProjContactTime(1234) = 1 Triggers if a projectile with ID 1234 just made contact with the opponent. 2. trigger1 = ProjContactTime(0) != -1 && ProjContactTime(0) < 15 Triggers if any of the player's projectiles made successful contact with the opponent within the last 15 ticks.
This trigger takes an optional ID number as a suffix. If the ID number is omitted, ProjGuarded returns true if any of the player's projectiles were guarded by the opponent. When the ID number is specified, ProjGuarded returns true only if one of the player's projectiles with the specified ID number was guarded by the opponent.
ProjGuarded will trigger once for each hit of the projectile, so a multi-hit projectile can trigger multiple times.
The first form of ProjGuarded shown above is only valid for one tick after hit, unlike MoveGuarded.
For the second form, ProjGuarded returns true if the projectile was guarded n ticks ago, where n is a nonnegative number satisfying the relation "n [oper] value2".
Specifying an ID number of 0 gives the same behavior as if the ID number is omitted (check all projectiles).
Examples:
1. trigger1 = ProjGuarded1234 = 1 Triggers if the opponent just blocked a projectile with ID 1234. 2. trigger1 = ProjGuarded = 1, < 15 Triggers if the opponent blocked any projectile in the last 15 ticks.
This trigger takes an required nonnegative ID number as an argument. If the player's last projectile to make any kind of contact was guarded by the opponent and had the specified ID number, then ProjGuardedTime returns the number of ticks since that contact occurred. If the specified ID number is 0, then the projectile ID is not checked. If no projectile meets all the above conditions, then ProjGuardedTime returns -1.
Examples:
1. trigger1 = ProjGuardedTime(1234) = 1 Triggers if a projectile with ID 1234 was just guarded by the opponent. 2. trigger1 = ProjGuardedTime(0) != -1 && ProjGuardedTime(0) < 15 Triggers if any of the player's projectiles was guarded by the opponent within the last 15 ticks.
This trigger takes an optional positive ID number as a suffix. If the ID number is omitted, ProjHit returns true if any of the player's projectiles successfully hit the opponent. When the ID number is specified, ProjHit returns true only if one of the player's projectiles with the specified ID number successfully hit the opponent.
ProjHit will trigger once for each hit of the projectile, so a multi-hit projectile can trigger multiple times.
The first form of ProjHit shown above is only valid for one tick after hit, unlike MoveHit.
For the second form, ProjHit returns true if the projectile hit n ticks ago, where n is a nonnegative number satisfying the relation "n [oper] value2".
Specifying an ID number of 0 gives the same behavior as if the ID number is omitted (check all projectiles).
Examples:
1. trigger1 = ProjHit1234 = 1 Triggers if a projectile with ID 1234 just made successful contact with the opponent. 2. trigger1 = ProjHit1234 = 1, < 15 Triggers if any of the player's projectiles made successful contact with the opponent within the last 15 ticks.
This trigger takes an required nonnegative ID number as an argument. If the player's last projectile to make any kind of contact successfully hit the opponent and had the specified ID number, then ProjHit returns the number of ticks since that contact occurred. If the specified ID number is 0, then the projectile ID is not checked. If no projectile meets all the above conditions, then ProjHitTime returns -1.
Examples:
1. trigger1 = ProjHitTime(1234) = 1 Triggers if a projectile with ID 1234 just made successful contact with the opponent. 2. trigger1 = ProjHitTime(0) != -1 && ProjHitTime(0) < 15 Triggers if any of the player's projectiles made successful contact with the opponent within the last 15 ticks.
Returns a random number between 0 and 999, inclusive.
Example:
trigger1 = Random <= 249 Triggers if the random number returned is less than or equal to 249. (This occurs with 25% probability.)
RightEdge returns the x position of the right edge of the screen, in absolute stage coordinates.
Example:
trigger1 = Pos X + CameraPos X > RightEdge Triggers if the player is to the right of the right edge of the screen.
This trigger is only valid for helper-type characters. RootDist returns the distance from the helper to its root. The root is the main player character who owns the helper: for instance, if you select Kumquat to play with, and Kumquat spawns a helper named Kiwi, who in turn spawns a helper named Penguin, then Penguin's root is Kumquat, and Penguin is a descendant of Kumquat. RootDist works similarly to P2Dist.
For comparing the Y-distance, RootDist gives the difference in the heights of the players' Y-axes. A negative value means that the root is above its descendant.
For comparing the X-distance, ParentDist gives the X-distance of the root's axis from the descendant's axis. A positive value indicates the root is in front of its descendant.
Example:
trigger1 = RootDist X != 0 Triggers if the root is not at the exact same x-position as the helper character.
Returns the current round number.
Example:
trigger1 = RoundNo = 3 Triggers if this is the third round of the match.
Returns the number of rounds the player has existed for. On the first round, returns 0. This is useful for a Turns mode intro.
Example:
trigger1 = RoundsExisted = 0 trigger1 = TeamMode = Turns trigger1 = RoundNo > 0 Triggers if the player has just entered a Turns mode team match after the first round. You can use this example with a ChangeState controller to switch to an intro state by overriding the Initialize state (state 5900).
Returns the current round state number.
Example:
trigger1 = RoundState = 2 Triggers if the actual fighting portion of the round is in progress.
Gets the value of the player's position relative to the top-right corner of the screen.
For "ScreenPos X", the value is relative to the left of the screen (value 0). Negative is left, positive is right.
For "ScreenPos Y", the value is relative to the top of the screen. Negative is above the screen, positive is downward.
Example:
trigger1 = ScreenPos Y >= 0 && ScreenPos Y < GameHeight True when the player's is in the screen's vertical extent.
Returns the height of the screen space in the player's local coordinate space.
Example:
type = Explod space = screen pos = 0, ScreenHeight ... Creates an explod in screen-space in the lower-right corner of the screen.
Returns the width of the screen space in the player's local coordinate space.
Example:
type = Explod space = screen pos = ScreenWidth / 2, ScreenHeight / 2 ... Creates an explod in screen-space in the center of the screen.
Like AnimExist, except that this only checks P1's animation data. If P1 has been given P2's animation data by a hit, SelfAnimExist will not check P2's animation data to determine whether or not a given action exists.
Computes the sine of the specified argument (in radians.)
Example:
value = sin(pi/2) Sets value to the sine of pi/2, which is approximately 1.0 (possibly with some rounding error.)
Returns the player's current state number. Useful for "move interrupts" in the CMD file.
Example:
trigger1 = stateno = [200,650] Returns true if the state number is between 200 and 650, inclusive.
StateType gives the player's state-type. Refer to the section on StateDef in the CNS documentation for more details on StateType. Useful for "move interrupts" in the CMD file.
Example:
trigger1 = StateType != A Triggers if the player is not in an air-type state.
Returns information about the stage. A limited number of parameters are supported.
Example:
trigger1 = StageVar(info.author) = "Suika" Returns true if the stage author is named "Suika".
This trigger takes a mandatory variable number as an argument. It returns the value of the player's specified system float variable. This trigger should NOT be used under normal circumstances. System variables are reserved for bookkeeping in common1.cns.
Example:
trigger1 = SysFVar(0) = -1.23 Triggers if the value of system float variable 0 is -1.23.
This trigger takes a mandatory variable number as an argument. It returns the value of the player's specified system int variable. This trigger is NOT to be used under normal circumstances. System variables are reserved for bookkeeping in common1.cns.
Example:
trigger1 = SysVar(0) = -34 Triggers if the value of system variable 0 is -34.
Computes the tangent of the specified argument (in radians.)
Example:
value = tan(pi/4) Sets value to the tangent of pi/4, which is approximately 1.0 (possibly with some rounding error.)
TeamMode gives the current mode of play for the player's team.
Example:
trigger1 = TeamMode = Single Triggers if the player is playing in single play.
Returns the team side the player is on. 1 represents P1 side (left), 2 for P2 side (right).
Example:
trigger1 = TeamSide = 2 Triggers if player is on the P2 side team.
Returns the number of ticks per second. Useful for time calculations.
Example:
trigger1 = Time > 10 * TicksPerSecond Triggers after 10 seconds, regardless of game speed.
Returns the state-time of the player (that is, the number of ticks that the player has been in the current state so far).
Example:
trigger1 = Time = 2 Triggers when the player's state-time is 2.
Returns the remainder when the state-time of the player is divided by the specified value.
The % operator subsumes the functionality of TimeMod, so it is recommended that you use % instead.
Example:
trigger1 = TimeMod = 4, 3 Triggers when the state-time is 3, 7, 11, 15, ...
TopEdge returns the y position of the top edge of the screen, in absolute stage coordinates.
Example:
trigger1 = Pos Y > TopEdge Triggers if the player is below the top edge of the screen.
Returns the total number of hits the player's current attack move has done. This value is valid only for a single state; after any state change, it resets to 0. To prevent it from resetting to 0, set hitcountpersist in the StateDef (see cns documentation for details). The HitCount and UniqHitCount triggers differ only when the player is hitting more than one opponent. In the case where the player is hitting two opponents with the same attack, HitCount will increase by 1 for every hit, while UniqHitCount increases by 2.
Example:
trigger1 = UniqHitCount = [4,6] Triggers when 4, 5 or 6 hits have been dealt since the start of the player's attack move.
This trigger takes a mandatory variable number as an argument. It returns the value of the player's specified int variable.
Example:
trigger1 = Var(0) = -34 Triggers if the value of variable 0 is -34.
Gets the value of the player's velocity. You must specify the component that you want to check, eg. "Vel Y" to check the Y-velocity.
Example:
trigger1 = Vel Y >= 0 True when the player is not moving upward.
Returns true if the player (or the player's team, in team mode) has won the round, false otherwise. Can be suffixed with "KO", "Time", or "Perfect" to return true only when the round has been won by a KO, by time expiring, or with no life lost, respectively.
Format: 1. Win 2. WinKO 3. WinTime 4. WinPerfect
Examples:
1. trigger1 = Win Triggers if the player (or his team) has won the round. 2. trigger1 = !WinKO Triggers if the player (or his team) has not won the round by a KO. For example, this will trigger if the player's team has not yet won the round, or if they have won the round by time over.