Initialize a global timer variable with 5 minutes. I am assuming that the player gains control of the beacon through a trigger. If this is the case, the same trigger should have an action which starts the timer. In the trigger that can cause the player to lose control of the beacon, add an action to pause the timer. Then, you only need to set up a trigger with a "Timer expires" event and you are good to go.
First create a new variable, an integer array. I will call it "value", set the size of the array to the max number of players.
Create a new trigger, event should be "map initialization". Here you should set up each array for this variable to 300, so that's every player got a number of 300 which they want to get to 0.
Set Value[1] = 300
Set Value[2] = 300
Set Value[3] = 300 etc...
Create a new trigger with the event "Unit - Any Unit Enters a distance of 1.0 from Unit". 1.0 should be changed to the range you want and unit to the beacon. Add an trigger action, this will activate a third trigger.
This trigger will have the event "Periodic Event" with 1 second so that it checks once ever second if the players unit is still there. If it is then "Set Value[Number of player] = Value - 1, then add a If/then else action and check if Value[Number of player] is less or equal to 0. If it is the player has been there for over 5 minutes!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want to to have a trigger to do something like this:
A player controls beacon X for 5 cumulative minutes
Then do actions
Meaning if a player does not control beacon X, and later gets back control he won't have to wait 5 minutes again but just the time he was missing.
Any ideas?
Initialize a global timer variable with 5 minutes. I am assuming that the player gains control of the beacon through a trigger. If this is the case, the same trigger should have an action which starts the timer. In the trigger that can cause the player to lose control of the beacon, add an action to pause the timer. Then, you only need to set up a trigger with a "Timer expires" event and you are good to go.
First create a new variable, an integer array. I will call it "value", set the size of the array to the max number of players.
Create a new trigger, event should be "map initialization". Here you should set up each array for this variable to 300, so that's every player got a number of 300 which they want to get to 0.
Set Value[1] = 300
Set Value[2] = 300
Set Value[3] = 300 etc...
Create a new trigger with the event "Unit - Any Unit Enters a distance of 1.0 from Unit". 1.0 should be changed to the range you want and unit to the beacon. Add an trigger action, this will activate a third trigger.
This trigger will have the event "Periodic Event" with 1 second so that it checks once ever second if the players unit is still there. If it is then "Set Value[Number of player] = Value - 1, then add a If/then else action and check if Value[Number of player] is less or equal to 0. If it is the player has been there for over 5 minutes!