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

[General] Problem with buff and trigger.

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
Hello.

I have made a trigger to detect a certain buff on a unit, to decide if you are to recieve lumber or gold by killing it. However, the lumber part does not work, it seems the trigger does not notice that the unit has the buff.
I got two different units to try it out on, one with the buff and one without it. Currently both units gives me gold.

Both units have 2 point value. The buff I've created is based on war drums from the kodo unit. Does the aura not count as a buff if it is "self" targeted only?

Also, if anyone know a better way to do this, I am all ears.

  • Team1 Bounty
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an ally of Player 12 (Brown)) Equal to True
    • Actions
      • Set Temp_Playergroup = (All allies of Player 1 (Red))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Lumber Bounty ) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Temp_Playergroup and do (Actions)
            • Loop - Actions
              • Player - Add (Point-value of (Triggering unit)) to (Picked player) Current lumber
              • Floating Text - Create floating text that reads (+ + (String((Point-value of (Triggering unit))))) above (Triggering unit) with Z offset 1.00, using font size 11.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Show (Last created floating text) for Temp_Playergroup
        • Else - Actions
          • Player Group - Pick every player in Temp_Playergroup and do (Actions)
            • Loop - Actions
              • Player - Add (Point-value of (Triggering unit)) to (Picked player) Current gold
              • Floating Text - Create floating text that reads (+ + (String((Point-value of (Triggering unit))))) above (Triggering unit) with Z offset 1.00, using font size 11.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 45.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Show (Last created floating text) for Temp_Playergroup
      • Custom script: call DestroyForce(udg_Temp_Playergroup)
Thanks.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I made this trigger:

  • Check Buff
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempBool = False
      • Set TempLoc1 = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 900.00 of TempLoc1 matching ((((Matching unit) is dead) Equal to False) and ((Level of War Drums for (Matching unit)) Greater than 0))) and do (Actions)
        • Loop - Actions
          • Set TempBool = True
      • Custom script: call RemoveLocation( udg_TempLoc1 )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to True
        • Then - Actions
          • Add Lumber
        • Else - Actions
          • Add Gold
It does work faster than the buff though. Usually if a unit gets out of range of the aura, the unit will maintain that aura's buff for a short time. With this, it doesn't notice that delay (so the unit may have the buff, yet still return gold because he just got out of range).
 
Level 25
Joined
Mar 23, 2008
Messages
1,813
Try using an ability instead of a buff, and use integer check to see if it has the ability.

PS: Gold's colour is 100, 86, 0.

I simply made it an ability and switched out my former condition to
  • (Level of Lumber Bounty for (Triggering unit)) Equal to 1
Works great now, thanks. And Thanks for the tip about the color!

@Ap0, thanks for that too, seems it might work as well. However, just switching out the condition feels more simple and convenient, so I'll go with that. I am sure it will be good as a future reference for anyone searching our forums for any problem similar to mine though.

Feel free to mark as solved.
 
Last edited:
Status
Not open for further replies.
Top