RUGENDOCS
Créer du contenu

Triggers

Chaque trigger de M.U.G.E.N 1.1 avec ses arguments, son type de retour, s'il peut être redirigé, un exemple et son état dans rugen.

Les triggers sont les valeurs que vous testez dans les lignes trigger1 = ... et utilisez dans les expressions de paramètres. Cette page liste chaque trigger de M.U.G.E.N 1.1, regroupé par sujet. Pour les opérateurs, les types et la syntaxe de redirection, voir Expressions.

  • Returns est le type de valeur. Les triggers bool donnent 1 ou 0.
  • Redirectable signifie qu’il peut suivre une redirection comme parent, ou enemynear, et lit alors ce joueur.
  • Status : Supported, Partial (la note dit ce qui diffère), ou Not yet. Un nom de trigger inconnu est une erreur de compilation dans rugen : le controller est abandonné et rugen check affiche la ligne.

Fonctions mathématiques

Abs Supported

Syntax Abs(expr)Returns same as inputRedirectable no

Absolute value.

trigger1 = Abs(Vel X) < 0.5

Acos Supported

Syntax Acos(expr)Returns floatRedirectable no

Arc cosine in radians.

fvar(1) = Acos(0.5)

Asin Supported

Syntax Asin(expr)Returns floatRedirectable no

Arc sine in radians.

fvar(1) = Asin(1)

Atan Supported

Syntax Atan(expr)Returns floatRedirectable no

Arc tangent in radians.

fvar(1) = Atan(P2Dist Y / P2Dist X)

Ceil Supported

Syntax Ceil(expr)Returns intRedirectable no

Rounds up to the next integer.

value = Ceil(Life / 100.0)

Cond Supported

Syntax Cond(cond, a, b)Returns type of the branchRedirectable no

Returns a if cond is true, else b. Only the chosen branch is evaluated, so it can guard := or division.

value = Cond(var(1) > 0, 200, 210)

Cos Supported

Syntax Cos(expr)Returns floatRedirectable no

Cosine of an angle in radians.

x = 3 * Cos(Time * 0.1)

E Supported

Syntax EReturns floatRedirectable no

Euler's number, 2.718...

fvar(2) = E ** 2

Exp Supported

Syntax Exp(expr)Returns floatRedirectable no

e raised to the argument.

fvar(2) = Exp(-Time / 30.0)

Floor Supported

Syntax Floor(expr)Returns intRedirectable no

Rounds down to an integer.

value = Floor(Pos X / 10)

IfElse Supported

Syntax IfElse(cond, a, b)Returns type of the branchRedirectable no

Like Cond, but both branches are evaluated before choosing. Use Cond when a branch has side effects.

value = IfElse(Facing = 1, 0, 1)

Ln Supported

Syntax Ln(expr)Returns floatRedirectable no

Natural logarithm. A zero or negative argument gives bottom.

fvar(3) = Ln(Time + 1)

Log Supported

Syntax Log(base, value)Returns floatRedirectable no

Logarithm of value in base.

fvar(3) = Log(2, 64)

Pi Supported

Syntax PiReturns floatRedirectable no

The constant 3.14159...

angle = Time * 180 / Pi

Sin Supported

Syntax Sin(expr)Returns floatRedirectable no

Sine of an angle in radians.

y = -2 * Sin(Time * 0.2)

Tan Supported

Syntax Tan(expr)Returns floatRedirectable no

Tangent of an angle in radians.

fvar(4) = Tan(Pi / 4)

État et animation

Alive Supported

Syntax AliveReturns boolRedirectable yes

1 while the player has not been KO'd.

trigger1 = !Alive

Anim Supported

Syntax AnimReturns intRedirectable yes

Current action number.

trigger1 = Anim = 200

AnimElem Supported

Syntax AnimElem = n [, op t]Returns boolRedirectable yes

True on the first tick of element n. With the second part it compares the ticks since element n started: AnimElem = 3, >= 0 is true from element 3 on.

