DCS func setFunctionTime

From DCS World Wiki - Hoggitworld.com
Revision as of 00:12, 12 April 2018 by Grimes (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Scripting Root

Envrioment: Mission Scripting
Function: setFunctionTime Added with: 1.2.0
Member Of: timer
Syntax: function timer.setFunctionTime(number functionId , time modelTime )
Description: Re-Schedules an already scheduled function to run at a different time in the future.


Return Value: function
Return Example: none
Examples: The following will run a function named "main" 120 seconds from one the code would run.
 local id = timer.scheduleFunction(main, {}, timer.getTime() + 120)

If further down in the code it was decided to run the main() function sooner it could look like this

 if mustGoFaster == true then  
   timer.setFunctionTime(id, timer.getTime() + 1)
 end
Related Functions: timer Functions: getTime, getAbsTime,getTime0, scheduleFunction, removeFunction, setFunctionTime
Notes: