Skip to content
PotS edited this page Feb 13, 2025 · 103 revisions

The triggers listed in this page are completely new to Ikemen GO.

Refer to the sidebar for quicker navigation.

Redirects the trigger to the helper entity by index.

Each helper is assigned an index according to their position among the total number of helpers a player has. These indexes begin at 1, with index 0 being a special case that represents the root player. A player with 5 helpers, for instance, will have helpers with indexes 1 through 5.

trigger1 = NumHelper >= 2
trigger1 = HelperIndex(2), MoveType = A

Nightly build:

In the nightly build, the trigger has been refactored, now it takes redirections into account, allowing the return of a helper's helpers. The old usage still works if the trigger is called from the Root. If you need the same result but the call comes from a helper, use: Root, HelperIndex(1).

trigger1 = HelperIndexExist(2)
trigger1 = HelperIndex(2), MoveType = A

Redirects the trigger to the same player as the "P2" family of triggers (P2StateNo, etc). So, for instance, P2, StateNo is equivalent to P2StateNo.

The "P2" enemy has some notable properties:

  • If it is in state 5150 (KO), it will be ignored
  • Is the one the character will always be facing automatically (facep2, etc)
  • Only changes when another enemy is at least 30 pixels closer to the player, making it less erratic during team modes

All of these properties make P2 the optimal enemy redirection in most cases.

Note: This redirection should not be mistaken for "Player(2)", which is always player number 2.

trigger1 = P2, DizzyPoints <= 100

Redirects a trigger to the character with the specified PlayerNo.

trigger1 = Player(1), AILevel
trigger2 = Player(TeamLeader), MoveType = A

PlayerIndex(n) (nightly build only)

Each player is assigned a specific index in the internal player list. PlayerIndex will redirect a trigger to the player (helpers included) with the specified index. The first index is 1. If there are 20 players on screen, valid indexes will be 1 through 20.

Like all "index" triggers, this is especially useful for for or while loops.

trigger1 = PlayerIndexExist(1)
trigger1 = PlayerIndex(1), id = 56

# Count all explods on screen
let totalExplod = 0;
for i = 1; PlayerCount; 1 {
	if PlayerIndexExist($i) {
		let totalExplod = $totalExplod + PlayerIndex($i), NumExplod;
	}
}

Redirects a trigger to the owner of the current state the character is in. Useful when a custom stated target needs to redirect a trigger to the player.
Note: states are owned by the root.

trigger1 = StateOwner,AILevel

Returns the difficulty level of the player's AI as float value (unlike AILevel trigger, which is still floored for compatibility reasons). If AI is enabled on the player, the value ranges from 1 (easiest) to 8 (most difficult). If AI is not enabled on the player, the return value is 0. AI difficulty level with floating point is a result of AI Ramping system (refer to select.def distributed with engine for more information)

Format:
AILevelF

Arguments:
none

Return type:
float

trigger1 = Random < (500 * (AILevelF ** 2 / 64.0))

Returns the number of (conventional) air jumps the P1 has performed.

Format:
AirJumpCount

Arguments:
none

Return type:
int

Alpha (nightly build only)

Returns the value of the player's source/dest alpha applied with Trans sctrl.

Format:
Alpha argument

Arguments:
source, dest

Return type: int

trigger1 = Alpha source >= 128 && Alpha dest >= 128

Angle (nightly build only)

Returns the value of the player's angle applied with AngleDraw/AngleSet/AngleAdd/AngleMul sctrl.

Format:
Angle

Arguments:
none

Return type: float

trigger1 = Angle >= 90

AnimFrame (nightly build only)

Returns information about the player's current animation frame as defined in the AIR file. Refer to the AIR file documentation for what each parameter means.

Format:
AnimFrame(param_name)

Arguments:
param_name
The name of the parameter to check. Valid values are:
AlphaDest, AlphaSource, Angle, Group, HFlip, Image, NumClsn1, NumClsn2, Time, VFlip, XOffset, XScale, YOffset, YScale

trigger1 = AnimFrame(Group) = 200
trigger1 = AnimFrame(NumClsn1) > 0

AnimPlayerNo (nightly build only)

Returns the player number of the owner of the player's current animation.
Normally returns the same number as the player's player number, but when for instance ChangeAnim2 is used in a custom state, it will return the number of who owns that animation.

Format:
AnimPlayerNo

Arguments:
none

Return type:
int

trigger1 = Player(AnimPlayerNo), SelfAnimExist(1234)

Returns P1 current attack value.

Format:
Attack

Arguments:
none

Return type:
int

trigger1 = Attack = 100

Returns total length of the P1 current animation.

Format:
AnimLength

Arguments:
none

Return type:
int

trigger1 = Time = AnimTime - AnimLength
trigger1 = Time = GetHitVar(hittime) - AnimLength

Atan2 (Math) (nightly build only)

Takes two arguments, and returns the arc tangent of the two specified arguments.

Format:
Atan2(exp1,exp2)

Arguments:
exp1
Expression 1

exp2
Expression 2

Return type:
float

fvar(10) = Atan2(enemy,pos y-pos y, enemy,pos x-pos x)

BgmVar (nightly build only)

Allows checking the filename, freqmul, length, loop, loopcount, loopend, loopstart, position, startposition, and volume of the currently playing BGM.

