| 03-07-2009, 07:31 PM | #1 |
Can someone tell me why the damage function of this doesnt work? Making a cast system that recognizes the caster of an ability and the target when the casting begins, then does damage/etc when the ability finishes being cast. It uses two triggers, one for each event. I'm assuming my set variable functions work... ![]() ![]() |
| 03-07-2009, 09:33 PM | #2 |
Please use the [trigger] tag next time, it is faster to load than an image, and easier for you to place it.
|
| 03-07-2009, 09:45 PM | #3 | |
I believe (Ability being cast) refers to the ability being:
Thu-Amsf749, I am not sure what you're aiming for but usually using "Unit starts the effect of an ability" is more accurate than when it starts casting, because there is a time in between when it starts casting and when it starts the effect in which you can actually cancel the ability. Quote:
Since he's using the player-owned event along with an array I don't think he's casting it more than once for any single player. I think the problem here is his condition, like Vexorian said, though the problem is where you are using your condition. The problem with this is when it is compiled it will put the condition into a separate function, and in that function (Ability being cast) will not work properly. You need to move your condition to the Conditions section. |
| 03-07-2009, 11:01 PM | #4 |
--xombie: "Unit starts the effect of an ability" is more accurate than when it starts casting, because there is a time in between when it starts casting and when it starts the effect in which you can actually cancel the ability.-- This is exactly the reason I'm using this type of trigger setup. I'm hoping with this setup, players won't be able to cancel the ability and still have the damage effect happen (A problem I notice is very common among RPGs). I also don't want to have to handle every spell through dumby units. I will try removing the condition and see if it works, thank you all for your help. However, if it is the condition in the if statement that is causing the problem, does that mean I'm going to have to make a new trigger for every ability I want to be handled this way? |
| 03-07-2009, 11:15 PM | #5 |
Try this approach. |
| 03-08-2009, 12:40 AM | #6 |
That works xombie, thank you for the help. |
| 03-08-2009, 01:27 AM | #7 |
Would this mean GetSpellAbilityId() doesn't work inside function calls or what? |
| 03-08-2009, 01:28 AM | #8 | |
Quote:
Actually, I cannot figure out why his initial code would not have worked. The code that I posted should operate no differently than the code posted by Thu-Amsf749. |
| 03-20-2009, 09:48 PM | #9 |
I tested it with a different model and it seems the spell I used for it actually had about a second delay after the animation was finished before it counted as finishing being casted. I was giving the unit a new order right after the animation finished so the ability did not work. Is there a more effective function than finishes casting an ability? |
| 03-20-2009, 09:53 PM | #10 |
The demon hunter model apparently has about a 1 second delay from when the animation of spell casting finishes and when the spell actually registers as finished casting. I was giving the unit new orders as soon as the animation finished which stopped the code from working - When I just casted and then sat there and waited when I was testing after a delay the damage was dealt. Is there a more efficient event than 'finishes casting an ability' that can be used to avoid this? |
| 03-21-2009, 02:19 AM | #11 |
What spell is it based on? Some spells have a channel time. Also, there is I believe a casting point that might affect this? Or am I thinking of turning point? |
