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

Countdown Timer

Status
Not open for further replies.
Level 8
Joined
Jun 16, 2008
Messages
333
How do I make a timer where if someone from a team enters a region and a timer starts for each person who enters the region and it ends in 30 seconds which takes them to another region?

If you can help, you could ether do it in Jass or GUI
 
Level 11
Joined
Dec 5, 2009
Messages
846
Something like this ? :)

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Your region <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 1 (Red)
    • Actions
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Time
      • Countdown Timer - Hide (Last created timer window) for Player 2 (Blue)
      • Countdown Timer - Hide (Last created timer window) for Player 3 (Teal)
      • Countdown Timer - Hide (Last created timer window) for Player 4 (Purple)
  • .......ETC
 
That won't be MUI though, Chewii ;)

iown_azz, you will need a hashtable for that and a footman with an expiration timer:
  • One
    • Events
      • Unit - A unit enters Region One <gen>
      • Unit - A unit leaves Region One <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Not equal to Footman
    • Actions
      • Custom script: if GetTriggerEventId() == EVENT_GAME_ENTER_REGION then
      • Set Points[1] = (Position of (Triggering unit))
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Points[1] facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
      • Hashtable - Save Handle Of(Triggering unit) as (Key unit) of (Key (Last created unit)) in Hash
      • Hashtable - Save Handle Of(Last created unit) as (Key dummy) of (Key (Triggering unit)) in Hash
      • Custom script: call RemoveLocation (udg_Points[1])
      • Custom script: elseif GetTriggerEventId() == EVENT_GAME_LEAVE_REGION then
      • Unit - Remove (Load (Key dummy) of (Key (Triggering unit)) in Hash) from the game
      • Hashtable - Clear all child hashtables of child (Key (Load (Key dummy) of (Key (Triggering unit)) in Hash)) in Hash
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Hash
      • Custom script: endif
  • Two
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Key unit) is stored as a Handle of (Key (Triggering unit)) in Hash) Equal to True
    • Actions
      • Set Points[2] = (Center of Region Two <gen>)
      • Custom script: call SetUnitX (LoadUnitHandle (udg_Hash, GetHandleId (GetTriggerUnit()), StringHash("unit")), GetLocationX (udg_Points[2]))
      • Custom script: call SetUnitY (LoadUnitHandle (udg_Hash, GetHandleId (GetTriggerUnit()), StringHash("unit")), GetLocationY (udg_Points[2]))
      • Hashtable - Clear all child hashtables of child (Key (Load (Key unit) of (Key (Triggering unit)) in Hash)) in Hash
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Hash
      • Custom script: call RemoveLocation (udg_Points[2])
Test Map: View attachment Timed Teleportation.w3x

Go towards the region that has trees around it and you will be teleported within 4 seconds in the other region. If you leave the region, before those 4 seconds, you will not be teleported.
 
Status
Not open for further replies.
Top