| 03-13-2007, 12:35 AM | #1 |
I have a spell based on dark arrows that has a trigger to add % damage based on the hero's agil. Problem is that I want to balance the ability to be autocast, but have a 3-5 second CD. As of now I have the trigger for the manual cast set up to trigger on ability cast. For the Autocast, when the unit is given the order(blackarrowon) it turns on the autocast trigger (initially off), and turns off the autocast trigger if the unit is given the order (blackarrowoff). The autocast trigger triggers on unit attack (instead of spell cast) and causes the trigger-driven damage and orders the unit to cast the black arrow spell. My problem is that I don't wan't the trigger to run if the ability is on cooldown. My question is: what is the simplest way (GUI) to make the trigger damage not run if the ability is on cooldown, i.e. make a trigger so that it will only run the damage trigger if the spell is actually cast, or make an "if" statement to check if the spell is on cooldown. P.S. I tried making the autocast trigger Run(checking conditions) the manual cast trigger and that didnt work. |
| 03-13-2007, 02:06 AM | #2 |
You'll need another trigger: And just only do the damage things if the boolean is true. |
| 03-13-2007, 02:40 PM | #3 |
Cool, thanks. That works for me. |
| 03-13-2007, 04:29 PM | #4 |
You could also give the ability a cooldown itself. The Poison arrow has a c/d that works even with a cooldown. |
| 03-13-2007, 07:20 PM | #5 |
His problem was not that the spell didn't have an autocast, but that he didn't know how to get the triggered effect to not happen, because it was a generic event that he couldn't filter. |
| 03-13-2007, 07:23 PM | #6 |
Ah I thought he had a trigger which appropriately detected the firing of an ability, but the auto-cast was firing quicker than the trigger was supposed to... The solution in my mind that seemed simplest was to put a c/d on the ability..lol, guess I got confused :) |
| 03-13-2007, 07:46 PM | #7 |
No biggie, like pyro said, I had a trigger driven effect of the spell that I wanted to fire only when it wasnt on CD. Autocast spells w/no CD don't have this problem, but since I only want mine going every 3-5 seconds, I had to make a trigger to keep it form firing while on CD |
| 03-15-2007, 05:29 PM | #8 |
I have another quick question with autocasting, and I figured this is as good a spot as any (aside the fact that its off-topic from the original post). Is there anyway to detect when an ability autocast has been turned on (and thus, immediately turn it back off again) ? |
| 03-15-2007, 05:32 PM | #9 |
Detect the "activate" order, i do belive. (check the object editor to find out what it is for a specific ability) |
| 03-16-2007, 02:28 AM | #10 |
| 03-16-2007, 05:28 PM | #11 |
I don't think anyone here has properly answered your question, so I'll try my hand at it. From what I understand, whenever the unit attacks you want to reissue it to instead cast the dark arrows ability on the unit. I dont have access to WE right now, but I'll try to write some pseudo-code for you When the unit attacks, run this: EDIT: Here's the GUI way of doing what I initially posted in JASS: First declare a boolean variable called TempBoolean Next, In your Trigger that runs when the unit attacks while autocast is on, put these actions in place of whatever you had: Trigger: IMPORTANT: Since I don't have access to WE right now, I'm not sure if the syntax for GetAttackedUnit() and GetAttacker() is exactly right. When I get home I'll doublecheck them. Also, I'm not sure if the actual orderstring is "darkarrows", make sure you doublecheck that. If you look, the IssueOrder natives all return a boolean. This boolean returns true if the unit was able to go through with the order, and false if it wasnt (due to cooldown, or not enough mana). |
| 03-16-2007, 05:46 PM | #12 |
Thanks for the help guys, hopefully that'll take care of me! :D EDIT: Wrote a small script based on that immolation example, but the spell doesn't automatically turn of autocasting like it aught to. |
| 03-16-2007, 07:26 PM | #13 | |
Quote:
And WNxCryptic, what do you mean by "doesn't turn off like it should"? |
| 03-18-2007, 05:21 AM | #14 |
I have a trigger setup so that the ability appropriately works when it is clicked (or hotkeyed) and used on a target unit... However, if autocast is on, then that trigger will never fire (because autocast cannot be accurately detected for an ability) And yes, i need to base the spell off of searing arrows (OR, I need to force the unit to play a particular animation INSTEAD of the default "spell" animation of the unit) |
| 03-18-2007, 05:41 AM | #15 | |
Searing arrows is broken. Use Dark Arrows. Quote:
In GUI: Animation - Play YourUnit 's "spell channel" animation Or in JASS:call SetUnitAnimation(YourUnit, "spell channel") //Or call SetUnitAnimationByIndex(YourUnit, 9) |
