Hi all. I was hoping someone out there could help with this little problem. I have this map that is designed so when a player enters a region he will have to stay in it and hold the position for X amount of time and if he does it then it will spawn some buildings and such. I know how to do most of this but I'm just not quite sure how to set up the Timer. If the player leaves the region then the timer needs to reset and start again if he enters . Can anyone help me with this problem?
Create a global timer variable to use here. Start Timer will get the timer ticking, Pause/Resume Timer will allow you to stop the timer. Those should be all you need. If a unit owned by the player enters the region, check to see if that player has no other units in the region. If true, start the timer at whatever the max is. If a unit leaves the region and the player has no units there, pause the timer. Then use the Timer Expires event in a new trigger to do all your building spawn stuff.
Ok I got everything working now except for 1 thing. The timer window won't disappear if the unit leaves or gets killed. I tried using the Destroy timer window but it seems to not work. These are the triggers I have so far.
Event
Any unit enters region
Condition
owner of triggering unit ==1
clock check ==0
Actions
Create 30 second timer
Set Timer for Timer Window for 30 second timer
Unpause 30 second timer
Start 30 second timer
Set clock check = 1
Event
Any unit leaves region 1
Conditions
owner of unit == 1
number of any living units in region 1 == 0
Action
Restart 30 second timer
Pause 30 second timer
Destroy Timer window
set clock check = 0
Event
Any unit dies
Conditions
owner of unit == 1
triggering unit is in region 1 == true
Action
Pause 30 second timer
Restart 30 second timer
Destroy Timer window
set clock check = 0
Everything works fine and well but for some reason the windows isn't going away. Can anyone help me out to get rid of that window when the unit dies/leaves?
Can anyone please help with this problem? I'm just stuck at this dead end and can't figure it out now. I don't know why after I set the timer to the timer window why it won't get hidden/destroyed/moved. I've tried a bunch of different tricks to try to get it working but i just can't find it. Any help would be awesome.
Create a timer window variable. When you assign your timer to a timer window, immediately set the window to the timer window variable. Then when you want to destroy the window, select the timer window variable you made.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi all. I was hoping someone out there could help with this little problem. I have this map that is designed so when a player enters a region he will have to stay in it and hold the position for X amount of time and if he does it then it will spawn some buildings and such. I know how to do most of this but I'm just not quite sure how to set up the Timer. If the player leaves the region then the timer needs to reset and start again if he enters . Can anyone help me with this problem?
Create a global timer variable to use here. Start Timer will get the timer ticking, Pause/Resume Timer will allow you to stop the timer. Those should be all you need. If a unit owned by the player enters the region, check to see if that player has no other units in the region. If true, start the timer at whatever the max is. If a unit leaves the region and the player has no units there, pause the timer. Then use the Timer Expires event in a new trigger to do all your building spawn stuff.
Ok I got everything working now except for 1 thing. The timer window won't disappear if the unit leaves or gets killed. I tried using the Destroy timer window but it seems to not work. These are the triggers I have so far.
Everything works fine and well but for some reason the windows isn't going away. Can anyone help me out to get rid of that window when the unit dies/leaves?
Make a variable and set it to something.
@Tekaichi: Go
a variable for what? The timer window or the timer or what?
Can anyone please help with this problem? I'm just stuck at this dead end and can't figure it out now. I don't know why after I set the timer to the timer window why it won't get hidden/destroyed/moved. I've tried a bunch of different tricks to try to get it working but i just can't find it. Any help would be awesome.
Create a timer window variable. When you assign your timer to a timer window, immediately set the window to the timer window variable. Then when you want to destroy the window, select the timer window variable you made.