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

[Trigger] How do you add gold to a specific Race at the start of a Map?

Status
Not open for further replies.
Level 5
Joined
Jun 27, 2009
Messages
137
As the title suggests I need help with setting a trigger that at the start of the match adds gold to a specific race. The only way I could figure to do it is just having it be a specific Player, and then allowing you to choose the different teams to be the different races. Is there another way to do this?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
What about:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Equal to Night Elf
            • Then - Actions
              • Player - Set (Picked player) Current gold to 750
            • Else - Actions
OR
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching ((Race of (Matching player)) Equal to Undead)) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to 750
You can off course, change the race and the actions as you like.
 
What about:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Equal to Night Elf
            • Then - Actions
              • Player - Set (Picked player) Current gold to 750
            • Else - Actions
OR
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching ((Race of (Matching player)) Equal to Undead)) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to 750
You can off course, change the race and the actions as you like.

Use his second solution because the first solution can cause desyncs.
 
Spartipilo, your second solution leaks:

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set force = (All players matching ((Race of (Matching player)) Equal to Undead))
      • Player Group - Pick every player in force and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to 750
      • Custom script: call DestroyForce(udg_force)
Where "force" is variable of type 'player group'.
 
Status
Not open for further replies.
Top