HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help me with Knockback Trigger plz..

10-15-2005, 03:07 PM#1
Soultaker
Hey all!

I just got back after having played a long time WoW (extremely fun btw.)

Now I need a Knockback Trigger for my latest map, but it sometimes puts them at the bottom of a cliff or something when I move the unit using the "Move Unit to Point" trigger.

I have seen this in some maps, so it should be doable...

I would say that I'm pretty skilled, but I don't understand any Jass, so if you just write it in GUI, that would be fine

Btw. As a Extra thing would it be nice if the unit died when falling into deep water or falling down from a high cliff

-Soultaker
10-15-2005, 03:12 PM#2
Vexorian
We can't do much to help fix it without the code of your trigger
10-15-2005, 09:10 PM#3
Soultaker
Well.. I deleted it because it didn't work at all.

But I can show the general idea of it :)

Event: Generic Unit uses a ability

Conditions: Ability = AoE Knockback

Actions:

Pick all unit in 500 range of "Casting Unit" and do "Move Picked Unit" to "Position of Casting Unit" offset by "100" towards "Angle from "Postion of Casting Unit" to "Position of Picked Unit" "

That's not really the problem, the problem is that it doesn't always move it proberly if there is another unit at the spot where it should move to, or if there is a cliff between the spot before and after the movement.

Then the Unit is suddenly down the cliff..

So I wanted to hear if anyone had or could make a system that could check for those kind of effects.

Hope you can help me :D

-Soultaker
10-15-2005, 10:54 PM#4
Tim.
First of all, use SetUnitX and SetUnitY instead of instant move, its much better. (You need to use JASS or cusom scripts to do that)

Secondly; you could check for pathing. If position is walkable, continue; else, end. Checking your units would be similar, check units in range, if no units, move. This means running a loop durring the movement.
10-16-2005, 08:30 AM#5
Soultaker
Okay, does it have to be in Jass or could I just use Custom Script in some places? Else I think I will just dumb the idea, and make something else...

I am currently using WE Unlimited, and there is already a "IsPointPathable" option.

Thx for your help

-Soultaker
10-16-2005, 03:10 PM#6
Ant
I think you just need smaller movement distance between intervals.
10-16-2005, 05:14 PM#7
Soultaker
Quote:
Originally Posted by Ant
I think you just need smaller movement distance between intervals.

Well, it might work with the "SetUnitX and SetUnitY" but it doesn't work with Move Unit Instantly, it just won't move at all..

If you could teach me how to use the "SetUnitX and SetUnitY" that would be great.

Thanks again

-Soultaker
10-17-2005, 10:25 AM#8
Tim.
It will work with both 'instantly move unit to' as well as 'SetUnitX' and 'SetUnitY.'

Please post your revised trigger.
10-23-2005, 10:39 AM#9
Soultaker
Quote:
Originally Posted by Ant
I think you just need smaller movement distance between intervals.

Hmm, I reworked the trigger, and it worked!

Thanks for your help guys!
10-24-2005, 05:21 AM#10
vile
http://wc3jass.com/viewtopic.php?t=2374

thats a function to add to your custom scripts section
everytime you move the unit, before you move it, use
Code:
local real x1 = GetUnitX(unit) + dist * Cos(GetUnitFacing(unit) * .017453)
local real y1 = GetUnitY(unit) + dist * Sin(GetUnitFacing(unit) * .017453)
local real x2 = GetUnitX(unit) - dist * Cos(GetUnitFacing(unit) * .017453)
local real y2 = GetUnitY(unit) - dist * Sin(GetUnitFacing(unit) * .017453)
if CheckPathability(x1, y1) and CheckPathability(x2, y2) then
    moveyourunit actions here
endif
Works great.
btw, dist is the amount of distance you move the unit every periodic.