• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Team Gold award?

Status
Not open for further replies.
A unit dies, check with Or Conditions what is the type of the (Triggering unit) [Unit-type comparison], run a loop from 1 to 10, check if Player(Loop) is an enemy of (Owner of (Triggering unit)), if Player(Loop) is Playing and if Player(Loop) is a User and add X gold to Player(Loop). Loop is your integer, just like the default Integer A or Integer B.
 
Level 11
Joined
Jun 26, 2014
Messages
499
A unit dies, check with Or Conditions what is the type of the (Triggering unit) [Unit-type comparison], run a loop from 1 to 10, check if Player(Loop) is an enemy of (Owner of (Triggering unit)), if Player(Loop) is Playing and if Player(Loop) is a User and add X gold to Player(Loop). Loop is your integer, just like the default Integer A or Integer B.

Hello ... so im kinda newbie and I don't understand everything from that could you post the triggers pretty please :D :3 Thanks a lot!
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Pharaoh's way is good, but it is overly complicated for what it is meant to be.

This is almost sufficient:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • 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
              • ((Triggering unit) belongs to an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player - Add 40 to (Picked player) Current gold
            • Else - Actions
Of course you may add different amount depending on the unit type that dies. You dont need to check if player is playing or not, that is useless unless you have system like Dota where money of players that left is distributed to the other players on their team. If you have something like that, than it is mandatory to have it and it would look like this

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • 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
              • ((Picked player) slot status) Equal to Is playing
              • ((Picked player) controller) Equal to User
              • ((Triggering unit) belongs to an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player - Add 40 to (Picked player) Current gold
            • Else - Actions
Edit: well there is GUI way to get if player is user and if he is playing, so it makes it a lot easier to check
 
Status
Not open for further replies.
Top