| 06-09-2004, 02:30 AM | #1 |
I am making a TD and i have a few towers that auto cast spells with triggers when a fake web spell is cast, but the problem is, the attacking units move quickly enough that by the time the spell is cast the leading units are already outsice the AOE. In addition the units arn't always moving in the same direction, so i cant just off set the point at which the spell is cast by a base amount. Is there any way to determine what direction a unit is moving and then adjust based on that (without using jass, because i don't know jass)? Here is one of the triggers for one of my autocast AOE spells, where Xcoordinate and Ycoordinate are real variables: Cluster Rockets Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Web (Cluster Rockets) Actions Set Xcoordinate = (X of (Position of (Target unit of ability being cast))) Set Ycoordinate = (Y of (Position of (Target unit of ability being cast))) Unit - Order (Triggering unit) to Stop Unit - Order (Triggering unit) to Neutral Tinker - Cluster Rockets ((Point(Xcoordinate, Ycoordinate)) offset by (0.00, 0.00)) |
| 06-09-2004, 04:36 AM | #2 |
Use this instead of your order. Its not word for word from the world editor but you get the idea. Unit - Order (Triggering unit) to Neutral Tinker - Cluster Rockets Position of Target Unit offset by Distance towards Facing Angle of target unit degrees Its late and I cant figure out how to calulate the distance you will need. It will depend of the speed of the unit and the time it takes for the spell to travel. This should put you on the right track though. |
| 06-09-2004, 06:53 AM | #3 |
Instead of having it set the cordinates to variables just do this: Unit - Order (Triggering unit) to Neutral Tinker - Cluster Rockets ((Position of (target unit of ability being cast)) offset by (0.00, 0.00)) Or if you need to you can set the unit to a Variable and just do (Position of(UnitVariable)) That way no matter where the unit has moved to, it will cast it on him, just make sure the spell doesnt have a cast delay. |
| 06-09-2004, 06:36 PM | #4 |
thanks for the help |
