• 🏆 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!

[Trigger] Problem with a buff affecting only 1 unit.

Status
Not open for further replies.
Level 16
Joined
Oct 17, 2009
Messages
1,580
Hey there!
Can you please help me with this trigger, somehow the buff that is supposed to affect many unit only takes 1 unit.
So if anyone could please help me fix this:

  • Blue Howl
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blue Howl
    • Actions
      • Unit Group - Pick every unit in (Units in (Region centered at (Position of (Triggering unit)) with size (650.00, 650.00))) and do (If (((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) then do (Unit - Add Blue Howl (Enemy) to (Picked unit)) else do (Do nothing))
      • Set temp_group = (Last created unit group)
      • Set temp_unit = (Picked unit)
      • Countdown Timer - Start temp_timer as a One-shot timer that will expire in 5.00 seconds
      • Set temp_timer = (Last started timer)
      • Countdown Timer - Create a timer window for temp_timer with title Blue Howl
      • Countdown Timer - Hide (Last created timer window)
Here's the timer trigger:

  • Blue Howl Timer
    • Events
      • Time - temp_timer expires
    • Conditions
    • Actions
      • Unit - Remove Blue Howl (Enemy) from temp_unit
      • Countdown Timer - Destroy (Last created timer window)
      • Custom script: call DestroyGroup(udg_temp_group)
      • Custom script: call DestroyTimer(udg_temp_timer)
 
First off, you leak like hell.
Secondly, use Units in range, instead of Region centered at.
The timer you use will remove it from the last temp_unit saved in the Unit Group loop.
You need to start several timers, for each unit in the group.
Try a normal version first and tell me if it works:
  • Set Point1 = (Position of (Triggering unit))
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 650.00 of Point1 matching ((Matching unit) belongs to an enemy of (Triggering player)) Equal to True) and do (Actions)
    • Loop - Actions
      • Unit - Add Blue Howl (Enemy) to (Picked unit)
  • Custom script: call RemoveLocation (udg_Point1)
I guess your question was why the ability is removed from one unit and not "added", right?
 
Level 16
Joined
Oct 17, 2009
Messages
1,580
Thanks for the reply.
Now I made a better trigger but still the problem persists, no enemy unit gets affected, I think its the dummy thing that has the problem.
Here's the trigger:
  • Blue Howl
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blue Howl
    • Actions
      • Sound - Play preview <gen> at 60.00% volume, attached to (Triggering unit)
      • Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Add Blue Howl (Enemy) to (Last created unit)
      • Unit - Set level of Blue Howl (Enemy) for (Last created unit) to (Level of Blue Howl for (Casting unit))
      • Unit - Order (Last created unit) to Special Rexxar - Battle Roar
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
EDIT:
Never mind.
Saw the problem, it was my dummy unit so I changed it and it worked.
Thanks for the reply.
+rep :D
 
Last edited:
Status
Not open for further replies.
Top