Format:
BGMVar

Arguments:
param_name
The name of the variable to check. Valid values are:
filename, freqmul, length, loop, loopcount, loopend, loopstart, position, startposition, volume.

Return type:
variable

trigger1 = BGMVar(position) = 32768
trigger2 = BGMVar(startPosition) = 0
trigger3 = BGMVar(loopstart) = 1741
trigger4 = BGMVar(loopend) = 65536
trigger5 = BGMVar(volume) = 98
trigger6 = BGMVar(filename) = "sound/test.mp3"
trigger7 = BGMVar(length) = 65536

BotBoundBodyDist (nightly build only)

Like BotBoundDist, except this trigger accounts for the player's bottom edge parameter, as defined by the Depth state controller.

BotBoundDist (nightly build only)

BotBoundDist gives the distance between the player's z-axis and the botbound limit of the stage.

Format:
BotBoundDist

Arguments:
none

Return type:
float

trigger1 = BotBoundDist < 40

Clamp (Math) (nightly build only)

Takes three arguments, returns a value clamped to an inclusive range of two specified arguments.

Format:
Clamp(value,min,max)

Arguments:
value
Expression 1

min
Expression 2

max
Expression 3

Return type:
float

fvar(10) = Clamp(fvar(10),10 100)

ClsnOverlap (nightly build only)

Returns true if the player's specified collision box type is overlapping another player's collision boxes.
This trigger uses Ikemen's internal collision detection, so it will work even with angled and rescaled boxes.

Format:
ClsnOverlap(box_type_1, playerID, box_type_2)

Arguments:
box_type_1
The player's collision box type. Valid values are clsn1, clsn2, and size

playerID
The ID of the player against which to check the overlap

box_type_2
The target's collision box type. Valid values are clsn1, clsn2, and size

Return type:
boolean int (1 or 0)

trigger1 = ClsnOverlap(clsn1, p2,ID, clsn2)

ClsnVar (nightly build only)

Returns the specified CLSN coordinate from the specified CLSN index. Back always returns the back coordinate, and front always returns the front coordinate, even if they are reversed in the .AIR file. All coordinates are in the same coordinate space as .AIR.

Format:
ClsnVar(value_type,index,elem)

Arguments:
value_type
Valid Values are clsn1, clsn2, and size

index
Expression

elem
Valid values are back, front, top, and bottom

Return type:
float

fvar(0) = ClsnVar(Clsn2, 0, Back)

Returns the total number of hits done by the player's side in the currently ongoing combo. This value is valid as long as the opposite team combo count stays above 0, otherwise it returns 0 too. Returned value always matches current combo counter tracked by lifebar.

Format:
ComboCount

Arguments:
none

Return type:
int

trigger1 = ComboCount > 8

Returns number of matches won consecutively by this team side. The counter increases for the winning team at the same time MatchOver trigger starts returning 1. Losing a round resets the counter to 0 and prevents increment for this match.

Format:
ConsecutiveWins

Arguments:
none

Return type:
int

trigger1 = ConsecutiveWins > 0

Const1080p (nightly build only)

Converts a value from the 1080p coordinate space to the player's coordinate space. The conversion ratio between coordinate spaces is the ratio of their widths.

Format:
Const1080p(exprn)

Arguments:
exprn
Expression containing the value to convert. (float)

Return type:
float

value = Const1080p(12)
  Sets value 2 if the player has a coordinate space of 320x240 (240p).
  Sets value 4 if the player has a coordinate space of 640x480 (480p).
  Sets value 8 if the player has a coordinate space of 1280x720 (720p).
  Sets value 12 if the player has a coordinate space of 1920x1080 (1080p).

Debug (nightly build only)

Returns debug related information.

Format:
Debug(param_name)

Arguments:
param_name
The name of the parameter to check. Valid values are:
accel, clsndraw, debugdraw, statusdraw, wireframedraw, roundrestarted

trigger1 = Debug(accel) != 0
trigger1 = Debug(clsndraw)

DecisiveRound (nightly build only)

Returns 1 if the match will conclude if the player's team wins.

Format:
DecisiveRound

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = DecisiveRound

Deg (Math) (nightly build only)

Converts an argument value from radians to degrees.

Format:
Deg(exp)

Arguments:
exp
Expression

Return type:
float

trigger1 = Deg(pi/2) = 90

Returns the player's current defence value. This value accounts for all defence multipliers.

Format:
Defence

Arguments:
none

Return type:
float

trigger1 = Defence = 100

DisplayName (nightly build only)

Returns the player's displayed name. Note that the lifebar name is not necessarily the same.

Format:
DisplayName [oper] "name"

Arguments:
[oper]
=, != (other operators not valid)

"name" (string)
Name to compare against. Must be in double quotes.

Return type:
boolean int (1 or 0)

trigger1 = EnemyNear, DisplayName = "Gopher"

Returns 1 if character is under dizzy effect (assigned by DizzySet sctrl).

Format:
Dizzy

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = !Dizzy

Returns the amount of dizzy points the player has.

Format:
DizzyPoints

Arguments:
none

Return type:
int

trigger1 = DizzyPoints = 0

