• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Bounty

Status
Not open for further replies.

VOLBEAT.BoR

V

VOLBEAT.BoR

Hi guys can anyone explaine me how i can prgram Bounty that 4 kills give o1 Gold thx for help :D
 
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)
 
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
 
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
 
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:
 
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).
 
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.
Back
Top