Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Ondrejoda on June 12, 2017, 01:58:14 PM

Title: How can I use variables?
Post by: Ondrejoda on June 12, 2017, 01:58:14 PM
I was wondering, how could I use variables, because you can change the values in-game... Can someone help me?
Title: Re: How can I use variables?
Post by: Sorrontis on June 12, 2017, 02:11:01 PM
You'll have to give a little more details than that.
Title: Re: How can I use variables?
Post by: Ondrejoda on June 12, 2017, 02:22:23 PM
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?
Title: Re: How can I use variables?
Post by: Sorrontis on June 12, 2017, 02:28:49 PM
Yes.

Self CONST_CREATEPZ 0 SetUnitAttribute


"Self" can be replaced with a unit id, if you know it.
Title: Re: How can I use variables?
Post by: Ondrejoda on June 12, 2017, 02:32:33 PM
Thanks!
Title: Re: How can I use variables?
Post by: Ondrejoda on June 12, 2017, 02:37:47 PM
But, I got an idea.  If I do if VARIABLENAME=1, will it work?
Title: Re: How can I use variables?
Post by: Sorrontis on June 12, 2017, 02:51:26 PM
I'm not sure. Try it. See if compiles. I doubt it though.
Title: Re: How can I use variables?
Post by: GoodMorning on June 13, 2017, 04:42:08 AM
Is this what you seek?

<-Variable 1 eq if
#Do something
endif