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

Unit "Knock Back"

Status
Not open for further replies.
Level 3
Joined
Apr 30, 2005
Messages
24
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.
 
Level 6
Joined
Feb 15, 2005
Messages
183
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).
 
Level 6
Joined
Feb 15, 2005
Messages
183
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 = )
 
Level 7
Joined
Jul 30, 2004
Messages
451
Draqz said:
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 = )

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
 
Level 6
Joined
Feb 15, 2005
Messages
183
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...
 
Level 7
Joined
Jul 30, 2004
Messages
451
Draqz said:
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...

knockback where the unit simply appears 2 feet back is poor in my standards, that's all i'm saying
 
Level 7
Joined
Jul 30, 2004
Messages
451
Draqz said:
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.

in theory, i believe the simplest version of the periodical knockback requires only 1 unit group in terms of variables
 
Level 3
Joined
Apr 30, 2005
Messages
24
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
 
Level 6
Joined
Aug 29, 2004
Messages
159
Hmm try this for a better looking version, probably would be a bit more laggy, i dont really know.

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 (X) towards (Facing of(Triggering Unit))degrees)
Wait 0.33 Seconds
Unit - Move (Target Unit of ability being cast) instantly to ((Position of target unit of ability being cast) offset by (X) towards (Facing of(Triggering Unit))degrees)
Wait 0.33 Seconds
Unit - Move (Target Unit of ability being cast) instantly to ((Position of target unit of ability being cast) offset by (X) towards (Facing of(Triggering Unit))degrees)

(its just copies of the other trigger's actions, but by making X a small value and doing it 3 times in a second gets the same distance...

I know the feeling of wanting to make it perfect... i know it too well.

As for this other ability you want, it will be impossible to make the unit immune, as otherwise there will be some glitches (ie if he times it wrong, the enemy wont be able to target him)

What i would do is just make an ability which increases your armour by 1000000 for a second or so when you use it. Base it off.. umm... Inner Fire? Berserk (with negative values) Anyone know a better one?

The two sword abilities, you could just use some spell art, like the bloodlust, berserk, orbs etc, where you get an effect attached to your weapon. Thus when the unit casts the ability, he'll have some fire on his sword for a few seconds while it lasts.

hope i helped

Bort
 
Status
Not open for further replies.
Top