| 03-02-2004, 07:41 PM | #1 |
Ok, here's my problem: I have an autocast spell based on searing arrows and a trigger with a generic unit event (unit starts the effect of an ability) and an ability comparison condition (ability being cast equal to (searing arrows clone)). The trigger will reckognize the casting of the spell ONLY when manually cast, and not when autocast. The spell DOES get autocast, because the unit uses it's mana (so there are no problems with "allowed targets" of the spell or anything like that). So I have two questions: is there a way for a trigger to react to the autocasting of an attack based ability, and if not, is there a way to register when the autocast is turned on/off so I can then base the trigger on the "unit is attacked" generic unit event? |
| 03-02-2004, 07:46 PM | #2 |
Try "Unit begins casting an ability" and the orderstring "turnon" in the object editor is issued when it is right clicked on to auto cast, the turnoff when disabled. |
| 03-02-2004, 08:15 PM | #3 |
The only way I know of is to detect the "Frost arrows" or "Black arrow" buff... I dont know of a way to detect searing arrows. Buff detection is somewhat reliable, especially using JASS and the "Unit takes damage" event, the buff doesn't have to last very long, for me 0.01 seconds works fine, so it's impossible for the player to notice. Heres the reasons the autocast method wont really work: You cant tell if the autocast spell hasn't fired due to lack of mana. It doesn't work with a cooldown on the autocast. So AFAIK the only way is to use a trigger like this: E - unit takes damage C - (Attacked Unit) has specific buff (Frost Arrow Clone) A - Do whatever you want. But ideally the triggers need to be written in JASS to make it reliable. I've now used this method twice, and if I can iron the bugs out of it I'll probably post the solution in the repository. (and if the bugs are inherent to autocast arrows.... I'll probably post it anyway) |
| 03-02-2004, 08:46 PM | #4 |
The buff detection system sounds like the logical solution for everything, but... you mentioned that there are still bugs? Damn, and it seems so failsafe, I mean, what can go wrong? Anyway, another thing, what is the event "unit takes damage"? Is it the same as "unit is attacked" (you use "attacked unit" later in the trigger) or is it some new JASS construct? Edit: Nevermind, tried the "uit is attacked" and it didn't work. Hope you manage to iron out those bugs... |
