Distance to Start and End
🕑 Added 2019-10-31 22:29:44 +0000 UTCA couple of months ago, I received a request from a sponsor who wanted to see if there was a way for Ren’Py to indicate a player’s progress through a visual novel, both through the VN as a whole and through a single chapter inside it.
This turned out to be a harder problem than I thought it would be, but after an attempt last month that didn’t pan out, this month’s article presents my results. While it’s impossible to figure out how many clicks remain in every visual novel, especially when it’s possible for the distance to the end to change based on the player’s decision, I think I’ve come up with a solution that is satisfying for simpler visual novels.
Comments
KuroOneHalf
Hi Tom. Sorry to necro this, but since the making of this article it seems the code in distance.rpy has stopped working. It throws the following error: KeyError: u'hide_windows' Is it possible you could take a look at it sometime? These functions are quite handy.
Shade Meadows
I remember that VN... something 'bout a Moon and a Ghost?
Winter Wolves Games
cool then will probably update my code to use this new system :)
Renpytom
The difference is important for a multi-path game. Say you have a game that has a main path that consists of 200 say statements, and two endings that ar 100 say statements each. The highest your script will display on a single playthough is 75%. This will display 100% at the end of the game, and 33% when 100 clicks in. (Yours will only display 25%.)
Winter Wolves Games
obviously Percentage is a function I have made to return the percentage :P
Winter Wolves Games
interesting, I was using something similar already in my games, not sure how/if is different from what you're doing? The code is: $script_total=renpy.count_dialogue_blocks() $script_seen=renpy.count_seen_dialogue_blocks() $script_new=renpy.count_newly_seen_dialogue_blocks() $playing_time=renpy.get_game_runtime() hbox xcenter .5 yalign .98 xfill True: text "{color=#F92}%s{/color} effective playtime" % PlayTime(playing_time) text "{color=#F92}%d%%{/color} new script seen this session" % Percentage(script_new,script_total) text "{color=#F92}%d%%{/color} of total game script seen" % Percentage(script_seen,script_total) --