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

Help !!

Status
Not open for further replies.
Level 4
Joined
Jan 30, 2012
Messages
61
Hello in my game there is a mode: Team-Deathmatch and the kills are Gold...
So if i kill anyone i get 1 gold... but i want that everyone of my Team has the same gold like the others...example: Red kills a enemy: we have 1 gold, but everyone of his team shall have 1 gold...and if Blue kills another enemy all players in the team have 2 gold... :D
I hope you know what i mean ^^


i did it once it worked... in a other map but now the trigger doenst work... why?


  • Omega Kills
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of Player 6 (Orange)) and do (Actions)
        • Loop - Actions
          • Player - Add (((Picked player) Current gold) - (Player 6 (Orange) Current gold)) to Player 6 (Orange) Current gold
          • Player - Set (Picked player) Current gold to (Player 6 (Orange) Current gold)
 
Level 4
Joined
May 23, 2010
Messages
83
I didn't get the logic in your code, btw, what happens when the trigger runs? And why do you remove gold from the player and then add gold to him again?

You should just Use the Player - Add 1 to Player 6 (Orange) Current Gold and then Player - Set (Picked Player) Current gold to (Player 6 (Orange) Current gold)

EDIT: And the Player - Add 1 to Player 6 (Orange) Current Gold should be out of the loop because you would add unecessary gold to the players.
EDITEDIT: Change your event to A unit Dies and add the proper conditions (like enemy check)
 
Level 4
Joined
Jan 30, 2012
Messages
61
i did...


  • Militia Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
          • ((Dying unit) belongs to an ally of Player 6 (Orange)) Equal to True
    • Actions
      • Player - Add 1 to (Owner of (Killing unit)) Current lumber
      • Player - Add 1 to Player 1 (Red) Current gold
      • Wait 0.10 seconds
      • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to (Player 1 (Red) Current gold)

but it dont work...Red gets one gold but the others not... :/ i hope you know a idea :D
 
Level 4
Joined
May 23, 2010
Messages
83
Are you sure the teams and stuff are properly set? And why did you put the Wait 0.10 seconds?

If there is no other players to kill in your map, just leave like this:

EDIT:
  • Militia Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • Actions
        • set Player = Ower of (Killing unit)
        • Player - Add 1 to Player Current lumber
        • Player - Add 1 to Player Current gold
        • Player Group - Pick every player in (All allies of Player) and do (Actions)
          • Loop - Actions
            • Player - Set (Picked player) Current gold to (Player Current gold)
Where "Player" is a global variable.
 
Level 4
Joined
Jan 30, 2012
Messages
61
because i though thats why it dont work :D
Yes everything works, only the Action with the Pick every player in All alles of Player 1.... doesnt work... :/
Blue is a ally from Red (cant attack him etc.) so i think i did anything wrong with the Action.... :/
 
Level 4
Joined
May 23, 2010
Messages
83
Try to create 2 player groups and set up this on Initalization, so, it should be Player Group - Pick every player in (*your global*) and do (Actions).

And I don't see any leak there. When I get home I'll try to test it on a map.
 
Level 4
Joined
May 23, 2010
Messages
83
oh, you're fast.. So, how teams are set in your map? You simply chose (like a melee map) or it's 'frozen' (like DotA)?
 
Level 4
Joined
Jan 30, 2012
Messages
61
  • Militia Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
    • Actions
      • Set Player = (Owner of (Killing unit))
      • Player - Add 1 to Player Current lumber
      • Player - Add 1 to Player Current gold
      • Player Group - Pick every player in (All allies of Player) and do (Actions)
        • Loop - Actions
          • Player - Set Player 2 (Blue) Current gold to (Player Current gold)

Now Blue got 1 Gold :D so it must have be the "Set - Picked Player current gold..." the picked player....
 
I think players may be neutral toward each others and still not being considered as allies.

Try that and see what's printed :
  • Player Group - Pick every player in (All allies of Player) and do (Actions)
    • Loop - Actions
      • Game - Display to (All Players) the text : (Name of (Picked Player))
It should print the name of the player "Player" at least.

Also, remember that player alliances are one way settings. If you want a mutual alliance, you have to use both :
  • Player - Make Player_1 treat Player_2 as an Allied
  • Player - Make Player_2 treat Player_1 as an Allied
 
Level 4
Joined
Jan 30, 2012
Messages
61
you are right... only red is in Allies of Player...but i did 2 teams... Team 1: Militia Team 2: Omega (i dont know anybetter name :D) and everyone in Team 1 are allied with everyone in Team 1 or not????
 
Level 4
Joined
Jan 30, 2012
Messages
61
what shall i do there?

Forces:

The Milita:
Player 1
Player 2
Player 3
Player 4
Player 5

Omega:
Player 6
Player 7
Player 8
Player 9
Player 10
... :D
they are allied, allied victory, share vision, but no share unit control ^^
 
Level 4
Joined
Jan 30, 2012
Messages
61
I found an easy way :D

  • Militia Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
    • Actions
      • Set Player = (Owner of (Killing unit))
      • Player - Add 1 to Player Current lumber
      • Player - Add 1 to Player Current gold
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • ((Picked unit) belongs to an ally of Player) Equal to True
            • Then - Actions
              • Player - Set (Owner of (Picked unit)) Current gold to (Player Current gold)
            • Else - Actions
not Pick every Player ----> Pick every Unit :D because everyone can only have one hero :D
 
Status
Not open for further replies.
Top