Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

How can i reverse the timer


Appo

Recommended Posts

Hey i'm wanting the timer to reverse say from 300 secs down to 0 but i can't seem to make it do that with the worlds timer, i mean i could set a counter to subtract every second but i'm guessing there is a good reasond for why the timer in worlds is set up the way it is. Anyways any help would be greatly appreciated :)

Link to comment
Share on other sites

Just set the in game timer to get its base values from 3 minutes minus the game timer instead of from the game timer. I assume this is for some kind of countdown mission right?

3 minutes should be something along the lines of 60 * 60 * 3 assuming the value is set based on the number of frames passed and a normal frame count of 60. I don't think Worlds is based on time deltas anyway.

  • Like 1
Link to comment
Share on other sites

Oh, seconds, then you could do:

If GameTimer mod 1000 = 0

= Subtract 1 from timer

Or as DW says (which is also more efficient), just take the amount of time in seconds you want the timer to take, and multiply the value by your game's framerate.

Also, the only reason you do not want to use Every 1 second as well as any MMF2 timer events in general is that if the game isn't running fullspeed, the timer events will still execute at the same time and hence certain things will trigger faster and cause technical issues. (for example, if the game was running at 30fps for someone, your timer would expire 2 times as fast as normal!)

  • Like 1
Link to comment
Share on other sites

Ah thanks everyone, it was just that the coding was a bit confussing for me as it was something like GameTimer( "Master_Level" )+1000/60 and the counters were set to Floor(GameTimer( "Master_Level" )/60000) mod 10 and i've never really used anything like that :S

Just set the in game timer to get its base values from 3 minutes minus the game timer instead of from the game timer. I assume this is for some kind of countdown mission right?.

In a way, it's for the timer in like mario as i'm trying to make a mario type game with the engine :)

Also, the only reason you do not want to use Every 1 second as well as any MMF2 timer events in general is that if the game isn't running fullspeed, the timer events will still execute at the same time and hence certain things will trigger faster and cause technical issues. (for example, if the game was running at 30fps for someone, your timer would expire 2 times as fast as normal!)

Ah i see thanks for the info, i think Azu told me something along those lines a while ago, so i use alterable values instead of a standerd MMF timer

anyways rep up

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...