trigger1 = AnimElem = 4

AnimElemNo Supported

Syntax AnimElemNo(ticks)Returns intRedirectable yes

Element that will be showing ticks ticks from now (0 = now).

trigger1 = AnimElemNo(0) = 5

AnimElemTime Supported

Syntax AnimElemTime(n)Returns intRedirectable yes

Ticks since element n started; negative before it.

trigger1 = AnimElemTime(3) >= 0

AnimExist Supported

Syntax AnimExist(action)Returns boolRedirectable yes

Whether an action exists in the .air file of the state owner.

trigger1 = AnimExist(195)

AnimTime Supported

Syntax AnimTimeReturns intRedirectable yes

Ticks until the end of the animation, as 0 or a negative number. 0 means the last tick of a non-looping animation.

trigger1 = AnimTime = 0

CanRecover Supported

Syntax CanRecoverReturns boolRedirectable yes

While falling: 1 once the player may recover.

trigger1 = CanRecover && Command = "recovery"

Command Supported

Syntax Command = "name"Returns boolRedirectable no

True while the named command from the .cmd was just entered. != works too. Helpers only see commands with keyctrl = 1.

trigger1 = Command = "QCF_x"

Ctrl Supported

Syntax CtrlReturns boolRedirectable yes

1 if the player has control.

trigger1 = Ctrl

Facing Supported

Syntax FacingReturns intRedirectable yes

1 facing right, -1 facing left.

trigger1 = Facing = -1

MoveType Supported

Syntax MoveType = I / A / HReturns boolRedirectable yes

Compares the move type: idle, attacking, being hit. != works too.

trigger1 = MoveType = H

P2MoveType Supported

Syntax P2MoveType = I / A / HReturns boolRedirectable yes

Move type of P2 (the nearest opponent).

trigger1 = P2MoveType = A

P2StateNo Supported

Syntax P2StateNoReturns intRedirectable yes

State number of P2.

trigger1 = P2StateNo = 5120

P2StateType Supported

Syntax P2StateType = S / C / A / LReturns boolRedirectable yes

State type of P2.

trigger1 = P2StateType = A

PrevStateNo Supported

Syntax PrevStateNoReturns intRedirectable yes

The state the player was in before this one.

trigger1 = PrevStateNo = 40

StateNo Supported

Syntax StateNoReturns intRedirectable yes

Current state number.

trigger1 = StateNo = [200, 299]

StateType Supported

Syntax StateType = S / C / A / LReturns boolRedirectable yes

Compares the state type: standing, crouching, air, lying down.

trigger1 = StateType != A

Time Supported

Syntax TimeReturns intRedirectable yes

Ticks spent in the current state, starting at 0. rugen also accepts the Ikemen name StateTime.

trigger1 = Time = 0

TimeMod Supported

Syntax TimeMod = div, remReturns boolRedirectable yes

Old form of Time % div = rem; prefer the modulo form in new code.

trigger1 = TimeMod = 4, 0

SelfAnimExist Supported

Syntax SelfAnimExist(action)Returns boolRedirectable yes

Like AnimExist, but always looks in the player's own .air.

trigger1 = SelfAnimExist(5300)

Position, distance et vitesse

BackEdgeBodyDist Supported

Syntax BackEdgeBodyDistReturns intRedirectable yes

Distance from the back of the player's width box to the back screen edge.

trigger1 = BackEdgeBodyDist < 10

BackEdgeDist Supported

Syntax BackEdgeDistReturns intRedirectable yes

Distance from the player's axis to the back screen edge.

trigger1 = BackEdgeDist < 30

FrontEdgeBodyDist Supported

Syntax FrontEdgeBodyDistReturns intRedirectable yes

Distance from the front of the width box to the front screen edge.

trigger1 = FrontEdgeBodyDist < 10

FrontEdgeDist Supported

Syntax FrontEdgeDistReturns intRedirectable yes

Distance from the axis to the front screen edge.

trigger1 = FrontEdgeDist > 60

