I've been using this code in my game, because I just need it rounded to the closest minute:
Code:
$ temp_minutes2, temp_seconds2 = divmod(int(renpy.get_game_runtime()), 60) # To record the current gameplay time.
$ minutes = temp_minutes2 - temp_minutes # To figure out how many minutes the search took.
$ seconds = temp_seconds2 - temp_seconds # To figure out how many seconds the search took.
if seconds > 30: # Rounding up to the nearest minute.
$ minutes += 1
if seconds < -30: # Strangely, sometimes the seconds show as negative numbers. This will counteract that.
$ minutes += 1
But I know people check these topics for their own problems, so maybe I should add the code other people would use.
I was a little confused about what you meant though, so I hacked together my own ugly way of doing it.
Code:
$ temp_minutes2, temp_seconds2 = divmod(int(renpy.get_game_runtime()), 60) # To record the current gameplay time.
$ minutes = temp_minutes2 - temp_minutes # To figure out how many minutes the search took.
if temp_seconds2 >= temp_seconds:
$ seconds = temp_seconds2 - temp_seconds # To figure out how many seconds the search took.
else:
$ seconds = temp_seconds - temp_seconds2 # To figure out how many seconds the search took.
_________________
Working on a VN to teach lower-conversational Japanese, and a guide to living in Japan.
It's a very long dev process.
You could help me with my game A LOT by filling out this anonymous 10 question survey: http://www.surveymonkey.com/s/6GR57YBMassive thanks to everyone who has already filled it out!You can see a Q&A about the survey here:
http://tinyurl.com/SurveyQandA