Need help with variable timer

● ARCHIVED · READ-ONLY
Started by Burgerland 4 posts View original ↗
  1. So I have a "timer" that's three variables: one is the hour, the second is the minute, and the third is the seconds. Every second I want the third variable to reset to 0 and every 59 seconds the second variable to reset to 0. That way it acts like a timer. But I have three problems:

    1. for the third variable, I don't know how to speed up a variable so it counts up to 59 in a second
    2. for the second variable, I don't know how long 59 seconds is in the game's time (1 sec? 60 sec?)
    3. for the first variable, I don't know how long an hour is in the game's time (300 sec? 6000 sec?)

    I'm making this "timer" because I can't find a way to display the real timer in a text box.
  2. A few questions, because I don't really understand your 3 problems:

    Burgerland said:
    1. for the third variable, I don't know how to speed up a variable so it counts up to 59 in a second
    I don't understand this, why do you want your "third variable" (seconds) to count up to 59 in a second?
    Wouldn't you want your "seconds" variable to increase by 1 each second?

    Burgerland said:
    2. for the second variable, I don't know how long 59 seconds is in the game's time (1 sec? 60 sec?)
    59 seconds is equivalent to 59 seconds in game time.
    The game is supposed to run at 60 frames per second (fps). 59 seconds * 60 frames / second = 3540 frames

    Burgerland said:
    3. for the first variable, I don't know how long an hour is in the game's time (300 sec? 6000 sec?)
    An hour in game time is the same as an hour in real life --> 1 hour = 60 minutes = 3600 seconds


    Here is a simple example of an evented timer Common Event:
    Timer.png
  3. Aloe Guvner said:
    A few questions, because I don't really understand your 3 problems:


    I don't understand this, why do you want your "third variable" (seconds) to count up to 59 in a second?
    Wouldn't you want your "seconds" variable to increase by 1 each second?


    59 seconds is equivalent to 59 seconds in game time.
    The game is supposed to run at 60 frames per second (fps). 59 seconds * 60 frames / second = 3540 frames


    An hour in game time is the same as an hour in real life --> 1 hour = 60 minutes = 3600 seconds


    Here is a simple example of an evented timer Common Event:
    View attachment 96056

    That helps a lot! Thank you :)
  4. [closed]IgnoreMe[/closed]