InGuardDist Supported

Syntax InGuardDistReturns boolRedirectable yes

1 when an opponent's attack or projectile is close enough that holding back would guard.

trigger1 = InGuardDist

P2BodyDist Supported

Syntax P2BodyDist X / YReturns floatRedirectable yes

Distance to P2 measured between the width boxes (x) or the axes (y).

trigger1 = P2BodyDist X < 20

P2Dist Supported

Syntax P2Dist X / YReturns floatRedirectable yes

Distance between the axes of the player and P2; x is positive in front.

trigger1 = P2Dist X = [0, 80]

ParentDist Supported

Syntax ParentDist X / YReturns floatRedirectable yes

Helpers: distance to the parent.

trigger1 = ParentDist X > 100

Pos Supported

Syntax Pos X / YReturns floatRedirectable yes

Position: x from the screen centre, y from the floor (negative is up).

trigger1 = Pos Y >= 0

RootDist Supported

Syntax RootDist X / YReturns floatRedirectable yes

Helpers: distance to the root.

trigger1 = RootDist X < 0

ScreenPos Supported

Syntax ScreenPos X / YReturns floatRedirectable yes

Position relative to the top-left corner of the screen.

trigger1 = ScreenPos X < 40

Vel Supported

Syntax Vel X / YReturns floatRedirectable yes

Velocity; x positive is forward, y positive is down.

trigger1 = Vel Y > 0

Attaquer et être touché

GetHitVar Supported

Syntax GetHitVar(name)Returns int / floatRedirectable yes

Reads a value stored from the last hit taken: damage, hittime, slidetime, ctrltime, xvel, yvel, yaccel, fall, fall.yvel, fall.recover, animtype, groundtype, airtype, hitcount, guarded, isbound, chainid, and so on.

trigger1 = GetHitVar(fall)

HitCount Supported

Syntax HitCountReturns intRedirectable yes

Hits the current attack has done (resets with each new HitDef).

trigger1 = HitCount >= 2

HitDefAttr Supported

Syntax HitDefAttr = state, class [, class...]Returns boolRedirectable yes

True while a HitDef is active and its attr matches, e.g. SC, NA, SA.

trigger1 = HitDefAttr = A, HA

HitFall Supported

Syntax HitFallReturns boolRedirectable yes

In a get-hit state: 1 if the hit made the player fall.

trigger1 = HitFall

HitOver Supported

Syntax HitOverReturns boolRedirectable yes

In a get-hit state: 1 once the hit time is over.

trigger1 = HitOver

HitPauseTime Supported

Syntax HitPauseTimeReturns intRedirectable yes

Ticks of hit pause left for the attacker.

trigger1 = HitPauseTime = 0

HitShakeOver Supported

Syntax HitShakeOverReturns boolRedirectable yes

In a get-hit state: 1 once the hit shake is over.

trigger1 = HitShakeOver

HitVel Supported

Syntax HitVel X / YReturns floatRedirectable yes

Velocity stored from the last hit.

trigger1 = HitVel X > 3

MoveContact Supported

Syntax MoveContactReturns intRedirectable yes

Non-zero once the current attack touched someone (hit or guard). Counts ticks since contact.

trigger1 = MoveContact

MoveGuarded Supported

Syntax MoveGuardedReturns intRedirectable yes

Non-zero once the current attack was guarded.

trigger1 = MoveGuarded

MoveHit Supported

Syntax MoveHitReturns intRedirectable yes

Non-zero once the current attack hit.

trigger1 = MoveHit && Command = "x"

MoveReversed Partial

Syntax MoveReversedReturns intRedirectable yes

Non-zero once the current attack was reversed by a ReversalDef.

  • Always 0: a reversal does not mark the attacker yet.

trigger1 = MoveReversed

UniqHitCount Supported

Syntax UniqHitCountReturns intRedirectable yes

Like HitCount, but counts each hit on each opponent.

trigger1 = UniqHitCount >= 3

Vie et puissance

