I ran into David11 yesterday and he shared a line of code with me, now I’m exploring that more and sharing it here. These all have to do with the implementation of cond() in 1.0 and 1.1b. *also works in IKEMEN . David11 explains more here.
Note:
-This is a undocumented feature, possibly a bug, now known as the cond() exploit.
-There is no guarantee this will not be changed in future MUGEN releases.
-The examples below mainly show 'enemy' as the first redirect but any of these redirects can be redirected.
- A study on some limitations of cond() exploit. Mainly on helper vs root delay.
Note: recursive redirection (e.g., "root,target,time") is not supported.
Redirects of Redirects Examples:
Redirect a Redirect
*Same as: Enemy, Helper, ID ;if it were possible.
Enemy, Cond(NumHelper, Helper, Cond(1, ID, 0), 0)
;returns enemy’s first available helper’s player ID
Enemy, Cond(NumHelper, Helper, Cond(1, ID = 99, 0), 0)
;returns 1 if true.
Enemy, Cond(NumHelper, Helper, Cond(1, ID, 0), 0) = 99
;also returns 1 if true.
Set Enemy's Vars
*Same as: Enemy, Var(?) := ? ;if it were possible.
Enemy, Cond(1, Var(GameTime%60) := 0, 0)
Enemy, Cond(1, FVar(GameTime%40) := 0, 0)
;sets all of enemy’s root vars and fvars to 0.
but because of priority, p1 sets player2 vars to 0, p2 sets vars to normal value in the same tick if the vars are refreshed every tick.
Set Enemy Helper's Vars.
*Same as: Enemy, Helper(?), Var(?) := ? ;if it were possible.
*must know helper(id)
Enemy, Cond(NumHelper(33333333), Helper(33333333), Cond(1, Var(0) := 999, 0), 0)
New Redirect Examples:
Set Your Helper's Var From Root. No Lag
*Same as: Helper(?), Var(?) := ? ;if it were possible.
*Anything in Cond() should be written as it would be in the helper. If redirects are need in a helper they are needed here also.
Cond(NumHelper(33333333), Helper(33333333), Cond(1, Var(0) := 999, 0), 0)
Spoiler: Lag Test (click to see content)
[State -2, DisplayToClipboard]
Type = DisplayToClipboard ;Lag Test
Trigger1 = time = 0 && Cond(NumHelper(33333333), Helper(33333333), Cond(1, Var(0) := 999, 0), 0)
trigger2 = time > 0 && Cond(NumHelper(33333333), Helper(33333333), Cond(1, Var(0) := 444, 0), 0)
Text = "Helper(33333333),var(0) = %d"
Params = Helper(33333333),var(0)
Use Root,Time = 0 in Helper Without Using a Root Var
*requires one helper var.
This goes in [statedef -2]
[state time] ;Set your helper Var from root, to match root,time.
type = null
trigger1 = Cond(NumHelper(33333333), Helper(33333333), Cond(1, Var(15) := root,time, 0), 0)
ignorehitpause = 1
This goes in helper
Trigger1 = var(15) = 0 ; acts as Root,time = 0
Helper reads root target's time
*Same as: root,target,time ;if it were possible
Root, Cond(NumTarget, Target, Cond(1, time, 0), 0)