So I have two triggers, one with starts a new timer when a unit enters a region, saves that timer to the gdt, and creates a timer window. The other trigger is supposed to display text when that timer from the gdt expires, but..it's not working.
name (type)
global variables: hill timer (timer), hill timer window (timer window)
1
Events
Unit - Any Unit Enters Hill
Actions
Timer - Start hill timer as a One Shot timer that will expire in 5.0 Game Time seconds
Timer - Create a timer window for (Last started timer), with the title "Hill Timer", using Remaining time (initially Visible)
Variable - Set hill timer window = (Last created timer window)
2
Events
Timer - hill timer expires
Actions
Timer - Destroy hill timer window
UI - Display "hill captured!" for (All players) to Subtitle area
Actions: Timer - start new timer as one shot timer that will expire in 5 game time seconds
issue right there if hats all your code, each time a unit enters hill, a new timer is made, when another unit enters, it saves that new timer over the old timer... thats one issue
also as the post above me said... dont use a table, use a global var, or a global array.
So I have two triggers, one with starts a new timer when a unit enters a region, saves that timer to the gdt, and creates a timer window. The other trigger is supposed to display text when that timer from the gdt expires, but..it's not working.
I've been looking at http://forums.sc2mapster.com/development/map-development/2240-timers/ which is a thread created for basically the same reason, but I don't understand the solution (if there ever was one).
@dubo863: Go
post your triggers
yeah its impossible to help without knowing where you need the help =P
Trigger 1:
Events: Unit - any unit enters HILL
Conditions:
Actions: Timer - start new timer as one shot timer that will expire in 5 game time seconds
Data table - save (last started timer) as "hill timer" in gdt
Timer - create a timer window for ("hill timer" from gdt) with [title].........
Trigger 2
Events: Timer - ("hill timer" from gdt) expires
Conditions:
Actions: UI - display "hill captured!" for all players.......
@dubo863
You don't need a data table for this to work
name (type)
global variables: hill timer (timer), hill timer window (timer window)
1
Events
Unit - Any Unit Enters Hill
Actions
Timer - Start hill timer as a One Shot timer that will expire in 5.0 Game Time seconds
Timer - Create a timer window for (Last started timer), with the title "Hill Timer", using Remaining time (initially Visible)
Variable - Set hill timer window = (Last created timer window)
2
Events
Timer - hill timer expires
Actions
Timer - Destroy hill timer window
UI - Display "hill captured!" for (All players) to Subtitle area
Trigger 1:
Events: Unit - any unit enters HILL
Conditions:
Actions: Timer - start new timer as one shot timer that will expire in 5 game time seconds
issue right there if hats all your code, each time a unit enters hill, a new timer is made, when another unit enters, it saves that new timer over the old timer... thats one issue
also as the post above me said... dont use a table, use a global var, or a global array.
It's working now, thank you both.