# WC3 Modding Information CenterFor your WC3 needs...

### Knockback 2D

0 Members and 1 Guest are viewing this topic.

##### Knockback 2D
on: June 25, 2013, 07:02:18 PM

This is the knockback system.
This features the following:
-Easy configuration for the spells
-Bouncing effect if the path is not walkable
-Features friction and velocity
-Destroy Trees and MUI
-Lagless effects(if not abused)
-Booleans like allow collision

To use:
Apply the configuration of your spell in the setup trigger then run the save trigger.
To use the cast save actions run the Init Knockback action then it will automatically start the loop.
You may also change the SFX if you want.

The speed is the one hard to calculate,so i would suggest use this method so you would understand the speed per interval:
(((Speed/Maxtime)x(Loopx2)) - (((Speed/Maxtime)x(Loopx2))/MaxTime)x(LoopxLoop))

Thats the formula.

The example in the map is:
(((1000/2)x(0.03x2)) - (((1000/2)x(0.03x2))/2)x(0.03x0.03))))
So.
((500x0.06) - ((500 x 0.06)/2) x (0.0009))
(30 - ( 30/2) x 0.0009)
((30 - (15 x 0.0009))
((30 - 0.0135))
SpeedInterval = 29.9865

So the Speed Interval is 29.9865
if the time is large and the speed is slow,hence,the unit wont be moved.

To apply knockback effect,make sure to follow the examples of how they are put.

To Import:
Copy the main trigger and variables

##### Knockback 2D
Reply #1 on: June 25, 2013, 07:02:55 PM

Spell is sweet. Approved with 4/5 rating.

##### Knockback 2D
Reply #2 on: June 25, 2013, 07:03:54 PM

Spell is sweet. Approved with 4/5 rating.
Because I need with the new rules to show the code, it's in the submission section until this resource accomplish the condition.