• 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!

[Trigger] Wait trigger

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
I am told not to use wait in spells as it bugs, so what alternative would i sue for a spell that freeze enemys by causing them to pause for 3 seconds.

  • Untitled Trigger 004
    • Events
    • Conditions
    • Actions
      • Unit - Pause (Target unit of ability being cast)
      • Wait 3.00 seconds
      • Unit - Unpause (Target unit of ability being cast)
 
that was an example but overall i have:

  • Frozen Arrow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freezing Arrow
    • Actions
      • Set ICEvictimInit[(Player number of (Triggering player))] = (Target unit of ability being cast)
      • Set ICEunit[(Player number of (Triggering player))] = (Casting unit)
      • Unit - Pause (Target unit of ability being cast)
      • Unit - Cause ICEunit[(Player number of (Triggering player))] to damage ICEvictimInit[(Player number of (Triggering player))], dealing (90.00 x (Real((Level of Freezing Arrow for ICEunit[(Player number of (Triggering player))])))) damage of attack type Spells and damage type Cold
      • Wait 3.00 seconds
      • Unit - Unpause (Target unit of ability being cast)
 
You can e.g. use a trigger like:

A unit array and an int array.

Then you set the unti which should be paused to the unit array (like mui spells, using an integer counting the used units in the array)

Then you use this trigger:

Events: Time - Every 1 sec
Condition:
Actions:
For 1 - "CounterInteger"
If(IntegerArra[Integer A] = 3)
Then: Unpause UnitArray[Integer A]
Else: Set IntegerArray[Integer A] = IntegerArray[Integer A] + 1
 
you can use hashtables with your wait or maybe use JASS.. I don't encounter bugs with waits when using locals... in GUI they say Triggering Unit works fine with wait though you cant use it there....

maybe you can save the unit and a timer in a hastable and adjust the timer every 1 second..

  • Hastable - Save Handle of (TargetUnitofAbilityBeingCast) as unit of Key(TargetUnitofAbilityBeingCast) in hashtable
  • Hashtable - Save Integer(3) as time of Key(TargetUnitofAbilityBeingCast) in hashtable
  • Events
    • Time - Every 1 second of Game-time
  • Actions
    • Unit Group - Pick every unit within playable map area matching (matching unit has buff equal to true) then do
      • If-then-else multiple actions
        • If - Conditions are true
        • Condition - Hashtable Load time of Key(Picked unit) in hashtable greater than 0
        • then do
          • Hastable - Save Integer [Hashtable Load time of Key(Picked unit) in hashtable - 1] as time of Key(Picked unit) in hashtable
          • else
            • Unpause picked unit
I know it has leaks but its just an example on how to do it......
 
Haha! Perfect timing for hashtables :)
  • Pause
    • Actions
      • Unit - Pause Unit
      • Unit Group - Add unit to UnitGroup
      • Hashtable - Set 3 as 0 of Key(Unit) in HashTable
  • Interval
    • Events
      • Time - Every 1 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UnitGroup and do Actions
        • Loop - Actions
          • If(HashTable(0,Key(Picked Unit)) equal to 0)
            • Unit - Unpause (Picked Unit)
            • Unit Group - Remove (Picked Unit) from UnitGroup
          • Else
            • HashTable - Set (HashTable(0,Key(Picked Unit)) - 1) as 0 of Key(Picked Unit) in HashTable
 
Status
Not open for further replies.
Back
Top