• 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.

Bounty

Status
Not open for further replies.
Level 8
Joined
Nov 2, 2007
Messages
160
but this will give the 1 gold only in case that one single unit kills 4 enemies.

you should use an array variable for every player and not the custom value

additionally you should add some Conditions like:
Owner of (Dying unit) is an ally of Owner of (Killing unit) is equal to False
Owner of (Dying unit) is not equal to Owner of (Killing unit)
 
Level 8
Joined
Nov 2, 2007
Messages
160
when he wanted to say "for kills" then you yust need to modify the trigger to:

  • Set Gold_amount (Player number of (Owner of (Killing unit))) = (Gold_amount (Player number of (Owner of (Killing unit))) + 1)
  • If Gold_amount (Player number of (Owner of (Killing unit))) equal to 10 then do: Player - Add 1 to (Owner of (Killing Unit)) current gold
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
For each player create a integer variable.

Once you have done that you need to create a trigger like this.

  • Kills Made
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Killing unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set Player1RedInteger = (Player1RedInteger + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player1RedInteger Equal to 4
            • Then - Actions
              • Player - Add 1 to Player 1 (Red) Current gold
              • Set Player1RedInteger = 0
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Killing unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Set Player2BlueInteger = (Player2BlueInteger + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Player2BlueInteger Equal to 4
                • Then - Actions
                  • Player - Add 1 to Player 2 (Blue) Current gold
                  • Set Player2BlueInteger = 0
                • Else - Actions
            • Else - Actions
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
u don't need to do so much work with one array variable and 3 lines of code (i forgot to set the variable back to 0)

I know that you can use arrays and then enter as a array stuf like the number of player and stuf, but this might be better for the guy since he might not be that good at GUI. You should always take that in consideration, if the guy does knows how to use arrays he can change that himself. :wink:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Dinah and Squiggy, both your ways would only work once (bugged).

This is due to you never reseting the variable to 0 after it reaches 4. Thus appon reaching a value of 4 once, it will never be that value again (well technically not as eventually it would interfear with the sign bit and loop around to a negitive number which would eventually be positive but no one ever does 4294967296 kills in one game).

What you probably mean to do is modulo the integer (getting its remainder from a division opperation). Thus in Squiggy's case it would be ModuloInteger(hiskillnumber,4)==0 which would only be true every 4 kills. Dinah, similary would be ModuloInteger(hiskillnumber,10)==0 which would be true only every 10 kills. This completly avoids the need for reseting a variable to 0 and thus enables it to be run from a general number of kills variable that might be used for other systems (like a multiboard).
 
Level 4
Joined
Aug 7, 2008
Messages
115
wow really super good? Lol i thought that would work too! =)
And he want the trigger that add+1 gold when a player kills 4 units.Concluding =4kills = 1 gold
 
Status
Not open for further replies.
Top