Returns the maximum amount of dizzy points the player can have. This is normally the same value as LifeMax (adjustable in character's CNS [Data] section).

Format:
DizzyPointsMax

Arguments:
none

Return type:
int

trigger1 = DizzyPoints < DizzyPointsMax / 2

[TODO] Undocumented trigger.

Allows checking the (remaining) time, frequency and amplitude of the current EnvShake.

Format:
EnvShakeVar

Arguments:
param_name
The name of the constant to check. Valid values are: time, freq, ampl

Return type:
float

trigger1 = EnvShakeVar(time) = 1
trigger2 = EnvShakeVar(freq) = 60
trigger3 = EnvShakeVar(ampl) = -4

ExplodVar (nightly build only)

Returns the specified explod parameter. Use -1 for ID to iterate over all explods.

Format:
ExplodVar(id, index, param)

Arguments:
id
Expression 1

index
Expression 2

param
Valid values are accel x, accel y, anim, animelem, angle, angle x, angle y, bindtime, facing, ID, layerno, pausemovetime, pos x, pos y, removetime, scale x, scale y, sprpriority, vel x, vel y

Return type:
int or float

FightScreenState (nightly build only)

Allows checking if the fight screen is displaying specific screens.

Format:
FightScreenState(param)

Arguments:
param
The parameter to check. See details

Details:

  • fightdisplay: Returns true if the fight call is being displayed. (bool)
  • kodisplay: Returns true if the KO screen is being displayed. (bool)
  • rounddisplay: Returns true if the round number screen is being displayed. (bool)
  • windisplay: Returns true if the winner announcement screen is being displayed. (bool)

Example:

trigger1 = FightScreenState(rounddisplay) = 1
trigger2 = FightScreenState(fightdisplay) = 1

FightScreenVar (nightly build only)

Returns information about the fight screen (commonly referred to as "lifebars").

Format:
FightScreenVar(param_name)

Arguments:
param_name
The name of the parameter to check. Valid values are:
info.author, info.localcoord.x, info.localcoord.y, info.name, round.ctrl.time, round.over.hittime, round.over.time, round.over.waittime, round.over.wintime, round.slow.time, round.start.waittime, round.callfight.time, time.framespercount

Refer to lifebar documentation and examples for the function of each argument.

trigger1 = FightScreenVar(Info.Name) = "Some lifebar"
trigger1 = FightScreenVar(Info.LocalCoord.X) = 1280
trigger1 = Time > FightScreenVar(Round.Ctrl.Time)

Returns the amount of ticks since the start of the actual fight.

Format:
FightTime

Arguments:
none

Return type:
int

trigger1 = FightTime > 600

Returns 1 if this character has landed the first attack (before any of the opponents or team partners) in the current round. Otherwise returns 0.

Format:
FirstAttack

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = FirstAttack

Converts argument evaluating to int type into float type.

Format:
Float(exp)

Arguments:
exp
Expression

Return type:
float

fvar(10) = Float(Life) / LifeMax

Returns the current game mode.

Format:
GameMode [oper] "name"

Arguments:
[oper]
=, != (other operators not valid)

"name" (string)
Name to compare against. Must be in double quotes.

Return type:
boolean int (1 or 0)

trigger1 = GameMode = "arcade"

The following game modes are detectable by default:

  • arcade
  • bonus
  • bossrush
  • demo
  • freebattle
  • netplaysurvivalcoop
  • netplayteamcoop
  • netplayversus
  • randomtest
  • survival
  • survivalcoop
  • teamcoop
  • timeattack
  • training
  • versus
  • versuscoop
  • watch

The trigger can be also used to detect story mode arcs and modes added via external modules.

GameOption (nightly build only)

Allows checking the various game options as defined in config.ini (TBD)

Format:
GameOption

Arguments:
param_name
The name of the variable to check. Valid values are:
sound.bgmvolume, sound.mastervolume, sound.maxvolume, sound.panningrange, sound.wavchannels, sound.wavvolume

Return type:
variable

trigger1 = GameOption(sound.wavchannels) = 32

TODO: ? Related to undocumented PlatformAngle projectile parameter.

Format:
GroundAngle

Arguments:
none

Return type:
float

trigger1 = GroundAngle != 0

GroundLevel (nightly build only)

Returns the character's ground level, which is normally 0 but can be changed via GroundLevelOffset.

Format:
GroundLevel

Arguments:
none

Return type:
float

Returns 1 if character is under guard break (assigned by GuardBreakSet sctrl).

Format:
GuardBreak

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = !GuardBreak

Returns how many hits of the current attack were guarded. Similar to Hitcount.

Format:
GuardCount

Arguments:
none

Return type:
int

trigger1 = GuardCount >= 2

Returns the amount of guard points the player has.

Format:
GuardPoints

Arguments:
none

Return type:
int

trigger1 = GuardPoints = 0

Returns the maximum amount of guard points the player can have. This is normally the same value as LifeMax (adjustable in character's CNS [Data] section).

Format:
GuardPointsMax

Arguments:
none

Return type:
int

trigger1 = GuardPoints < GuardPointsMax / 2

HelperID (nightly build only)

Returns the helper's ID (assigned via Helper ID parameter).
Not to be confused with plain ID.

Format:
HelperID

Arguments:
none

Return type:
int

trigger1 = HelperID = 1005

HelperIndexExist(n) (nightly build only)

Returns 1 if a player's helper with the specified index number exists, or 0 otherwise.

trigger1 = HelperIndexExist(5)
trigger1 = HelperIndex(5),time > 0

Returns the helper's name (assigned via helper's name parameter, which defaults to "<parent>'s helper" if a unique name is not assigned).

Format:
HelperName [oper] "name"

Arguments:
[oper]
=, != (other operators not valid)

"name" (string)
Name to compare against. Must be in double quotes.

Return type:
boolean int (1 or 0)

trigger1 = HelperName = "Fireball"

HitByAttr (nightly build only)

Checks if the player can be hit by an attack with the specified attribute.
See also documentation for the attr parameter in HitDef as well as HitDefAttr.

Format:
HitByAttr(flag1, flag2)

Arguments:
flag1
The state type flag.

flag2
The attack type flag.

Return type:
boolean int (1 or 0)

Note: Because HitBy and NotHitBy often last only one frame, player processing order can have a great influence in the return of this trigger.

Example:

trigger1 = HitByAttr(S, NT); Returns true if the player can be hit by standing throws

HitDefVar (nightly build only)

Returns information about the player's currently active HitDef or ReversalDef. The parameter format is the same as in the HitDef state controller.

Format:
HitDefVar(param)

Arguments:
param

The parameter to check. Valid values:
guard.pausetime, guard.shaketime, guarddamage, guardflag, hitdamage, hitflag, id, p1stateno, p2stateno, pausetime, priority, shaketime, sparkx, sparky

Return type:
Varies. See details

Details:

  • guard.pausetime: Returns the first value of the Hitdef's guard.pausetime parameter (int)
  • guard.shaketime: Returns the second value of the Hitdef's guard.pausetime parameter (int)
  • guarddamage: Returns the second value of the Hitdef's damage parameter (int)
  • guardflag: Checks if the specified flags exist in the Hitdef's guardflag. Valid flags HLMAFDP+- (bool)
  • hitdamage: Returns the first value of the Hitdef's damage parameter (int)
  • hitflag: Checks if the specified flags exist in the Hitdef's hitflag. Valid flags HLMAFDP+- (bool)
  • id: Returns the Hitdef's id parameter (int)
  • p1stateno: Returns the Hitdef's p1stateno parameter (int)
  • p2stateno: Returns the Hitdef's p2stateno parameter (int)
  • pausetime: Returns the first value of the Hitdef's pausetime parameter (int)
  • priority: Returns the first value of the Hitdef's priority parameter (int)
  • shaketime: Returns the second value of the Hitdef's pausetime parameter (int)
  • sparkx: Returns the X component of the Hitdef's sparkxy parameter (float)
  • sparky: Returns the Y component of the Hitdef's sparkxy parameter (float)

Notes:

  • guardflag and hitflag are not simply a direct reading of the Hitdef's parameter. That is to say HitDefVar(guardflag) = L returns true whether the Hitdef's guardflag is L, M or MA for example.

Example:

trigger1 = HitDefVar(hitdamage) >= 100
trigger2 = P2, HitDefVar(guardflag) = L; attack can be blocked crouching
trigger3 = P2, HitDefVar(guardflag) != H; attack cannot be blocked standing

Returns 1 during frame in which player has overridden default gethit behavior via HitOverride state controller. Otherwise returns 0.

Format:
HitOverridden

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = HitOverridden

IkemenVersion (nightly build only)

Returns the character's Ikemen version as a float.
For example, a character with ikemenversion = 0.98.2 in its DEF file will have IkemenVersion return 0.982000.

Format:
IkemenVersion

Arguments:
none

Return type:
float

trigger1 = P2, IkemenVersion < 0.99

InCustomAnim (nightly build only)

Returns 1 if the character is in a custom animation, such as when ChangeAnim2 is used in a custom state.

Format:
InCustomAnim

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = InCustomAnim

Returns 1 if the character is in a custom state (sent into another player's state).

Format:
InCustomState

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = InCustomState

Index (nightly build only)

Returns the player's index as an integer. See PlayerIndex.

Returns 1 during ongoing dialogue initiated by Dialogue state controller.

Format:
InDialogue

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = InDialogue

InputTime (nightly build only)

Returns number of frames since a given button was pressed or released. A positive number means the button is being held, while a negative number means it has been released. For players without keyctrl, it returns 0.

This time advances regardless of the player being paused.

Format:
InputTime(button)

Arguments:
button
The button to check. Valid values are:
B, F, D, U, a, b, c, x, y, z, s, d, w, m, L, R
These are the four cardinal directional inputs (B, F, D, U); the six attack buttons (a, b, c, x, y, z); start (s); the two new attack/tag buttons (d, w); the select/back/menu button (m); and absolute left/right directional inputs (L, R).

trigger1 = InputTime(F) > 0; forward is being held
trigger2 = InputTime(U) < 0; up is not being held
trigger3 = InputTime(a) = 1; a was just pressed
trigger4 = InputTime(b) = 30; b has been held for 30 frames
trigger5 = InputTime(c) = -40; c was released 40 frames ago

IntroState (nightly build only)

Returns the current intro state number:
0: Not applicable, or players have gained ctrl after "fight!"
1: Pre-intro (RoundState = 0)
2: Player intros (RoundState = 1)
3: Round announcement
4: Fight called

Format:
IntroState

Arguments:
none

Return type:
int

trigger1 = IntroState = 3

Returns 1 if the character has specified AssertSpecial state controller flag asserted. Flags that affect all characters at once don't have to be asserted directly by character to be detectable.

Format:
IsAsserted(flag_name)

Arguments:
flag_name
The name of the AssertSpecial state controller flag to check (string).

Return type:
boolean int (1 or 0)

trigger1 = IsAsserted(noBG)

Returns if the player is host in online match.

Format:
IsHost

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = IsHost

JugglePoints (nightly build only)

Returns the remaining juggle points between the player and another player with the specified ID. If the specified ID is not yet a target of the first player, the trigger will simply return the maximum juggle points.

Format:
JugglePoints(exprn)

Arguments:
exprn An expression evaluating to a player ID number (int).

Return type:
int

trigger1 = JugglePoints(EnemyNear, ID) < 10

LastPlayerID (nightly build only)

Returns the ID number of the last spawned player or helper.

Format:
LastPlayerID

Arguments:
none

Return type:
int

trigger1 = PlayerID(LastPlayerID), HitDefAttr = SCA, AP

LayerNo (nightly build only)

Returns the layer number on which the character is currently being drawn on.

Format:
LayerNo

Arguments:
none

Return type:
int

trigger1 = LayerNo = -1

Lerp (Math) (nightly build only)

Linear interpolation. Takes three arguments, and returns a number between two specified arguments at a specific increment.

Format:
Lerp(a,b,amount)

Arguments:
a
Expression 1

b
Expression 2

amount(Avaiable range 0-1)
Expression 3

Return type:
float

trigger1 = Lerp(0, 100, 0.5) = 50

LocalCoord (nightly build only)

Returns the character's localcoord as a float. This trigger returns a constant value even when the player is in a custom state.

Format:
LocalCoord [component]

Arguments:
[component]
X, Y

Return type:
float

trigger1 = LocalCoord X < Enemy, LocalCoord Y

Use the name of the map you want to recognize in parentheses. For example, a character with the below map will return Map(age) as a value set in character DEF file or via various state controllers that can modify character's map. If nothing is set, 0 is returned.

Format:
Map

Arguments:
name
Name of the map

Return type:
float

trigger1 = Map(age) >= 18

Takes two arguments, and returns the highest-valued number.

Format:
Max(exp1,exp2)

Arguments:
exp1
Expression 1

exp2
Expression 2

Return type:
float

trigger1 = Max(var(3), 10)

Returns character's team member position. Team leader is 1, partners receive successive numbers.

Format:
MemberNo

Arguments:
none

Return type:
int

trigger1 = MemberNo = 1

Takes two arguments, and returns the lowest-valued number.

Format:
Min(exp1,exp2)

Arguments:
exp1
Expression 1

exp2
Expression 2

Return type:
float

trigger1 = Min(var(3), 10)

MotifState (nightly build only)

Allows retrieval of whether the specified post-round sequence is active.

Format:
MotifState(parameter)

Arguments:
parameter
The name of the post-round sequence to check. Valid values are:
continuescreen, victoryscreen, winscreen

Return type:
boolean int (1 or 0)

This trigger is valid only when the player is in an attack state. MoveCountered returns 1 on attack contact, at the exact frame that p1 interrupts p2 attack (true for 1 frame, even if both P1 and P2 countered each other's moves). After contact, MoveCountered's return value will increase by 1 for each game tick that P1 is not paused. It gives 0 otherwise. See Details section of Mugen's MoveContact trigger for more information.

Format:
MoveCountered

Arguments:
none

Return type:
int

trigger1 = MoveCountered = 1

MoveHitVar (nightly build only)

Similarly to GetHitVar, this trigger allows retrieving information about the last hit the player inflicted.
This trigger works even if that hit acquired no target.

Format:
MoveHitVar(parameter)

Arguments:
parameter
The name of the hit parameter to check. Valid values are:
cornerpush, frame, id, overridden, playerno, sparkx, sparky, uniqhit

Return type:
Varies. See details

Details:

  • cornerpush: Returns the velocity offset inflicted by cornerpush. (float)
  • frame: Returns true only during the same frame where the player connected an attack. (bool)
  • id: Returns ID of the last player hit by the HitDef. (int)
  • overridden: Returns true if the last hit encountered a HitOverride. (bool)
  • playerno: Returns the player number of the last player hit by the HitDef. (int)
  • sparkx: Returns the horizontal offset of the hitsparks created by the Hitdef. (float)
  • sparky: Returns the vertical offset of the hitsparks created by the Hitdef. (float)
  • uniqhit: Returns the number of players the last hit connected against. (int)

Notes:

  • Unlike MoveHit, MoveHitVar(frame) updates during a hitpause.
  • MoveHitVar(sparkx) and MoveHitVar(sparky) offsets are relative to the attacking player's position.

Example:

[State FX]
type = explod
trigger1 = MoveHit = 1
trigger1 = MoveHitVar(Frame) = 1
postype = p1
pos = MoveHitVar(SparkX), MoveHitVar(SparkY)

MugenVersion (nightly build only)

Returns the character's Mugen version as a float.
Returns 1.1 for characters with an Ikemen version, regardless of what's specified in the def file.
Currently returns 0.5 for WinMugen characters, but checking if version is < 1.0 is better advised.

MugenVersion >= 1.0 is equivalent to MajorVersion.

Format:
MugenVersion

Arguments:
none

Return type:
float

trigger1 = MugenVersion = 1.1

NumPlayer (nightly build only)

Returns the number of main players in the game (helpers, attached chars, etc are ignored).

trigger1 = NumPlayer >= 2

NumText (nightly build only)

This trigger takes an ID number as an optional argument. If the ID number is omitted, NumText returns the number of texts owned by the player. If the ID number is included, then NumText returns the number of texts 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.

Format:
1.NumText
2.NumText(exprn)

Arguments:
exprn
Expression evaluating to an ID number (int)

Return type:
int

trigger1 = NumText >= 2
trigger1 = NumText(1234) >= 2

Offset (nightly build only)

Returns the value of the player's x,y offset applied with OffSet sctrl.

Format:
OffSet argument

Arguments:
x, y

Return type: float

trigger1 = OffSet x > 100 && OffSet y > 50

OutroState (nightly build only)

Returns the current outro state number:
0: Not applicable
1: Payers can still act, allowing a possible double KO
2: Players still have control, but the match outcome can no longer be changed
3: Players lose control, but the round has not yet entered win states
4: Player win states
5: Round over (starting from the last frame of the RoundState sequence and continuing through the entire post-round sequence, individually detactable with MotifState trigger)

Format:
OutroState

Arguments:
none

Return type:
int

trigger1 = OutroState = 3

Same as P1Name-P4Name, except that these return the name of other team members, if present. If there is no such opponent, then it returns 0 no matter what name is specified. Similarly, P5Name != "name" will return 1 no matter what name is specified.

Format:
PXName [oper] "name"

Arguments:
[oper]
=, != (other operators not valid)

"name" (string)
Name to compare against. Must be in double quotes.

Return type:
boolean int (1 or 0)

trigger1 = P5Name = "Kumquat"

PalFXVar (nightly build only)

[TODO] Returns information about the player, background or global ("all") PalFX. Accepted parameters:

time
add.r, add.g, add.b
mul.r, mul.g, mul.b
color, hue, invertall, invertblend
bg.time
bg.add.r, bg.add.g, bg.add.b
bg.mul.r, bg.mul.g, bg.mul.b
bg.color, bg.hue, bg.invertall
all.time
all.add.r, all.add.g, all.add.b
all.mul.r, all.mul.g, all.mul.b
all.color, all.hue, all.invertall, all.invertblend

trigger1 = PalFXVar(add.r) != 0
  ;triggers when red has been added to the player via PalFX

Returns the time until the active Pause and/or SuperPause effect expires (whichever lasts longer). The non 0 value is returned only after movetime parameter of these sctrls expires (player can no longer move).

Normally states are not running during Pause and SuperPause, so this trigger will only work when used in a special statedef -4, which ignores these state controllers.

Format:
PauseTime

Arguments:
none

Return type:
int

trigger1 = PauseTime = 0
  ;triggers when the player's movement is not paused by Pause/SuperPause sctrls.

Returns the player's physics-type. Refer to the section on StateDef in the CNS documentation for more details on physics.

Format:
Physics [oper] physics_type

Arguments:
[oper]
=, != (other operators not valid)

physics_type (string)
S, C, A, N (stand, crouch, air, none)

Return type:
boolean int (1 or 0)

trigger1 = Physics != A

PlayerCount (nightly build only)

Returns total number of players (including helpers, attached chars, etc) existing ingame.

trigger1 = PlayerCount > 5

PlayerIndexExist(n) (nightly build only)

Returns 1 if a player with the specified index number exists, 0 otherwise. See PlayerIndex.

trigger1 = PlayerIndexExist(2)

Returns character's player number. Player 1 side uses odd numbers (1, 3, 5, 7), player 2 side even numbers (2, 4, 6, 8). Stage AttachedChar uses number outside maximum player range (9).

Format:
PlayerNo

Arguments:
none

Return type:
int

trigger1 = PlayerNo < 3

PlayerNoExist (nightly build only)

Evaluates if the specified player number is currently in use.

Format:
PlayerNoExist(player_number)

Arguments:
player_number
An expression that evaluates to the player number to check for (int)

Return type:
boolean int (1 or 0)

Example:

trigger1 = PlayerNoExist(3); Returns true if there's a player number 3
trigger1 = Player(3), Alive

Returns the number of the anim that the player was last in.

Example:

Format:
PrevAnim

Arguments:
none

Return type:
int

trigger1 = PrevAnim = 200

Returns the MoveType that the player was last in.

Example:

Format:
PrevMoveType

Arguments:
[oper]
=, != (other operators not valid)

move_type (char)
move_type to compare against: A, I, H (Attack, Idle and GetHit move-types respectively)

Return type:
boolean int (1 or 0)

trigger1 = PrevMoveType = H

PrevStateType (nightly build only)

Returns the StateType that the player was last in.

Example:

Format:
PrevStateType

Arguments:
[oper]
=, != (other operators not valid)

state_type (char)
state_type to compare against: S, C, A, L (Stand, Crouch, Air and Liedown respectively)

Return type:
boolean int (1 or 0)

trigger1 = PrevStateType = C

ProjVar (nightly build only)

Returns the specified projectile parameter. Use -1 for ID to iterate over all projectiles.

Format:
ProjVar(id, index, param)

Arguments:
id
Expression 1

index
Expression 2

param
Valid values are accel x, accel y, anim, animelem, angle, highbound, layerno, lowbound, pausemovetime, pos x, pos y, projcancelanim, projedgebound, projhitanim, projhits, projID, projmisstime, projpriority, projremove, projremovetime, projremanim, projstagebound, remvelocity x, remvelocity y, scale x, scale y, shadow r, shadow g, shadow b, sprpriority, teamside, vel x, vel y, velmul x, velmul y

Return type:
int or float

fvar(0) = ProjVar(1000, 0, vel X)

Rad (Math) (nightly build only)

Converts an argument value from degree to radians.

Format:
Rad(exp)

Arguments:
exp
Expression

Return type:
float

trigger1 = Rad(Angle) > pi*0.5

Generates pseudo-random integer numbers uniformly distributed between the given range (both bounds inclusive).

Format:
RandomRange(lower,upper)

Arguments:
lower
Lower range (inclusive)

upper
Upper range (inclusive)

Return type:
int

type = Explod
trigger1 = RandomRange(var(3), 666) > 100
pos = RandomRange(-300, 600), 0

Returns the character's ratio level: from 1 to 4, if the level is set, otherwise it returns 0.

Format:
RatioLevel

Arguments:
none

Return type:
int

trigger1 = RatioLevel > 0

Returns the total damage dealt by the opposite team to this character, in the currently ongoing combo. This value is valid as long as the opposite team combo count stays above 0, otherwise it returns 0 too.

Format:
ReceivedDamage

Arguments:
none

Return type:
int

trigger1 = ReceivedDamage > (LifeMax / 10)

Returns the total number of hits done by the opposite team to this character, in the currently ongoing combo. Unlike GetHitVar(hitcount), it takes into account all hits, including those applied by HitAdd. This value is valid as long as the opposite team combo count stays above 0, otherwise it returns 0 too.

Format:
ReceivedHits

Arguments:
none

Return type:
int

trigger1 = ReceivedHits > 10

Returns the amount of red life the player has.

Format:
RedLife

Arguments:
none

Return type:
int

trigger1 = RedLife = 0

Checks the attribute parameter of the player's currently-active ReversalDef. If the player does not currently have an active ReversalDef, then no parameters will match. Can be used for AI to detect a counter or to code something to happen if it exists.

Note: ReversalDefAttr != value1, value2 is logically equivalent to !(ReversalDefAttr = value1, value2).

Format:
ReversalDefAttr [oper] value1, value2

Arguments:
[oper]
=, !=

value1
A string that has at least one of the letters "S", "C" and "A" for standing, crouching and aerial attacks respectively. For example, "SA" is for standing and aerial attacks.

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 ReversalDefAttr 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.

Return type:
boolean int (1 or 0)

Error conditions:
none

Example:

trigger1 = ReversalDefAttr = A, HA
  Triggers when the player activates a ReversalDef with the following attributes:  
    1. player will reverse an aerial attack
    2. player will reverse a hyper (super) attack

trigger1 = ReversalDefAttr = SC, NA, SA
  Triggers when the player activates a ReversalDef with the following attributes:
    1. player will reverse both standing and crouching attacks
    2. player will reverse both normal and special attacks

Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero.

Format:
Round(val,precision)

Arguments:
val
Expression evaluating to the value to round.

precision
Expression evaluating to the number of decimal digits to round to. If the precision is positive, the rounding will occur after the decimal point. If the precision is negative, the rounding will occur before the decimal point. If the absolute value of the precision is greater than or equal to the number of digits, the result of the rounding is equal to 0.

Return type:
float

trigger1 = Round(var(3), -2) > 100
trigger1 = Round(1.0055, 3) ; returns 1.006

RoundTime (nightly build only)

Returns the tick count since the start of the round.

Format:
RoundTime

Arguments:
none

Return type:
int

trigger1 = RoundTime > 600

RunOrder (nightly build only)

At the start of each frame, players are sorted into a list for code processing based on their current actions (see character processing order). RunOrder returns their position in this list as an integer.

Scale (nightly build only)

Returns the value of the player's drawing scale. Scale X and Scale Y refer to the scale applied by AngleDraw. Scale Z refers to the rescaling that affects the player when moving in the Z space.

Format:
Scale argument

Arguments:
x, y, z

Return type: float

trigger1 = Scale x > 2 && Scale y > 1

Returns the score points gained in this round by all team members.

Format:
Score

Arguments:
none

Return type:
float

trigger1 = Score > 10000

Returns the total score points value. Takes into account all team members, previous rounds and previous matches since the start of this game mode.

Format:
ScoreTotal

Arguments:
none

Return type:
float

trigger1 = ScoreTotal > 1000000

SelfCommand (nightly build only)

[TODO]

Checks for the existence of a state only within P1's state numbers, even when P1 is custom stated by a hit. Returns 1 if there is a statedef with the specified number. Otherwise it returns 0. Use the statedef number you want to recognize in parentheses.

Format:
SelfStatenoExist(exprn)

Arguments:
exprn
An expression evaluating to a state number (int).

Return type:
boolean int (1 or 0)

trigger1 = !SelfStatenoExist(200)
  ;Triggers if the player is missing state 200.

Sign (Math) (nightly build only)

Returns the sign of a real number. If value < 0 return -1. If value 0 return 0. if value > 0 return 1.

Format:
Sign(exp)

Arguments:
exp
Expression

Return type:
int

var(0) = var(0)*Sign(vel x)

SoundVar (nightly build only)

Returns the specified sound channel parameter. Use -1 for channelNo to find the first sound available.

Format:
SoundVar(channelNo, param)

Arguments:
channelNo
Expression

param
Valid values are group, number, freqmul, isplaying, length, loopcount, loopstart, loopend, pan, position, priority, startposition, volumescale

Return type:
int or float

var(0) = SoundVar(0, IsPlaying)
fvar(1) = SoundVar(1, VolumeScale)

Returns the player's/helper's current SprPriority value.

Format:
SprPriority

Arguments:
none

Return type:
int

trigger1 = SprPriority > 0

Returns the distance to the stage edge (corner) behind the player.

Format:
StageBackEdgeDist

Arguments:
none

Return type:
int

trigger1 = StageBackEdgeDist < 100

Returns the value of one of the stage's constants. Stage constant variables can be set under stage's DEF [Constants] section.

Format:
StageConst(param_name)

Arguments:
param_name
The name of the constant to check (string).

Return type:
float

trigger1 = StageConst(WaterGround) = 1

Returns the distance to the stage edge (corner) in front of the player.

Format:
StageFrontEdgeDist

Arguments:
none

Return type:
int

trigger1 = StageFrontEdgeDist < 100

Returns the stage's internal time, or the amount of ticks since the last stage reset. The value returned by this trigger corresponds directly to the amount of times stage backgrounds have been updated (taking into account pausebg, resetbg, etc), allowing one to for instance reliably synchronize attachedchar actions to what's currently displayed by the stage.

Format:
StageTime

Arguments:
none

Return type:
int

trigger1 = StageTime > 600

Returns 1 if character is under standby effect (assigned by TagOut sctrl).

Format:
Standby

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = !Standby

SystemVar (nightly build only)

Allows checking some system variables that generally don't justify having their own dedicated triggers. Not to be confused with sysvar.

Format:
SystemVar(param)

Arguments:
param
The parameter to check. See details

Details:

  • introtime: Returns the internal timer that controls pre-fight screens. (int)
  • outrotime: Returns the internal timer that controls post-fight screens. (int)
  • pausetime: Returns the time that the game is under the effect of Pause. (int)
  • slowtime: Returns the time that the game is under the effect of KO slowdown. (int)
  • superpausetime: Returns the time that the game is under the effect of SuperPause. (int)

Example:

trigger1 = SystemVar(superpausetime) = 0
trigger2 = SystemVar(introtime) = FightScreenVar(round.ctrl.time)

Returns playerno of the character that is considered a team leader. In modes where only one player is controlled in particular round (single, turns and ratio) it will be either 1 or 2, depending on team side. In simul and tag modes, team leader is the first party member (again 1 or 2) by default, but who is considered a leader can be also dynamically adjusted via optional TagIn sctrl leader parameter.

Manually swapping leader changes lifebar elements assignment - leader always uses P1 (or P2, depending on team side) lifebar elements, remaining players positions are moved accordingly, in ascending players order.

Format:
TeamLeader

Arguments:
none

Return type:
int

trigger1 = TeamLeader = PlayerNo

Returns character's team size (for turns mode it returns information that was previously not obtainable, for other team modes the returned value is equivalent to using NumPartner + 1)

Format:
TeamSize

Arguments:
none

Return type:
int

trigger1 = TeamSize = 4

Returns the amount of clock ticks since the battle began (0 if time is disabled). Value returned by this trigger corresponds to lifebar timer (only ticks during RoundState = 2)

Format:
TimeElapsed

Arguments:
none

Return type:
int

trigger1 = TimeElapsed > 600

Returns the amount of clock ticks until time over (-1 if time is disabled). Value returned by this trigger corresponds to lifebar timer (only ticks during RoundState = 2)

Format:
TimeRemaining

Arguments:
none

Return type:
int

trigger1 = TimeRemaining > 600

Returns the total number of clock ticks that have elapsed so far. Takes into account previous rounds and matches since the start of this game mode.

Format:
TimeTotal

Arguments:
none

Return type:
int

trigger1 = TimeTotal > 5940

TopBoundBodyDist (nightly build only)

Like TopBoundDist, except this trigger accounts for the player's top edge parameter, as defined by the Depth state controller.

TopBoundDist (nightly build only)

TopBoundDist gives the distance between the player's z-axis and the topbound limit of the stage.

Format:
TopBoundDist

Arguments:
none

Return type:
float

trigger1 = TopBoundDist < 40

Returns true if the player (or the player's team, in team mode) has won the round with the finishing blow being a hyper attack.

Format:
WinHyper

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = !WinHyper

Returns true if the player (or the player's team, in team mode) has won the round with the finishing blow being a special attack.

Format:
WinSpecial

Arguments:
none

Return type:
boolean int (1 or 0)

trigger1 = !WinSpecial
Clone this wiki locally