| 03-05-2006, 09:03 PM | #1 |
is there a way to detect when an ability cast hits the target? such as, i cast a storm bolt to a target, when it hits that target, then do something? |
| 03-05-2006, 09:08 PM | #2 |
castersystem has a spell included like this. |
| 03-05-2006, 10:00 PM | #3 |
id rather not use have to import the caster system just so I can detect when the misile hits the unit |
| 03-05-2006, 10:23 PM | #4 |
You can do several things: 1) Do a wait until the target has the buff given by the spell(not full proof and doesn't work for units with no buff) 2) Create a little trigger when the spell is cast with the event that the unit takes damage, attach stuff to it and then detect/cleanup when the trigger fires off. Oh and if it has a buff check for the buff. FYI, negative buffs count as damage. Maybe there are other methods, maybe vex will post something useful. |
| 03-05-2006, 10:29 PM | #5 |
| 03-05-2006, 10:32 PM | #6 |
Doesn't properly account for unit movement and similar affects. I guess its not a big deal, but in some cases it can look extremely wierd. |
| 03-05-2006, 10:32 PM | #7 |
that is what I have had to use until now, but that only works half decent if the wait is over .2, and the target is not moving, else it will look goofy, any better alternatives? |
| 03-05-2006, 10:35 PM | #8 |
Make the spell use a buff that is added when the missile hits, and then use a timer to detect when the unit gets the buff. |
| 03-05-2006, 10:36 PM | #9 |
sounds like a plan, ill give it a whirl :) |
| 03-05-2006, 10:43 PM | #10 |
I use the method posted by shadow1500 everytime and it works perfectly. You can use game time waits or, even better timers for extra accuracy. The movement of the unit doesn't really affect anything unless you are using like a distance of 3000 game [whatevers] And it is always possible to account unit movement, well not really worth it but there is. |
