• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Activate Ability

Status
Not open for further replies.
Level 2
Joined
Nov 27, 2012
Messages
7
Hello, I want to make an ability that upon pressing it will activate a trigger only if a certain amount of time has passed.

I'm working on a Tug of War map, where players will have the ability to activate either a Light, Heavy or Final Push to help the player avoid death or give them those last few units they need to defeat the enemy. I'm stuck on how I might make an ability that I can just press and the trigger will find out if the ability has been pressed and spawn units if a certain amount of time has passed. I figure that it'd be quite easy. If somebody could help me out, that'd be great. Please no Jass, I'm not that great with the world editor.
 
There is a way that you can make the ability activate after certain events occur (if that is what you are talking about) You could make your ability and make a dummy unit called 'whatever your requirement is'. Then in the ability's techtree requirements you could add that dummy unit.
Now once the required action occurs you can use a trigger to add the dummy unit to the map for your player. This makes the ability active.

I use a similar system for an ability called last stand that is only usable when the unit's life becomes less than 25%. I use a trigger that checks the units life periodically and if it is low enough it creates a dummy unit (The unit has no model file and had the locust ability so it cannot be selected). The dummy is called 25% Health so when the ability is inactive it says this ability requires 25% Health. I don't remember who helped me with this solution, but I thought it was a good idea. Hope this helps!
 
Create a trigger that's initially off. This trigger will run when a unit starts the effect of an ability that you specify (Your Ability in the example). I've named this trigger Ability Cast in my example map.
  • Ability Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your Ability
    • Actions
      • Game - Display to (All players) the text: Code will now run.
Create another trigger. This trigger will turn on the Ability Cast trigger when x seconds has passed. I've named this trigger Enable Ability in my example map.
  • Enable Ability
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn on Ability Cast <gen>
 

Attachments

Status
Not open for further replies.
Back
Top