HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Knockback

05-22-2004, 06:58 PM#1
linkmaster23
I need a trigger that pushes units back the come within so close of a certain unit-type. Variables are not usable and the trigger needs to only effect units in front of the unit-type.
05-22-2004, 07:42 PM#2
johnfn
Quote:
Originally Posted by linkmaster23
I need a trigger that pushes units back the come within so close of a certain unit-type. Variables are not usable and the trigger needs to only effect units in front of the unit-type.

Eh, this isnt so hard. Just make a Region centered on the unit and offset it by the position the unit is looking. Then move every unit in the rect back. I suppose the only problem here is making it look good enough. You should probably loop every 0.05 seconds and move the unit back a small number. Give me a few seconds and I'll write the code...
05-24-2004, 07:08 PM#3
Kelna2
if you meant like a knock back attack/spell then you can do it this way:

Event: a unit is attacked

Condition: Owner of attacked unit is equal to Neutral Hostile

Action: Move unit instantly to Polar Offset Position of attacked unit offset by 100 Towards Arithmetic facing attacked unit - 180

The condition is changable to be what ever you want but i just put neutral hostile in because its usually an enemy, it could be changed to casted spell is equal to what ever. the action does this:

it takes the position of the attacked unit and moves it 100 towards the angle the attacked unit is facing and subtracts 180 (so it moves it the opposite direction its facing).

that should work i think.....
05-24-2004, 08:00 PM#4
johnfn
Quote:
Originally Posted by Kelna2
if you meant like a knock back attack/spell then you can do it this way:

Event: a unit is attacked

Condition: Owner of attacked unit is equal to Neutral Hostile

Action: Move unit instantly to Polar Offset Position of attacked unit offset by 100 Towards Arithmetic facing attacked unit - 180

The condition is changable to be what ever you want but i just put neutral hostile in because its usually an enemy, it could be changed to casted spell is equal to what ever. the action does this:

it takes the position of the attacked unit and moves it 100 towards the angle the attacked unit is facing and subtracts 180 (so it moves it the opposite direction its facing).

that should work i think.....
You had the almost correct thing, except for
Quote:
Originally Posted by linkmaster23
the trigger needs to only effect units in front of the unit-type
MY idea handles this. The reason I never got around to writing the code is because I lost my Wc3 cd... argh.
05-24-2004, 10:21 PM#5
ThyFlame
You can only move a region once, unless that was fixed in 1.15. You must use rectangles otherwise.