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

Shockwave Knockback

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
The spell I want to make: Hero targets point, shock wave travels that direction for 500/600/700/800) units when the shock wave comes in contact with units it pushs them to the sides.

Now how I imagine I would do this is to upon casting create a dummy unit with the shockwave model and knock'back' it towards the target point. But I am unsure how to leaklessly & lagfreely knockback the units it comes in contact with.

I would think that I could have a trigger that every .4 seconds picks every unit matching unit-type equal to that of the dummy unit, then pick every unit around that and knock it back. But the problem with that is a unit could get knocked back twice.

So I was wondering if I could get some suggestions on how to make this work.
 
Level 10
Joined
Jan 21, 2007
Messages
576
I'm not sure what would solve, my problem with my proposed solution is that a unit would get picked, be knockbacked, but get picked agian and get knockbacked again (twice) by the same shockwave.

EDIT: Unless you were just giving me advice on how to remove leaks from gui because I asked for a leakless solution. I already knew how to do that but thanks anyways ;)
 
well it wouldnt be bad if the shockwave knocked back units more than once, then it gives you a more of a tactical use of the ability, so that more advanced players would try to hit a unit head on so it gets knocked back the distance of the shockwave.


else, you can give the unit a buff when the shockwave unit is near, then if the unit has the buff, knock back as necessary, then remove the buff.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Or just add them on a group named knockedback
dont knock them if they are in knockedback
and clear that group in the end
 
Level 10
Joined
Jan 21, 2007
Messages
576
I've been busy and just got around to it, and realized that as redscores said BOF gives no buff, I'm going to try BOFire quick I'll edit this post with my results.
 
Level 11
Joined
Dec 31, 2007
Messages
780
i would create a dummy with shockwave model and move him with offset in a line and pick every unit within 200 of its position checking if it is an enemy and if it isnt in knockbacked units group... then ill knockback them and add them to knockbacked unit group...


I think thats the best way


Greetings

PS: i think need_02 sayd that xD

EDIT: Oh! btw i dont think the aura thingy will work the same because auras have a little delay to affect units... am i correct? and might not have the same result as "pick every unit within position..."
 
Level 4
Joined
Mar 15, 2008
Messages
71
You should remove/clean all of your variable as soon as you think/know that you don't need them anymore,and you should find a way to optimize all those HUGE triggers into smaller ones (I have no intention in looking at 20+ triggers today ...)
 
Status
Not open for further replies.
Top