• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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)
 
Level 10
Joined
Apr 3, 2006
Messages
535
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)
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
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......
 
Level 12
Joined
Aug 22, 2008
Messages
911
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.
Top