Warcraft III resources & community, 2003–2006 · archived

Unit "Knock Back"

16 posts
#1

Unit "Knock Back"

First of all, I was wondering if there was some way to make some kind of distance variable, and if not, then I guess we need to take this from the start.

I'm making a map, and one of the weapons one of the units has is an abillity that knocks back enemies on contact (it's fired as a gun, and has to actually hit them to work), so I wanted to know if anyone knew how to make the trigger I need to use to be able to knock back a unit (not a hero).

Anyhow, thanks.
#2
distance variable? you should be able to use a real variable for that I would imagine.

You could say something like

Event - Unit is attacked by gun
Action - move unit offset by (real distance) towards (facing of attacking unit).
#3
except it's an abillity
#4
ok...
Event - Unit finshes cast ability
Condition - (Ability being cast is gun ) = true
Action - Move target unit of ability being cast by (real distance) towards (facing of casting unit)
#5
1. you forget, the unit must be hit by the projectile

2. Real variables don't work for Move Unit triggers, only points are accepted.
#6
you use the function "point with polar offset" that will give you the "distance" effect. I'm gunna write out a complete trigger for you, ill post in a few mins.
#7
alright thanks, I really don't have much experience with variables (I usually try to avoid them as much as possible, but now I've realized I have no choice but to use them).
#8
Generic Unit Event - Unit finishes casting an ability
Ability Comparison - (Ability being cast) Equal to Gun
Action -
Unit - Move (Target Unit of ability being cast) instantly to ((Position of target unit of ability being cast) offset by (Real number) towards (Facing of(Triggering Unit))degrees)


The action i used was "Move unit(instantly)" and for the point, i used "point with polar offset". I think you should be able to put it together how you want it after that, if not let me know = )
#9
THANK YOU!!!!! IT WORKS!!!!!!
#10
DraqzGeneric Unit Event - Unit finishes casting an ability
Ability Comparison - (Ability being cast) Equal to Gun
Action -
Unit - Move (Target Unit of ability being cast) instantly to ((Position of target unit of ability being cast) offset by (Real number) towards (Facing of(Triggering Unit))degrees)


The action i used was "Move unit(instantly)" and for the point, i used "point with polar offset". I think you should be able to put it together how you want it after that, if not let me know = )


thats a very poor way to do knockback, what would look better is to have a periodic trigger that knocks units back a small amount every 0.05 seconds maybe, and repeats this for a short amount of time so it moves back smoothly, also variables could be tied to the unit (ok this is more complicated) to simulate drag so the unit will get knocked back and will slow down smoothly
#11
poor? I wouldn't say that, I just wanted to get the guy started with something, he can alter that and make it look the way he wants. I'm not even sure how far he wants it to knock back, if it is just a small amount, then making a trigger which repeats itself would be kinda silly.

for what you are suggesting raptor, wouldn't you need uses local varriables and make a local trigger? for some reason, I don't think that is what he wanted...
#12
Draqzpoor? I wouldn't say that, I just wanted to get the guy started with something, he can alter that and make it look the way he wants. I'm not even sure how far he wants it to knock back, if it is just a small amount, then making a trigger which repeats itself would be kinda silly.

for what you are suggesting raptor, wouldn't you need uses local varriables and make a local trigger? for some reason, I don't think that is what he wanted...


knockback where the unit simply appears 2 feet back is poor in my standards, that's all i'm saying
#13
oh no, trust me I agree, its not very pretty at all. But he said he was leary about even using variables, I didn't think telling him to start adding custom scripts or loops would have been very productive.
#14
Draqzoh no, trust me I agree, its not very pretty at all. But he said he was leary about even using variables, I didn't think telling him to start adding custom scripts or loops would have been very productive.


in theory, i believe the simplest version of the periodical knockback requires only 1 unit group in terms of variables
#15
Actually, this is exactly what I wanted. Although something else might look better, for practical use, this is perfect. If you can give me a better trigger that still has the same practical use, but looks better, fine, go ahead and do it.

Second, the whole point of the weapon is a fast firing weapon that when it hits someone, wields such a force that it knocks the person back immensly. However, it doesn't hurt the person because in the arena, everyone is requred to wear special armor, and the only weapons that can pierce this armor are much slower firing, therefore making this a powerful weapon because of its speed for avoiding danger.


Also, not to be demanding, but there is yet another problem in this very same map (the whole point of this map is that I'm trying to make it exactly as I planned it, so I'm gonna need a lot of help in order to create such a masterpeace). Basically, I have two sword abillities. In order to stop these, players must use the defend abillity, and time it correctly to block the attack. So I needed to know if there was anyway to create immunities to a specific spell/abillity, or if a whole new concept is in order. While we're at it, since the two abillities are effectivly the same, is there anyway to be able to tell by looking at the unit if he is attacking with an Upper or Lower Strike, so you can defend accordingly.

Thanks
-Yal