Life Supported

Syntax LifeReturns intRedirectable yes

Current life.

trigger1 = Life < LifeMax / 4

LifeMax Supported

Syntax LifeMaxReturns intRedirectable yes

Maximum life (life in [Data]).

value = LifeMax

P2Life Supported

Syntax P2LifeReturns intRedirectable yes

Life of P2.

trigger1 = P2Life < 100

Power Supported

Syntax PowerReturns intRedirectable yes

Current power.

trigger1 = Power >= 1000

PowerMax Supported

Syntax PowerMaxReturns intRedirectable yes

Maximum power (power in [Data]).

trigger1 = Power = PowerMax

Helpers, projectiles, explods et cibles

IsHelper Supported

Syntax IsHelper[(id)]Returns boolRedirectable yes

1 if the player is a helper, or a helper with that id.

trigger1 = !IsHelper

NumExplod Supported

Syntax NumExplod[(id)]Returns intRedirectable yes

Number of the player's explods (with that id).

trigger1 = !NumExplod(1010)

NumHelper Supported

Syntax NumHelper[(id)]Returns intRedirectable yes

Number of the player's helpers (with that id).

trigger1 = NumHelper(1201) = 0

NumProj Supported

Syntax NumProjReturns intRedirectable yes

Number of the player's projectiles on screen.

trigger1 = NumProj = 0

NumProjID Supported

Syntax NumProjID(id)Returns intRedirectable yes

Number of the player's projectiles with a projid.

trigger1 = NumProjID(1000) < 2

NumTarget Supported

Syntax NumTarget[(id)]Returns intRedirectable yes

Number of current targets (hit by a HitDef with that id).

trigger1 = NumTarget(800)

ProjCancelTime Supported

Syntax ProjCancelTime(id)Returns intRedirectable yes

Ticks since a projectile with that projid was cancelled by another projectile; -1 if never.

trigger1 = ProjCancelTime(1000) = 1

ProjContact Supported

Syntax ProjContact[id] = bool [, op t]Returns boolRedirectable yes

Old-style: whether a projectile (with an optional id appended, ProjContact1000) made contact, optionally within t ticks.

trigger1 = ProjContact1000 = 1, < 15

ProjContactTime Supported

Syntax ProjContactTime(id)Returns intRedirectable yes

Ticks since a projectile with that projid made contact; -1 if never.

trigger1 = ProjContactTime(1000) = [0, 10]

ProjGuarded Supported

Syntax ProjGuarded[id] = bool [, op t]Returns boolRedirectable yes

Old-style: whether a projectile was guarded.

trigger1 = ProjGuarded1000 = 1

ProjGuardedTime Supported

Syntax ProjGuardedTime(id)Returns intRedirectable yes

Ticks since a projectile with that projid was guarded.

trigger1 = ProjGuardedTime(1000) = 0

ProjHit Supported

Syntax ProjHit[id] = bool [, op t]Returns boolRedirectable yes

Old-style: whether a projectile hit.

trigger1 = ProjHit1000 = 1, < 20

ProjHitTime Supported

Syntax ProjHitTime(id)Returns intRedirectable yes

Ticks since a projectile with that projid hit.

trigger1 = ProjHitTime(1000) = 0

PlayerIDExist Supported

Syntax PlayerIDExist(id)Returns boolRedirectable yes

Whether a player or helper with that unique id exists.

trigger1 = PlayerIDExist(var(40))

ID Supported

Syntax IDReturns intRedirectable yes

Unique id of the player or helper; use it with PlayerID(n) redirection.

var(40) = ID

NumEnemy Supported

Syntax NumEnemyReturns intRedirectable yes

Number of opponents in the fight.

trigger1 = NumEnemy > 1

NumPartner Partial

Syntax NumPartnerReturns intRedirectable yes

Number of partners (team modes).

  • Always 0: no team modes yet.

trigger1 = NumPartner = 0

Round et match

DrawGame Supported

Syntax DrawGameReturns boolRedirectable yes

