• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

100 Chances/points for teams (Hero Wars)

Status
Not open for further replies.
Level 5
Joined
Jul 25, 2008
Messages
155
Hello :) I am making a hero wars map, and I was wondering how I do so each team (2 teams) have 100 chances each, and when one unit comes into the region they lose one chance
Would appreciate the help ::wink:
 
Level 24
Joined
May 9, 2007
Messages
3,563
  • Chance
    • Events
      • Unit - A unit enters No region
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set Chance[1] = (Chance[1] - 1)
          • Game - Display to (All players) the text: ((Name of Player 1 (Red)) + has lost one chance)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Set Chance[2] = (Chance[2] - 1)
              • Game - Display to (All players) the text: ((Name of Player 2 (Blue)) + has lost one chance)
            • Else - Actions
Chance is an integer array, with 2.
 
Level 5
Joined
Jul 25, 2008
Messages
155
"Set Chance[1] = (Chance[1] - 1)"

How do I do so it becomes -1? I add the variable Chance then i press on the thing inside [] and writes 1, but i cant add -1
 
Level 7
Joined
Jun 16, 2008
Messages
327
Okay, listen; Please, view the useful tutorials found in the Tutorials sction on The Hive Workshop Forum Index: 99.9% of all your questions are answered there.

And you don't "press on the thing" in the brackets, you click on the integer value between them and customize it.

And also, don't double-post...
 
Level 5
Joined
Jul 25, 2008
Messages
155
I know you do that, but I was wondering how to make it -1
And I already read the tutorials, it didn't help me understand how to make this, I aint very good with variables
 
Level 7
Joined
Jun 16, 2008
Messages
327
You just make it "Arithmetic"-type function, then you click on the red text on the left and set it to the integer "Chance[1]". Then, you click on the blue mathematic symbol in the middle and change it to a minus sign: -. Then, you change the blue number on the right to 1.

PRESTO!
 
Level 5
Joined
Jul 25, 2008
Messages
155
oh now I understand, it was alot of changing with the arithemtic functions, you had to add several things, but I added it :)
Do you know how do I add 100 chances in the map inizialiting? It would be my last question, after that I'm done with all my triggers :)
 
Level 5
Joined
Jul 25, 2008
Messages
155
Oh thank you :x
Now I only need to fix the units and the custom models, and add a hero tavern (which i can add from thehelper tutorial) ^^
 
Status
Not open for further replies.
Top