How can I use variables?

Started by Ondrejoda, June 12, 2017, 01:58:14 PM

Previous topic - Next topic

Ondrejoda

I was wondering, how could I use variables, because you can change the values in-game... Can someone help me?

Sorrontis

You'll have to give a little more details than that.
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Ondrejoda

Wait, you are online? I just found a solution, but now I am dealing with a problem. I just bade a bullet-shooting gun, but when the bullet explodes, it leaves there a Power Zone. Is there a command for disabling the Power Zone afrter the destruction?

Sorrontis

Yes.

Self CONST_CREATEPZ 0 SetUnitAttribute


"Self" can be replaced with a unit id, if you know it.
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

Ondrejoda


Ondrejoda

But, I got an idea.  If I do if VARIABLENAME=1, will it work?

Sorrontis

I'm not sure. Try it. See if compiles. I doubt it though.
"If you want others to be happy, practice compassion. If you want to be happy, practice compassion."

GoodMorning

Is this what you seek?

<-Variable 1 eq if
#Do something
endif
A narrative is a lightly-marked path to another reality.