| 05-31-2006, 02:28 PM | #1 |
Hi all! I'm having a bit of trouble with a custom ability. I have an ability based on shockwave, with basically all fields blank. When a unit casts the ability i create a custom unit that then is faced towards the target point at which the ability was cast. A periodic event is used to move the custom unit in the facing direction. This is pretty basic, i'm sure you'll appreciate. My question is this- when i click to cast the ability, the custom unit does not seem to go directly to where i clicked, but instead at an angle to this, just a few degrees out. so if i clicked here ---> X it might end up here--------> X with me standing: here--> X What causes this, and can i correct it? |
| 05-31-2006, 03:16 PM | #2 |
Depending at which angle the custom unit is created, it may take a little while to turn to the correct angle. Why not just create the unit facing that direction? |
| 05-31-2006, 03:33 PM | #3 | |
Quote:
Perhaps i wasn't too clear in my post. The unit actually is created and turned to the angle when it's created. Still haven't resolved the problem. |
| 05-31-2006, 03:53 PM | #4 |
Please post your triggers (in trigger tags). Your description is ambiguous. |
| 05-31-2006, 04:22 PM | #6 |
Well you wait 0.50 seconds, then have the Bullet facing the same way as the Caster. The Caster will probably have turned by then which might be why it's off. Why do you need that wait anyways? Also, having the event 'Begins casting an ability' allows for abuse, if I was playing I could cast the ability then press stop right afterwards; the ability would fire and I wouldn't lose any mana and the cooldown wouldn't start. |
| 05-31-2006, 05:59 PM | #7 |
Just to let you know... Getting the angle between the target point of spell being cast and the caster is MUCH MORE ACCURATE than getting the facing angle of the caster. That is so because if the caster is turned around and you cast the spell behind him, he may only rotate halfway to that point before casting, causing errors in the angle. Also, I would suggest storing the angle into a variable. That way you don't have to deal with accidental mishaps where it faces the wrong way or such. |
| 05-31-2006, 06:22 PM | #8 |
As I suspected, you aren't creating your unit facing the correct angle. As mentioned, create it facing angle between (Position of casting unit) and (Target point of ability being cast). Your triggers, ofcourse, leak and you are using the incorrect event for the casting. |
| 05-31-2006, 06:38 PM | #9 |
Thanks for your help, everyone! I changed it to be the angle between the unit and the casting point so it works fine now! |
