Scripts / [help wanted] Text time does not fit every computer

Author
Message
Safak Yalcinkaya
GameGuru TGC Backer
5
Years of Service
User Offline
Joined: 10th Sep 2016
Playing: All retro games...
Posted: 12th Aug 2021 13:28
Hey everyone when I am using the following code to display text with time I noticed it acts different in different computers. I guess it has something to do with its timer such as when i change the last line to delaydoctor = delaydoctor + 6 it works like a charm in my inferior notebook but the lines pass too fast at my high-end pc. Can anyone help? How can I fix it so it would work the same on any computer? Thanks.

Legends never die... Commodore 64, Amiga 500/1200
smallg
Community Leader
15
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Aug 2021 15:15 Edited at: 12th Aug 2021 15:15
because you're not using time there but the fps which is going to be different for everyone (i.e. delaydoctor + 1 is updating every time the script is run which for faster computers is more often than slower ones)
you don't need both methods, remove the delaydoctor stuff completely and just check the timer.
p.s. it's better to use GetElapsedTime() rather than the GetTimer(e) methods as it will only update when called rather than all the time (so if you pause the game etc GetTimer(e) will continue to increase while GetElapsedTime() will not).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Safak Yalcinkaya
GameGuru TGC Backer
5
Years of Service
User Offline
Joined: 10th Sep 2016
Playing: All retro games...
Posted: 13th Aug 2021 08:39
Thanks a lot smallg. I just started displaytextdoctor with 0 at line 24 so that when it triggers, script will show the first line. Works like a charm
Legends never die... Commodore 64, Amiga 500/1200

Login to post a reply

Server time is: 2021-11-27 20:54:22
Your offset time is: 2021-11-27 20:54:22