I'm trying to make a timer that counts seconds and minutes, and it should be consistent on all computers.
I understand that using the "every xx" event might result in a slight variation on some computers.
This is actually the one place where I would use a timer event since they are frame rate independent - if you want a second to be a second on any machine just use the inbuilt functions. Though - if machine independent speed is checked then you can use the always method with your frame rate being how many frames to a second on the clock etc.
Someone else was just have this same issue... I think he made it so that if the player changes the clock, he has to go on a magical quest to be able to play the main storyline. That or he used the crasher extension. Goldfish memory.
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
8th June, 2008 at 21:19:22 -
Like you mentioned, simply use the date & time object. Then you can detect "new second", "new minute" etc. If you had the event: new second, add one to counter. Then it wouldn't matter if the player changed the clock, because it only checks when 1 second has passed.
Yeah, I realize that. But I am worried about what happens if someone uses some kind of program that actually freezes the system clock. Then it won't be able to count the seconds that pass.
Maybe I can add a fail safe. If the timer, in-game, doesn't move for a little while I'll just exit to main menu or something.
Unless its online or has highscores I wouldn't worry about it. If somebody wants to ruin the game let them. The vast majority will play it properly, it might not even cross their mind to change the time to cheat.
How the p'hoogus do you freeze a system clock? (btw, I haven't googled it. Likely that would yield results.)
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
10th June, 2008 at 03:10:58 -
You can program it in MMF. I've done it before as a joke It's simple. Add a clock object and: Always set time to 12:00:00
Willy C - I think that exit to menu idea is a good one. You could have a counter which always has 1 added to it, and every new second it is set to 0. Then if this counter is greater than, say 2000, then you know that the timer has frozen.