1 after the round ended in a draw.

trigger1 = DrawGame

Lose Supported

Syntax LoseReturns boolRedirectable yes

1 after the player lost the round. Variants: LoseKO, LoseTime.

trigger1 = Lose

MatchNo Partial

Syntax MatchNoReturns intRedirectable no

Number of the current match in arcade mode, from 1.

  • Always 1.

trigger1 = MatchNo = 6

MatchOver Supported

Syntax MatchOverReturns boolRedirectable no

1 once the match is decided.

trigger1 = MatchOver

RoundNo Supported

Syntax RoundNoReturns intRedirectable no

Current round, from 1.

trigger1 = RoundNo = 1

RoundsExisted Supported

Syntax RoundsExistedReturns intRedirectable yes

Rounds the player has been in before this one.

trigger1 = RoundsExisted = 0

RoundState Supported

Syntax RoundStateReturns intRedirectable no

0 screen fades in, 1 intros, 2 fight, 3 round end (no control), 4 win poses.

trigger1 = RoundState = 2

TeamMode Partial

Syntax TeamMode = Single / Simul / TurnsReturns boolRedirectable yes

The team mode of the player's side.

  • Always Single: rugen has no team modes yet.

trigger1 = TeamMode = Single

TeamSide Supported

Syntax TeamSideReturns intRedirectable yes

1 for the left team, 2 for the right.

trigger1 = TeamSide = 2

IsHomeTeam Supported

Syntax IsHomeTeamReturns boolRedirectable yes

1 for the side that is "at home" (the left side outside arcade).

trigger1 = IsHomeTeam

Win Supported

Syntax WinReturns boolRedirectable yes

1 after the player won the round. Variants: WinKO, WinTime, WinPerfect.

trigger1 = WinPerfect

AILevel Supported

Syntax AILevelReturns intRedirectable yes

0 for a human, 1 to 8 for the computer's difficulty.

trigger1 = AILevel > 0

GameTime Supported

Syntax GameTimeReturns intRedirectable no

Ticks since the match began.

trigger1 = GameTime % 60 = 0

TicksPerSecond Supported

Syntax TicksPerSecondReturns intRedirectable no

Ticks per second of game time (60).

value = 3 * TicksPerSecond

Écran et stage

BackEdge Supported

Syntax BackEdgeReturns floatRedirectable yes

x of the back screen edge, in the player's coordinates.

trigger1 = Pos X < BackEdge + 20

BottomEdge Supported

Syntax BottomEdgeReturns floatRedirectable yes

y of the bottom screen edge.

trigger1 = Pos Y > BottomEdge

CameraPos Partial

Syntax CameraPos X / YReturns floatRedirectable no

Camera position.

  • CameraPos Y is always 0.

trigger1 = CameraPos X > 100

CameraZoom Partial

Syntax CameraZoomReturns floatRedirectable no

Current camera zoom (1 = no zoom).

  • Always 1, even when the camera zooms.

trigger1 = CameraZoom < 1

FrontEdge Supported

Syntax FrontEdgeReturns floatRedirectable yes

x of the front screen edge.

trigger1 = Pos X > FrontEdge - 20

GameHeight Supported

Syntax GameHeightReturns floatRedirectable no

Height of the visible game area in the player's units (changes with zoom).

y = GameHeight / 2

GameWidth Supported

Syntax GameWidthReturns floatRedirectable no

Width of the visible game area in the player's units.

x = GameWidth / 2

LeftEdge Supported

Syntax LeftEdgeReturns floatRedirectable yes

x of the left screen edge.

trigger1 = Pos X < LeftEdge + 10

RightEdge Supported

Syntax RightEdgeReturns floatRedirectable yes

x of the right screen edge.

trigger1 = Pos X > RightEdge - 10

ScreenHeight Supported

Syntax ScreenHeightReturns floatRedirectable no

Height of the screen in the player's localcoord.

y = ScreenHeight

ScreenWidth Supported

