Triggers (changed) - ikemen-engine/Ikemen-GO GitHub Wiki
The triggers in this page already existed in Mugen, but were adjusted or received new features in Ikemen GO.
Refer to the sidebar for quicker navigation.
Changed trigger redirections
Helper
The Helper redirection now also accepts an optional index argument, through the new format Helper(ID, index). Defaults to 0 (first one).
The old formats still work exactly the same.
Example:
trigger1 = NumHelper(1005) >= 2
trigger1 = Helper(1005, 1), MoveType = A; The second helper with ID 1005
Target
The Target redirection now also accepts an optional index argument, through the new format Target(ID, index). Defaults to 0 (first one).
The old format still works exactly the same.
Example:
trigger1 = NumTarget >= 2
trigger1 = Target(-1, 1), Alive; The second target with any ID
Changed triggers
AuthorName (nightly build only)
AuthorName can now return a string directly instead of requiring a comparison.
displayToClipboard{text: "The author is %s"; params: AuthorName}
Command
ikemenversion
If a character has ikemenversion, when the Command trigger is redirected to another player, the engine will first check if the other player is performing its own command with the same name. If not, it'll check if it's performing the command from our own command list. Otherwise it will work like Mugen.
String expressions (nightly build only)
The trigger can now use any string expression, not only string literals.
if command = ifElse(random < 500, "a", "b") || command = map(some_command) {...}
Const
The Const trigger can now also read Ikemen GO's new constants.
Const(constants)
Returns the value of one of the player's custom constants from the Constants(Character-features/#cns_constants) section.
[Constants]
FireballState = 1000
[State -1, Fireball]
triggerall = NumHelper(Const(FireballState)) = 0
data.dizzypoints
Returns the value of the player's [Data] dizzypoints constant.
data.fall.defence_up
Returns the value of the player's [Data] fall.defence_up constant.
data.guardpoints
Returns the value of the player's [Data] guardpoints constant.
data.guardsound.channel
Returns the value of the player's [Data] guardsound.channel constant.
data.hitsound.channel
Returns the value of the player's [Data] hitsound.channel constant.
size.height.crouch
Returns the value of the player's [Size] height.crouch constant.
size.height.air.top
Returns the first value of the player's [Size] height.air constant.
size.height.air.bottom
Returns the second value of the player's [Size] height.air constant.
size.height.down
Returns the value of the player's [Size] height.down constant.
velocity.air.gethit.ko.add
Returns the value of the player's [Velocity] air.gethit.ko.add constant.
velocity.air.gethit.ko.add.xvelocity.air.gethit.ko.add.yvelocity.air.gethit.ko.add.z
velocity.air.gethit.ko.ymin
Returns the value of the player's [Velocity] air.gethit.ko.ymin constant.
velocity.ground.gethit.ko.xmul
Returns the value of the player's [Velocity] ground.gethit.ko.xmul constant.
velocity.ground.gethit.ko.add
Returns the value of the player's [Velocity] ground.gethit.ko.add constant.
velocity.ground.gethit.ko.add.xvelocity.ground.gethit.ko.add.yvelocity.ground.gethit.ko.add.z
velocity.ground.gethit.ko.ymin
Returns the value of the player's [Velocity] ground.gethit.ko.ymin constant.
GameHeight
If mugenVersion is specified as 1.0 in character's Info(Character-features/#def_info) section, GameHeight returns the same value as ScreenHeight.
GameWidth
If mugenVersion is specified as 1.0 in character's Info(Character-features/#def_info) section, GameWidth returns the same value as ScreenWidth.
GetHitVar
air.velocity.x (y, z)
Returns the X, Y or Z component of the last HitDef's air.velocity parameter, even if the player was not hit in the air. (float)
airguard.velocity.x (y, z)
Returns the X, Y or Z component of the last HitDef's airguard.velocity parameter, even if the player did not guard in the air. (float)
air.animtype, fall.animtype, ground.animtype
Returns the literal value specified in the HitDef.
attr
Returns the last HitDef attr assignment. Requires a comparison to known flags. (string)
trigger1 = getHitVar(attr) = SCA, HA
Nightly build only:
A comparison is no longer mandatory. When used bare, GetHitVar(attr) now returns an attr string directly in the form "SCA, NA". The old syntax is still supported.
displayToClipboard{text: "The attr is %s"; params: GetHitVar(attr)}
dizzypoints
Returns last HitDef dizzypoints value. (int)
down.velocity.x (y, z)
Returns the X, Y or Z component of the last HitDef's down.velocity parameter, even if the player was not hit while down. (float)
facing
Returns last HitDef p2facing value. (int)
fall.envshake.mul
Returns last HitDef fall.envshake.mul value. (float)
fall.zvel
Returns z velocity after bouncing off ground (float)
frame
Returns true only during the same frame where the player got hit by an attack. (bool)
ground.velocity.x (y, z)
Returns the X, Y or Z component of the last HitDef's ground.velocity parameter, even if the player was not hit on the ground. (float)
guard.velocity.x (y, z)
Returns the X, Y or Z component of the last HitDef's guard.velocity parameter, even if the player did not guard on the ground. (float)
guardpoints
Returns last HitDef guardpoints value. (int)
guardcount
Returns how many hits the player has guarded without a chance to fight back. (int)
guarddamage
Returns the second value of the last HitDef's damage parameter. (int)
guardflag
Returns the guardflag parameter of the last HitDef that hit the player. Requires a comparison to known flags. (string)
trigger1 = getHitVar(guardflag) = L
Nightly build only:
A comparison is no longer mandatory. When used bare, GetHitVar(guardflag) now returns a guardflag string directly in the form "HAD-". The old syntax is still supported.
displayToClipboard{text: "The guardflag is %s"; params: GetHitVar(guardflag)}
guardko
Returns 1 if the player was KO'd by guard damage. (bool)
guardpower
Returns the second value of the last HitDef's givepower parameter. In other words, the power received when guarding. (int)
hitflag
Returns the hitflag parameter of the last HitDef that hit the player. Requires a comparison to known flags. (string)
trigger1 = getHitVar(hitflag) = MA
Nightly build only:
A comparison is no longer mandatory. When used bare, GetHitVar(hitflag) now returns a hitflag string directly in the form "HAD-". The old syntax is still supported.
displayToClipboard{text: "The hitflag is %s"; params: GetHitVar(hitflag)}
hitpower
Returns the first value of the last HitDef's givepower parameter. In other words, the power received when getting hit. (int)
hitdamage
Returns the first value of the last HitDef's damage parameter. (int)
kill
Returns the kill flag of the last hit or LifeAdd the character suffered. (int)
playerid
Returns the ID of the last character that hit the player. (int)
Note: Up until Ikemen GO version 0.99, this trigger used ID syntax instead of playerID. That syntax is still valid, but it's deprecated.
playerno
Returns the PlayerNo of the last character that hit the player. (int)
power
Returns how much power the player received from the last hit, regardless of getting hit or guarding. (int)
priority
Returns the numerical value of the attack priority of the last HitDef. (int)
projid
Returns the projID of the last projectile that hit the player. Returns -1 if not hit by a projectile. (int)
redlife
Returns last HitDef redlife value. (int)
score
Returns last HitDef score value. (float)
sparkx (nightly build only)
Returns the x-offset of the spark from the last received hit. (float)
sparky (nightly build only)
Returns the y-offset of the spark from the last received hit. (float)
teamside
Returns the teamside of the last HitDef that hit the player. (int)
type
Returns the value of either groundtype or airtype, depending on the character's StateType upon being hit. Such a trigger was documented in Mugen but did not work.
xaccel
Returns the X acceleration set by the hit. (float)
NOTE: Currently, this parameter will only work if the character does not override the common1.cns.zss states that use it.
xveladd
This trigger was dummied out in Mugen, always returning 0. In Ikemen, it works as documented.
yveladd
This trigger was dummied out in Mugen, always returning 0. In Ikemen, it works as documented.
zaccel
Returns the Z acceleration set by the hit. (float)
NOTE: Currently, this parameter will only work if the character does not override the common1.cns.zss states that use it.
zvel
Returns the fixed z-velocity imparted by hit. (float)
zoff
"Snap" z offset when hit.
HitDefAttr
String return (nightly build only)
A comparison is no longer mandatory. When used bare, HitDefAttr now returns an attr string in the form "SCA, NA". The old syntax is still supported.
displayToClipboard{text: "The attr is %s"; params: HitDefAttr}
IsHelper
The IsHelper trigger now also accepts an optional index argument, through the new format IsHelper(ID, index). Defaults to -1 (any index).
The old formats still work exactly the same.
Example:
trigger1 = IsHelper(123, 2); Is the third helper with ID 123
MoveType
String return (nightly build only)
A comparison is no longer mandatory. When used bare, MoveType now returns a move type string in the form "A". The old syntax is still supported.
displayToClipboard{text: "The move type is %s"; params: MoveType}
Name (nightly build only)
Name can now return a string directly instead of requiring a comparison.
displayToClipboard{text: "The name is %s"; params: Name}
P2MoveType
String return (nightly build only)
A comparison is no longer mandatory. When used bare, P2MoveType now returns a move type string in the form "A". The old syntax is still supported.
displayToClipboard{text: "The opponent's move type is %s"; params: P2MoveType}
P2Name (nightly build only)
P2Name can now return a string directly instead of requiring a comparison.
displayToClipboard{text: "The opponent's name is %s"; params: P2Name}
P2StateType
String return (nightly build only)
A comparison is no longer mandatory. When used bare, P2StateType now returns a state type string in the form "S". The old syntax is still supported.
displayToClipboard{text: "The opponent's state type is %s"; params: P2StateType}
P3Name (nightly build only)
P3Name can now return a string directly instead of requiring a comparison.
displayToClipboard{text: "The teammate's name is %s"; params: P3Name}
P4Name (nightly build only)
P4Name can now return a string directly instead of requiring a comparison.
displayToClipboard{text: "The opponent's name is %s"; params: P4Name}
P2BodyDist
Y
In Mugen, this trigger merely does the same as P2Dist Y. If a character has ikemenversion, it will instead return the distance between the size boxes of the two players.
Z
P2BodyDist now also accepts a Z argument. When there is overlap between the players' Z width, it returns 0, otherwise returns the distance between their theoretical width boxes.
P2Dist Z
The P2Dist trigger now also accepts a Z argument. Returns the distance between the players in the Z axis.
ParentDist Z
The ParentDist trigger now also accepts a Z argument. Returns the distance between the helper and its parent in the Z axis.
RootDist Z
The RootDist trigger now also accepts a Z argument. Returns the distance between the helper and its root in the Z axis.
RoundState
The RoundState trigger no longer returns 2 during the "Fight!" screen, before players have control, returning 1 instead.
RoundState = 2 is generally understood and documented as the main part of the fight, so this oddity only caused trouble in Mugen.
StateType
String return (nightly build only)
A comparison is no longer mandatory. When used bare, StateType now returns a state type string in the form "S". The old syntax is still supported.
displayToClipboard{text: "The state type is %s"; params: StateType}
StageVar
Parameters
StageVar now accepts all stage parameters that ModifyStageVar state controller can change. In addition it accepts the following parameters:
info.ikemenversion.major = major version component (int)
info.ikemenversion.minor = minor version component (int)
info.ikemenversion.patch = patch version component (int)
info.mugenversion.major = major version component (int)
info.mugenversion.minor = minor version component (int)
stageinfo.localcoord.x = width (int)
stageinfo.localcoord.y = height (int)
String return (nightly build only)
A comparison is no longer mandatory. When used bare, StageVar returns the stage's name, display name or author name as a string, so it can be compared against another string instead of only a literal. The old syntax is still supported.
displayToClipboard{text: "The stage name is %s"; params: StageVar(info.name)}
TeamMode
Tag
TeamMode can now also return Tag when that mode is selected.
trigger1 = TeamMode = Tag
String return (nightly build only)
A comparison is no longer mandatory. When used bare, TeamMode returns the current mode as a string directly, which can be read by another trigger or displayed. The old syntax is still supported.
displayToClipboard{text: "The current mode is %s"; params: TeamMode}