PB4Tazman Posted May 31, 2015 Posted May 31, 2015 Hi all! I am trying to make a racing mission, I can get results to show, but they are only to the tenths of a second. Does anyone know to what decimal point the timer.getTime() function in game should be? I would like to get results to within 100/ths of a second if possible. BTW I am a complete novice to .lua programming. Thanks! PB4Tazman
Shahdoh Posted June 2, 2015 Posted June 2, 2015 I use .01 to track to 1/100th of a second on my race courses.
PB4Tazman Posted June 2, 2015 Author Posted June 2, 2015 Thanks for the reply Shahdoh! Is that .01 implemented using .lua script or do you use triggers somehow? I am stuck on how to get the hundredths to calculate. Cheers! PB4Tazman
Shahdoh Posted June 2, 2015 Posted June 2, 2015 Lua scripting is the only way to get to 1/100th of a second that I am aware of.
PB4Tazman Posted June 2, 2015 Author Posted June 2, 2015 Ok, so lua it is. So I am thinking I have to add .01 to the timer.getTime() every .01 second? Is there a function that can do that? I do not know lua much at all, and any point in the right direction would be of great help. I have looked at the SSE see wiki, but as of now its over my head . Thanks!
Grimes Posted June 2, 2015 Posted June 2, 2015 You have to run a function every .01 second or faster for more precise results. function checkGate() timer.scheduleFunction(checkGate, {}, timer.getTime() + .01) -- put all of your code that checks if a unit is inside a gate area and record the players time here. end The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts