Hi! I just discovered that there is a variable that counts the game time (renpy.get_game_runtime), and I wondered if there is a variable that stores how long a game has been running in a play session. In other words, that count the time everytime the player runs the executable of the game.
If there isn't, how could it be created? Maybe a screen with a timer that adds a second to the variable every second? ... but I think it's a bit wrong :s
is there a function that counts the played time per session?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: is there a function that counts the played time per session?
get_game_runtime IS per session.
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: is there a function that counts the played time per session?
There isn't one natively (not as far as I know anyway)
You could just reset the game_runtime wherever you want though with renpy.clear_game_runtime(), e.g.
You could just reset the game_runtime wherever you want though with renpy.clear_game_runtime(), e.g.
Code: Select all
label splashscreen():
$ renpy.clear_game_runtime()
return
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: is there a function that counts the played time per session?
I tried it with but doesn't work. Maybe because runtime starts when the player loads a save slot or starts a new game. If you clear runtime before that doesn't happen.Remix wrote: ↑Tue Dec 31, 2019 7:51 am There isn't one natively (not as far as I know anyway)
You could just reset the game_runtime wherever you want though with renpy.clear_game_runtime(), e.g.Code: Select all
label splashscreen(): $ renpy.clear_game_runtime() return
Re: is there a function that counts the played time per session?
My bad, I remembered there was an issue with get_game_runtime but was remembering the wrong one -- the one I was thinking of is it participates in rollback, which seems to defeat its purpose lol. Anyway, in short, no, there isn't one out of the box.
Who is online
Users browsing this forum: BBN_VN