Syntax ScreenWidthReturns floatRedirectable no

Width of the screen in the player's localcoord.

x = ScreenWidth / 2

TopEdge Partial

Syntax TopEdgeReturns floatRedirectable yes

y of the top screen edge.

  • Always 0.

trigger1 = Pos Y < TopEdge

StageVar Supported

Syntax StageVar(key) = "text"Returns boolRedirectable no

Compares stage info: info.name, info.displayname, info.author.

trigger1 = StageVar(info.name) = "Training Room"

Variables, constantes et noms

Const Supported

Syntax Const(name)Returns int / floatRedirectable yes

Reads a constant from the .cns: data.life, size.ground.front, velocity.walk.fwd.x, movement.yaccel, and so on.

y = Const(velocity.jump.y)

Const240p Supported

Syntax Const240p(value)Returns floatRedirectable yes

Converts a value written for 320x240 into the player's localcoord.

x = Const240p(4)

Const480p Supported

Syntax Const480p(value)Returns floatRedirectable yes

Converts a value written for 640x480.

x = Const480p(8)

Const720p Supported

Syntax Const720p(value)Returns floatRedirectable yes

Converts a value written for 1280x720.

x = Const720p(16)

FVar Supported

Syntax FVar(n)Returns floatRedirectable yes

Float variable n (0 to 39). fvar(n) := v assigns inside an expression.

trigger1 = FVar(3) > 1.5

Var Supported

Syntax Var(n)Returns intRedirectable yes

Int variable n (0 to 59).

trigger1 = Var(10) = 1

SysFVar Supported

Syntax SysFVar(n)Returns floatRedirectable yes

System float variable n (0 to 4), reserved for common files.

trigger1 = SysFVar(0) > 0

SysVar Supported

Syntax SysVar(n)Returns intRedirectable yes

System int variable n (0 to 4), reserved for common files.

trigger1 = SysVar(1) = 0

Name Supported

Syntax Name = "text"Returns boolRedirectable yes

Compares the player's name (case-insensitive).

trigger1 = Name = "Kung Fu Man"

P1Name Supported

Syntax P1Name = "text"Returns boolRedirectable yes

Same as Name.

trigger1 = P1Name = "Kung Fu Man"

P2Name Supported

Syntax P2Name = "text"Returns boolRedirectable yes

Compares the name of P2.

trigger1 = P2Name = "Evil Ken"

P3Name Partial

Syntax P3Name = "text"Returns boolRedirectable yes

Compares the name of the player's partner.

  • Always false: no team modes yet.

trigger1 = P3Name = "Suave Dude"

P4Name Partial

Syntax P4Name = "text"Returns boolRedirectable yes

Compares the name of P2's partner.

  • Always false: no team modes yet.

trigger1 = P4Name = "Suave Dude"

AuthorName Supported

Syntax AuthorName = "text"Returns boolRedirectable yes

Compares the author field of the .def.

trigger1 = AuthorName = "Elecbyte"

PalNo Supported

Syntax PalNoReturns intRedirectable yes

Palette the player was picked with (1 to 12).

trigger1 = PalNo = 12

Extensions de rugen

Ces triggers sont des ajouts de rugen. Ils sont toujours disponibles ; les persos anciens ne les utilisent simplement pas.

TriggerRenvoieSignification
GroundYfloatHauteur de la surface sous le joueur : 0 au sol, négatif sur une plateforme.
OnPlatformbool1 quand le joueur se tient sur une plateforme.
StateTimeintIdentique à Time (orthographe Ikemen).
[State 52, land on a platform]
type = ChangeAnim
trigger1 = Time = 0 && OnPlatform
value = 48   ; your own "landed high up" animation

Actualiser les données d’état

Voir State controllers : actualiser les données d’état.

Référence originale : elecbyte.com/mugendocs-11b1.

Un problème sur cette page ? Modifiez-la sur GitHub.

RECHERCHE !!

    ↑↓ pour se déplacer, Entrée pour ouvrir