Trigger API Reference\DCEI Events\Timer
TriggerHandle TriggerAddTimerEventElapsed(TypedCallback trigger, float time, bool useRealTime = False, bool simple = False)
TriggerHandle TriggerAddTimerEventElapsed(TypedCallback trigger, float time, bool useRealTime = False, bool simple = False)
Description
This event triggers when the timer has elapsed. Particularly if you need to pause or destroy a timer before it elapses, you will want to use Core timers instead.
For more examples of when different times of waits or timers should be used, see this notion guide.
Parameters
- TypedCallback
trigger
the callback function that is run when the event is triggered. - float
time
the amount of time the timer runs for. - bool
useRealTime
if true, uses real time instead of game time. - bool
simple
this flag reduces overhead by preventing the usage of DCEI.Wait() within the trigger. You should only set this to true if the trigger does not utilize DCEI.Wait() at all.
Example Usage
DCEI.TriggerAddTimerEventElapsed(OnTimer, 5, false, true)
function OnTimer()
DCEI.LogMessage("Timer Ended")
end
TriggerHandle OnMapStart(TypedCallback trigger)
TriggerHandle OnMapStart(TypedCallback trigger)
Description
This event triggers on map start.
Parameters
- TypedCallback
trigger
the callback function that is run when the event is triggered.
Example Usage
DCEI.OnMapStart(A)
function A()
DCEI.LogMessage("A")
end
TriggerHandle TriggerAddTimerEventPeriodic(TypedCallback trigger, float period, int lifeCount, bool useRealTime = False, bool simple = False)
TriggerHandle TriggerAddTimerEventPeriodic(TypedCallback trigger, float period, int lifeCount, bool useRealTime = False, bool simple = False)
Description
This event triggers periodically on a timer, for the given number of times. In most cases, you will want to use Core timers instead.
For more examples of when different times of waits or timers should be used, see this notion guide.
Parameters
- TypedCallback
trigger
the callback function that is run when the event is triggered. - float
period
the amount of time between each trigger call. - int
lifeCount
the number of times the trigger is called. - bool
useRealTime
if true, uses real time instead of game time. - bool
simple
this flag reduces overhead by preventing the usage of DCEI.Wait() within the trigger. You should only set this to true if the trigger does not utilize DCEI.Wait() at all.
Example Usage
function A()
DCEI.LogMessage("A")
end
DCEI.TriggerAddTimerEventPeriodic(A, 1, 15, false, true)
TriggerHandle TriggerAddTimerEventPeriodicIndefinite(TypedCallback trigger, float period, bool useRealTime = False, bool simple = False)
TriggerHandle TriggerAddTimerEventPeriodicIndefinite(TypedCallback trigger, float period, bool useRealTime = False, bool simple = False)
Description
This event triggers periodically on a timer, for an indefinite number of times. In most cases, you will want to use Core timers instead.
For more examples of when different times of waits or timers should be used, see this notion guide.
Parameters
- TypedCallback
trigger
the callback function that is run when the event is triggered. - float
period
the amount of time between each trigger call. - bool
useRealTime
if true, uses real time instead of game time. - bool
simple
this flag reduces overhead by preventing the usage of DCEI.Wait() within the trigger. You should only set this to true if the trigger does not utilize DCEI.Wait() at all.
Example Usage
function A()
DCEI.LogMessage("A")
end
DCEI.TriggerAddTimerEventPeriodicIndefinite(A, 1, false, true)