| 12-30-2007, 09:17 PM | #1 |
I have a spell used by a building that has custom conditions which I would like to check before it casts. Currently the two triggers (in GUI) are: Trigger: Trigger: Now, besides the fact that they are both ugly, they don't work as expected. Specifically, the "begins casting the ability" trigger doesn't actually stop the building from casting the spell - I get two error messages (one from each trigger) instead of one if I cast it on a wrong owned unit, and it uses the cooldown. I originally had it simply order it to stop, but that didn't work so I looked around and I heard that I needed to pause the unit first, then unpause after ordering it to stop. Anyways, my question is: How am I supposed to order a building to stop casting an ability before it casts the ability? Are buildings different from "normal" units, in that a stop order doesn't work? Should I use a timer instead of pause/unpause? If so, what's the best method to use a timer using GUI? |
| 12-30-2007, 10:07 PM | #2 |
You may want to put the Event as it receiving the Order to use the ability. Since most abilities will give you an error message when you try to issue the wrong order anyways, not when they try to cast it, it would make sense. I used this for another ability that was giving me issues with ordering it to stop on cast, So I changed it to tell him to stop when the order is given. Then you just have another Trigger for the actual spell. As long as it isn't Auto-cast or you're not trying to make the Computer use it (Which may still work, I have no Idea how most AIs work), it won't cast the spell without the order, so it should do fine. |
| 12-31-2007, 08:57 AM | #3 |
The error may be with the second If/then/else statement. I think Warcraft has a problem with not having any "If" actions. Try switching the conditions to this: Trigger: If - Conditions![]() (Owner of (Target unit of ability being cast)) Not Equal to <Correct owner> |
| 12-31-2007, 09:29 AM | #4 |
My guess is that the problem is that buildings dont usually have the "stop" ability. Other way to stop the casting is to remove the ability and then give it back to the unit. http://www.wc3jass.com/viewtopic.php?t=82 |
| 12-31-2007, 05:11 PM | #5 | |
Quote:
Actually, All units have the stop ability, some just don't show it (If they can't attack or move). Easy way to show it is to add a Blizzard ability with no mana cost to a building that doesn't show it's stop ability (I.E. Barracks, War Mill, Any Altar, etc.). Then have a trigger like this: If you order it to start blizzarding, and then set off the trigger in the middle of the spell, it will stop. |
| 12-31-2007, 05:15 PM | #6 | |
Burning Rose's first response would be the right way to go about this - detect when the order is issued, then issue the stop order. You still might have to Pause/Unpause first (I forget), but I've used this method before and it works correctly. Quote:
|
