• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Using ability buttons to turn off and on triggers

Status
Not open for further replies.
Level 3
Joined
May 29, 2007
Messages
26
I'm trying to make it so when a player activates a certain ability, a trigger is turned off, and then when he deactivates it, the trigger is turned back on. I've tried using Defend as the ability and "unit begins channeling ability", "ability being cast equal to Defend", "Deactivate trigger", for the deactivation trigger but it doesn't work.

Do abilities like Defend even count as casting? Should I be using Immolate or something instead of Defend? (I didn't use Immolate because of its time limit. I want the trigger to remain off until the player deactivates the ability themselves)

I know this must possible, but I'm pretty dumb with triggers. Any advice would be appreciated.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
First you can remove mana burn from immolation and then it would be forever.

And I don't think there is any way to tell if its activating or deactivating so you'll need to use a boolean.

Set it to false at start of game and then if player casts set to true and if casts again set to false.

Then create a trigger "if --- is false then do ---" and "if --- is true then do ---".

You could base it on a normal spell, when a unit casts it, remove the spell and give him the "deactivate" spell that will in turn remove itself when casted and bring back the first one.
 
Level 3
Joined
May 29, 2007
Messages
26
I think when you cast "Defend" the order string will be "defend". For deactivating it will be "undefend". With that you can turn off/on a trigger or remove/add an ability for the caster.
Gah, really? I just went ahead and made an on and off ability and trigger-replaced them like GhostWolf suggested. I'll keep this in mind if I ever have to do this again I suppose.
 
Status
Not open for further replies.
Top