Condbug
Cond is a trigger that was added in the MUGEN's official versions (1.0 and higher). It's similar to the ifelse trigger, except the latter evaluates all the expressions while Cond sequentially evaluates one of the two expressions based on the condition result, so it can be said that Cond is a kind of alternative to ifelse.
This trigger takes three arguments: The first argument is a condition argument. If the specified condition is true, Cond evaluates and returns the second argument's value, otherwise the third argument is evaluated before returning its value if false.
The Cond trigger format looks like this:
Cond(Condition, Result_True, Result_False)
The Bug
Many people call it Condbug or Cond() Exploit, and it is a technique used a lot by god/cheap characters for 1.0 or higher.
This bug was discovered in 2018, and this trigger was used as a pointer redirect (or to simplify, change enemy's variables directly). This is because the assignment operator, :=
, can be used within it. This bug is loved by a lot of authors since it is very simple to understand and also because there is no need to use a Null Overflow exploit to change the enemy's variables.
For example, if we want to change the enemy's variable number 13, we only need to do this:
trigger1 = enemy,cond(1,var(13):=7,0)
Or if the enemy has a partner by any chance...
trigger1 = enemy(0),cond(1,var(13):=7,0) trigger1 = enemy(1),cond(1,var(13):=7,0)
We put 1 as first argument, so that it will always go into the second argument. (Or 0 for the third argument, nothing changes).
For the second argument, we need to write "var(13):=7" to have 7 assigned in the enemy's variable; You can put anything on the third argument since the Cond trigger will not use its value anyway.
This is just an example, but you can change the enemy's helper variables, float variables, and more. This bug becomes lethal if combined with variable expansion, since you can directly change the alive, palno and more.