HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Knock Back?

02-09-2005, 09:09 AM#1
HEZZA
How could i simulate this, im sure theres an ability that does this already...but what?
02-09-2005, 09:15 AM#2
divine_peon
i'm really not that familiar about skills but...

try using triggers?
02-09-2005, 09:42 AM#3
HEZZA
Jee thank you for the helpful infomation, i would never of thought of that, posting in the trigger resportiry and all
02-09-2005, 09:50 AM#4
Guest
What do you call knock back exactly?

If it's when a unit inflicts damage to reflect the damage, then simply use the ability of the crypt lord (whatever its called spiked skin or something) with no armor boost and 100% reflexion

If it's when a unit is attacked to make it strike back use this simple trigger:
Event: a unit is attacked
Action: order attacked unit to attack attacking unit

If it's something else just tell me and i'll try to figure it out

02-09-2005, 10:08 AM#5
Ant
Yes, well, it helps to be specific as to exactly what "knockback" is.

I assume it's basically like knocking units away.

I presume it'll be like an ability or some event happens and you'll have to sort of knock units away from a unit.

Well, you could just calculate the angle away from the unit and move the knocked back unit by that much. There probably is a simpler method, but you can use a dummy unit that faces the knocking back unit, and move it back by a bit offset by it's facing - 180, and move the knocked back unit to the position of the dummy unit.
02-09-2005, 10:23 AM#6
ElvinArcher123
unit is attacked

special effect create-phoenix fire at position of attacked unit
move attacked unit instantly to point offset by angle position of unit offset by facing angle of attacking unit
set position of last created special effect to attacked unit instantly

the phoenix fire makes a good trail
02-09-2005, 11:10 AM#7
logik
goto wc3sear.ch and do a search in the spell section for "knockback"
02-09-2005, 12:58 PM#8
Ant
Of course you can take facing angle of the attacking unit lah... but I'm assuming that it's not so simple otherwise he shouldn't be asking.
02-11-2005, 06:12 AM#9
Raptor--
well, i did knockback in a map from a shotgun blast/RPG/bat and stuff
I can give you a rough overview of one method of doing so, although its rather advanced and i'm not actually going to write everything out explicitly

one way, the way i did it, while involving handle-handle variables, would be to, upon a unit being attacked/getting spell casted at/taking damage, create a trigger, add the event time periodic for like 0.1 seconds, find the angle to knockback (probably the angle between attacking and target in your case) save it to a handle variable binded to the trigger along with the target unit as a handle, and time to knockback as a handle and maybe velocity and other stuff
for the trigger create some actions that basically take the trigger->unit and keep moving it by trigger->velocity in trigger->direction for trigger->time (looped to run until time is reached, then destroy the trigger), and then add the actions to the trigger... and once the knockback time has run out, destroy the trigger

basically that method treats knockbacks as objects (triggers) that it creates each time one occurs and lets them run on their own

i guess another option would be to add any units that get knocked back into a unit group and then again bind variables direction, time, velocity, etc... to the unit in whatever way you want (arrays+customvalue or handle variables, or whatever) and then just have a periodic trigger that constantly runs doing the exact same thing as before