• 🏆 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] Spawn Unit leaked on passive skill

Status
Not open for further replies.
Level 5
Joined
Apr 15, 2007
Messages
74
Event
-unit is (attacked)
Condition
-unit has (buff) equal to (true)
Action
-unit-create 1 (dummy) for owner of (attacking unit) at position of (attacking unit) facing (w/e facing degrees)
-wait (0.4) seconds
-remove (dummy)


that buff is stunned(pause)
i set bash to 100% to test if it works but when the unit is bashed no dummy is spawned on the first bash, on the second bash about 5 dummy(s) were spawned.
any way to fix??
 
Level 4
Joined
Mar 15, 2008
Messages
71
for this trigger I think you should use jass...no other way,unless you know the exact time from the start of the attack till it ends...
 
Level 5
Joined
May 27, 2007
Messages
144
or if you would like to stay by gui. You need 2 triggers. First one which will detect that you have buff and are attacking/ed. This trigger will also add new condition to the 2nd one (unit - takes damage) In the 2nd trigger you do the spawn stuff. Also make a condition (damage source - attackingunit[variable]) it should work
 
Level 5
Joined
May 27, 2007
Messages
144
nope you dont i forgot to type that you have to remove the leaks :D using custom script! It works fine im using it a lot
 
Level 5
Joined
May 27, 2007
Messages
144
You can't remove events from triggers (well, you can, but you have to do a mass wipe, which would bug up your system).

I think you dont have to remove events from trigger! just turn it off and on and the added event will be there but with new unit = same variable!
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I think you dont have to remove events from trigger! just turn it off and on and the added event will be there but with new unit = same variable!

Turning it off simply stops it from responding to events, it doesn't remove anything.

The best way in GUI is to add a new event for every unit that enters the map, this way you leak one event per unit (that can die / be removed from the game) instead of possible infinite leaks (each time a unit attacks) if you do it your way.
 
Status
Not open for further replies.
Top