How do I change a timer (in integer value) into minutes AND seconds?

LoveTD's

New Member
Reaction score
34
Hi all, I am trying to make a multiboard where you can see a timer.

Whenever I used the (real) countdown timer - remaining time function it will give me the full seconds.

But what I want is: convert the real into an integer (which I already did) and then change the seconds into: minutes AND seconds. Does annyone know how to do that?
 

Dirac

22710180
Reaction score
147
if you mean like this...

Minutes Var------ 00 : 00 --------Seconds Var

Then

Every 1 second of the game
Set SecondsVar = SecondsVar +1
If SecondsVar greater than 59
Then
Set SecondsVar = 0
Set MinutesVar= MinutesVar + 1
 

LoveTD's

New Member
Reaction score
34
thats what I have been thinking about, a little problem is that I want the variable in a trigger which has a event of: ever 0.10 seconds of game time.

I use it to update my board and I am not willing to make a new trigger just for the timer ;)

so I thought dividing the timer by 60 then multiply it by 60 (different variable ofc) and do it minus the timer itself so you have the remaining seconds, but that didnt work :(
 

Dirac

22710180
Reaction score
147
Create a DelayVar....
Every 0.1 seconds
Set DelayVar = DelayVar + 1
If DelayVar equal to 10
then
Set Delay Var = 0
Do the stuff i said above
 

LoveTD's

New Member
Reaction score
34
hmm good idea, but doesnt this deviate from the timer itself? or is it the exact time as the timer itself is?
 

LoveTD's

New Member
Reaction score
34
I know, but I am using a timer from like a king of the hill game... and I am wondering if that timer does not deviate from the time that you set by variables...
 

Dirac

22710180
Reaction score
147
i dont really know what the word "deviate" means, so i will explain a lot of stuff...
You can add a if/then/else condtion to determine how long does the game takes
If
MinutesVar equal to 5
SecondsVar equal to 30
Then
....

(game lasts 5:30 mins)...

Maybe you want to change the values in a multiboard using string conversion
String(MinutesVar) + : + String(SecondsVar)

Am i doing good so far?
 

Tom Jones

N/A
Reaction score
437
Trigger:
  • Test A
    • Events
    • Conditions
    • Actions
      • Set Mins = ((Integer((Remaining time for (*Some Timer*)))) / 60)
      • Set Secs = ((Integer((Remaining time for (*Some Timer*)))) mod 60)
 

LoveTD's

New Member
Reaction score
34
i dont really know what the word "deviate" means, so i will explain a lot of stuff...
You can add a if/then/else condtion to determine how long does the game takes
If
MinutesVar equal to 5
SecondsVar equal to 30
Then
....

(game lasts 5:30 mins)...

Maybe you want to change the values in a multiboard using string conversion
String(MinutesVar) + : + String(SecondsVar)

Am i doing good so far?

I´m not a beginner :) buy a dictionary :p (no offense)

I know exactly what u are explaining to me but i want a easyer way to put in my timer and tom just showed me how ;)

Thanks Tom, exactly what I need!!! <3 +rep
 

Emu.Man00

New Member
Reaction score
41
EDIT:
Trigger:
  • Test A
    • Events
    • Conditions
    • Actions
      • Set Mins = ((Integer((Remaining time for (*Some Timer*)))) / 60)
      • Set Secs = ((Integer((Remaining time for (*Some Timer*)))) mod 60)

lol that works. Basically what i did, never knew that alrdy existed :S

=========================================================================
Ugh... can't you just use a formula to get it?
i.e.

tempReal = time / 60
seconds = (tempReal - integer(tempReal)) * 60 /// i.e. 9.5 - 9 = .5 * 60 = 30 seconds
minutes = integer(tempReal)

example: time elapsed == 512
tempReal = 8.53
seconds = (8.53 - 8) * 60
= .53 * 60
= 31.8**
minutes = (8)

** don't know how many decimals a real stores, if it stores all this will never be a decimal, if not the system works to within a second, which really shouldnt be a big deal..

Therefore, minutes = 8, seconds = 31 when casted as integer... 8 * 60 + 31 = 511

tempReal is a real
seconds is a real (to be cast as integer when needed)
minutes is an integer
 

LoveTD's

New Member
Reaction score
34
Basically what i did

erm.... you did what? :S

eather ways, thanks for trying to help but it is solved. Your system works too but it takes lots and lots more efforts ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top