News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

code translation! help please

Started by Shin DANZEY, April 28, 2017, 04:31:50 PM

Previous topic - Next topic

Shin DANZEY

 what means " := " in var(26) := (var(26)-1)?  and when  can i use it,?

my older name was danzey,now i'm SHIN DANZEY
FOLLOW ME ON YOUTUBE AND my Website

XGargoyle

Assign

The new value for var (26) will be the previous value minus 1

It's the same as using a varadd -1, but you save lines of code and you can add it in places like the CMD file


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

altoiddealer

note that the effect happens every tick the line of code is evaluated by MUGEN.
You probably know this, but if you are using the same trigger #, MUGEN ignores the remaining triggers as soon as it hits a false one.

Let's say var(26) = 10.
Now, you enter State 100 with this code:

type = VelSet
trigger1 = command="holdfwd"
trigger1 = var(26) := (var(26)-1)
x = 2

If you are holding forward, var(26) will very quickly drop into negative values.

type = Explod
trigger1 = time = 100
trigger1 = var(26) := (var(26)-1)
anim = 123

After 100 ticks, var(26) will change from 10 to 9, since the code is only evaluated in a 1-tick duration.


It's popular to consolidate a bunch of triggers with := in a "Null" state controller, where you would otherwise use a bunch of VarSet controllers.


Shin DANZEY

thank you for yours fast answers. I understood.

my older name was danzey,now i'm SHIN DANZEY
FOLLOW ME ON YOUTUBE AND my Website