HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Knockback?

07-29-2005, 01:07 AM#1
Oxalic
How could i make an ability have a knockback effect?
In theory:
-Unit uses item "Rocket Launcher"
-Unit is knocked back 100 imaginary units in the opposite direction they are facing
07-29-2005, 08:17 PM#2
Peekaboo
Code:
EVENT
unit uses an item

CONDITIONS
item being manipulated is equal to rocketlauncher

ACTIONS

for each integer A from 1 - X
  - wait 0.00 seconds
  - move (target unit of item/ability(not sure which it will be)) by (100 / X) in direction of (facing of (unit manipulating item))
)
i think that should work, replace X with a number - the higher the number, the smoother the knockback will be, but the longer it will take, 2-4 should be good i think
07-29-2005, 10:53 PM#3
Vexorian
it wouldn't look accurate and you should never use waits inside for loops.

the best looking way is a Periodic Event trigger of 0.04 and moving the unit each time
07-30-2005, 03:32 PM#4
FinalTyrant
Couldnt you also use the WEU add-in action that allows you to slide a unit back with a velocity of your choice in what direction you want?