HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Knockbak Effect*

11-29-2004, 10:18 PM#1
Funslug
how would u make a hero be knocked bak a few feet from where he was standing when a hero attks him? i have made it unit move instantly to center of triggering unit offset by 150,25 but...it will knock him bak alwayz to the rite...wtf can ne one help me so that the knockbakk will work correctly so he will be knocked bak the rite way?
11-29-2004, 10:20 PM#2
Vexorian
use polar off set and the angle between the units
11-29-2004, 11:24 PM#3
-={tWiStÄr}=-
Instead of 25
11-30-2004, 03:10 PM#4
Funslug
Quote:
Originally Posted by Lord Vexorian
use polar off set and the angle between the units

would u be so kind by giving me an example of this trigger perhaps showing me..^_____^ thanks
12-02-2004, 01:18 AM#5
harshateja
Quote:
Originally Posted by Funslug
would u be so kind by giving me an example of this trigger perhaps showing me..^_____^ thanks

Heres what i would do since polar offset doesnt always work. Its basically the same thing but made by hand:

Move unit instatnly to position of targeteted unit offset by Distance/cosine (angle of targeteted unit), Distance/sine (angle of targeted unit) ->(x,y)
12-02-2004, 01:06 PM#6
Kolibri
I've never had problems with polar coordinates.

When using polar coordinates you give it a angle and an offset. The resulting point will be the original point offset offset in direction angle.

The angle should be a number between 0 and 360.
12-02-2004, 03:46 PM#7
oNdizZ
the only problem i've met when using polar projection is that when you use something this on the angle:
Angle of triggering unit - 90
becouse then, if the unit is facing an angle that is smaller then 90, it will only be zero (0)
but, you can always use:
Angle of triggering unit + 270
instead, couse then it will work :)
12-02-2004, 04:03 PM#8
Kolibri
To get a valid angle, no matter what ANGLE is, do this:

set ANGLE = modulo( modulo(ANGLE, 360)+360, 360)
12-02-2004, 04:19 PM#9
oNdizZ
what does the modulo do? :S
12-02-2004, 06:39 PM#10
Kolibri
It is the rest after division.

9 modulo 4 = 1 (9/4 gives 2 and a rest of 1)
12 modulo 10 = 2 (12/10 gives 1 and a rest of 2)
920 modulo 360 = 200 (920/360 gives 2 and a rest of 200)
12-02-2004, 08:34 PM#11
Captain Griffen
Or get the angle between the 2 points + 180 (it goes from -180 to +180, so that gives a +ve and correct value).