So if using "Every 1/100 seconds" and other such events is just totally stupid and wrong and stuff (and I can see why - varying computer speeds can have a great effect on this), what exactly am I supposed to use as an alternative? Like if I wanted an event to occur every second or something, how would I do that?
MMF doesn't count in seconds, it counts in frames. Executing the "Always" event will make an action occur every frame of gameplay, which is normally 50 times per second. When the game lags a little, this might be less than 50, but will never be more. Meanwhile the timer events, like "Every 1.00 seconds" will execute in their REAL-TIME values. So when the game is running at 50 FPS, this is like having the event run every 50th frame, like 50, 100, 150, etc. But if the game slows down incredibly, like 2 FPS, it will run every other frame. At 1 FPS, it will execute on every frame.
If you want to keep track of time in relation to how the game-world sees it, use a counter. Have an events: "Always: add 1 to value". Then, from the start of the game, divide this by 50 to see the amount of "in-game seconds" that have elapsed. Divide it by 3000 for "in-game minutes", etc.
The reason 'every whatever seconds' is not a good idea for some things is because it doesn't sync up with MMF.
So if you make a character start shooting bullets 'every second', but only when you're pressing the space bar, when does the first bullet get shot?
you wont always be pressing the space bar dead on 1 seconds, it could be just after a second or half way though. So it's actually inconsistent in that respect.
I don't get why we use 50hz. Computer monitors usually are at at least 60hz, even in non-ntsc areas - computer monitors use neither NTSC or PAL, so I don't get why anyone would run their monitor at such an eye-burning refresh rate.
Originally Posted by Moffitt (bibin) I don't get why we use 50hz. Computer monitors usually are at at least 60hz, even in non-ntsc areas - computer monitors use neither NTSC or PAL, so I don't get why anyone would run their monitor at such an eye-burning refresh rate.
Probably cause 50 is a nice even number.
- Ok, you must admit that was the most creative cussing this site have ever seen -
Originally Posted by Moffitt (bibin) I don't get why we use 50hz. Computer monitors usually are at at least 60hz, even in non-ntsc areas - computer monitors use neither NTSC or PAL, so I don't get why anyone would run their monitor at such an eye-burning refresh rate.
Uh, the MMF timer is very bad, because MMF was built on top of a frame rate system, rather than on top of the timer. I'm planning to make all my timed events counter based for my next MMF game - having a counter add up by 1 every 0.05 seconds and then my "every 1 second" events will wait till the counter reaches 20. Construct handles timers fine, but nobody likes it
Monitors run at 50/60 Hz because our power supply does. And the higher the frequency, the less eye-burning it does
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.