HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trig help please :))

01-12-2004, 08:49 AM#1
Huh
Ok heres a quick, single, (prob. n00bish) question.

I want this action entered into the world editor to basically subtract 1 from the "Lives" variable. Basically after all 5 lives are gone the player will get a message and a Defeat screen.

Heres the code as I would like to have it:

Set Lives[(Player number of (Owner of (Dying unit)))] = Lives[(Player number of (Owner of (Dying unit)))] -1

But for some reason the editor wont let me add in the -1 at the end. Any idea why not? Oh yes, the Lives variable is just an integer vari. with array.

Thanks alot guys.

-Huh
01-12-2004, 09:14 AM#2
AllPainful
In the set variable area, choose Arithmatic.

Then set the Lives[(Player number of (Owner of (Dying unit)))] as the first part of the arithmatic, and the - 1 as the second part.

So its:
  1. Choose set variable as action
  2. Put Lives[(Player number of (Owner of (Dying unit)))] as the variable
  3. Choose "Arithmatic" as the set to area
  4. 1 + 1 will apear, change the first 1 to Lives[(Player number of (Owner of (Dying unit)))]
  5. Change the + to -
  6. Hit ok to everything and your set.
Trig help please :)) - Wc3C.net