I got the idea from a few visual novels where they show you how much of the game has been completed based on the read script. so I found the renpy.count_dialogue_blocks() and renpy.count_seen_dialogue blocks() functions and found out how you could use those functions to display a percentage completed counter.
to do that, first paste this before start
Code: Select all
init python:
def percent():
global result
result = seen * 100 / dialogue
Code: Select all
$ result = 0
$ dialogue = renpy.count_dialogue_blocks()
$ seen = renpy.count_seen_dialogue_blocks()
Code: Select all
$ percent()
"[result]\%"
- don't forget to add the backslash before the percent sign or else it will give you errors
- The documentation says:
You can avoid this problem by deleting persistent data, and the player wouldn't encounter this anyway.This (the seen dialogue blocks) number may be larger than the result of renpy.count_dialogue_blocks() when the script has changed and older dialogue blocks are no longer accessible.
-the best place for this function is somewhere on a screen. If you want to do that though, don't forget to call the percent() function right before you call your screen.
that's it, I hope someone makes use of this!