Hi again! I tested it a little more for O2A2 and found out that the text from menu choices was not counted (neither the “question” statement displayed in the main box nor the “answers” displayed in choice boxes). However menus are parsed since the count of choices themselves are counted.
Since O2A2 includes choice text in the 1k word limit it would be nice to display their count. A parameter flag could be added for devs who really want to exclude them (in some games, the choice text is repeated sic as a new text line just below so it makes sense to ignore it sometimes - but generally the “question” is unique anyway).
Thanks, for O2A2 the trick is to alternate between define wordcounter_menu_is_character = False and define wordcounter_menu_is_character = True to define the lower/upper boundary of your character counts, which vary depending on the amount of repetition between choice text and actual text (character/narrator tends to repeat the choices).
To go further I turned choice text into a variable that I injected in both choice text and actual text below using “[variable injection syntax]”. This way I can keep using define wordcounter_menu_is_character = True and it gives me the proper count of unique words!
It’s complicated to do and mostly useful for O2A2, plus it may be annoying for translators, but it works! It still has some benefits: no risk of messing changing a choice text and forgetting to update the corresponding dialogue/narration text, and you can still _(“localize”) the variable string so localizers can work translate them only once!
EDIT: oops, no, it doesn’t work as Word Counter+ will count text inside string variables as 1 word per variable, so the count will be too optimistic. Better manually remove the few redundant words if you’re really near 1k words…
Thanks, it’s quite useful for me to assess my future work on O2A2 based on previous work.
I had to dig a bit in the comments of free version to find what the $1 version was bringing (namely label stats), maybe you could expose this more clearly directly on the itch page description.
Since the script is put inside the game folder I’ll have to be careful not to commit the paid version into VCS (at least for public repositories - I suppose it’s OK on private ones only shared with team members) - but I see the free one is under MIT license so I could push it to open source repositories too.
And thanks for pointing that out, I just added a description of the label counter to the itch page as well.
There's usually an option to "ignore" files (e.g. "add to .gitignore") which will prevent them from being shared but still make them available to you. Otherwise, I'm not that sad if people go out of their way to pirate a $1 add-on. Still, I appreciate the concern!
You're welcome, it helps a lot. I was looking for some file that would do this and stumbled upon this one, which works in the quickest and most practical way possible.
Fairly new to Ren'py and super glad I found this tool before resorting to more annoying measures! I haven't been able to see the results yet, and I'm not sure if it's due to an actual issue, or if it's due to me being a noob. If everything is working right, should the report be an addendum to the "errors.txt" file that pops up after running Check Script (Lint), or should it appear somewhere else that I am not aware of?
If everything works correctly, Ren'py should generate a "lint.txt" file, not an "errors.txt" file. If possible, you can share what it says in the error file and I can help you resolve the issue!
I swear I have some sort of curse that makes code work if I give it 10-12 hours of resting time. Found some errors, tried again, and got the lint.txt file, with the words successfully counted. Thank you for your response and also for this tool in general!
It's quite likely that you need to update Ren'py, since this is a newer configuration variable.
Otherwise, you could also try removing "define config.lint_character_statistics = False" on line 33, since it's not actually needed for the counter to work.
Thanks for this! A feature request would be to see how many choices are in the script. (Ex. There are a total of 3 choices, with a total of 11 choice options.) <3
Getting the amount of choices should be easy(ish) by counting the "menu:" commands. Getting the # of choice options might be a bit more difficult, but should still be possible.
← Return to asset pack
Comments
Log in with itch.io to leave a comment.
Hi again! I tested it a little more for O2A2 and found out that the text from menu choices was not counted (neither the “question” statement displayed in the main box nor the “answers” displayed in choice boxes). However menus are parsed since the count of choices themselves are counted.
Since O2A2 includes choice text in the 1k word limit it would be nice to display their count. A parameter flag could be added for devs who really want to exclude them (in some games, the choice text is repeated sic as a new text line just below so it makes sense to ignore it sometimes - but generally the “question” is unique anyway).
Thank you for letting me know about this! I just published an update that adds the word counts from choices.
Thanks, for O2A2 the trick is to alternate between define wordcounter_menu_is_character = False and define wordcounter_menu_is_character = True to define the lower/upper boundary of your character counts, which vary depending on the amount of repetition between choice text and actual text (character/narrator tends to repeat the choices).
To go further I turned choice text into a variable that I injected in both choice text and actual text below using “[variable injection syntax]”. This way I can keep using define wordcounter_menu_is_character = True and it gives me the proper count of unique words!
It’s complicated to do and mostly useful for O2A2, plus it may be annoying for translators, but it works! It still has some benefits: no risk of messing changing a choice text and forgetting to update the corresponding dialogue/narration text, and you can still _(“localize”) the variable string so localizers can work translate them only once!
EDIT: oops, no, it doesn’t work as Word Counter+ will count text inside string variables as 1 word per variable, so the count will be too optimistic. Better manually remove the few redundant words if you’re really near 1k words…
Thanks, it’s quite useful for me to assess my future work on O2A2 based on previous work.
I had to dig a bit in the comments of free version to find what the $1 version was bringing (namely label stats), maybe you could expose this more clearly directly on the itch page description.
Since the script is put inside the game folder I’ll have to be careful not to commit the paid version into VCS (at least for public repositories - I suppose it’s OK on private ones only shared with team members) - but I see the free one is under MIT license so I could push it to open source repositories too.
Thank you, I'm glad this tool is useful for you!
And thanks for pointing that out, I just added a description of the label counter to the itch page as well.
There's usually an option to "ignore" files (e.g. "add to .gitignore") which will prevent them from being shared but still make them available to you. Otherwise, I'm not that sad if people go out of their way to pirate a $1 add-on. Still, I appreciate the concern!
You're welcome, it helps a lot. I was looking for some file that would do this and stumbled upon this one, which works in the quickest and most practical way possible.
Fairly new to Ren'py and super glad I found this tool before resorting to more annoying measures! I haven't been able to see the results yet, and I'm not sure if it's due to an actual issue, or if it's due to me being a noob. If everything is working right, should the report be an addendum to the "errors.txt" file that pops up after running Check Script (Lint), or should it appear somewhere else that I am not aware of?
If everything works correctly, Ren'py should generate a "lint.txt" file, not an "errors.txt" file. If possible, you can share what it says in the error file and I can help you resolve the issue!
I swear I have some sort of curse that makes code work if I give it 10-12 hours of resting time. Found some errors, tried again, and got the lint.txt file, with the words successfully counted. Thank you for your response and also for this tool in general!
Is there a specific thing I have to do to get it to work, I leave it as is and then select Check Script (Lint) just like it says but I get this
It's quite likely that you need to update Ren'py, since this is a newer configuration variable.
Otherwise, you could also try removing "define config.lint_character_statistics = False" on line 33, since it's not actually needed for the counter to work.
This seems way fricking easier than the method I've chosen for myself.
I'm glad it could be of use! Just curious, but what was your method?
Fucking Google Drive and deleting anything that wasn't dialogue/monologue lolol
Hahaha, that was my old approach too, before I got fed up with it and decided to make this tool!
I was doing the exact same thing!
Thank you so much for this. I just used it and......thank you!
Thanks for this! A feature request would be to see how many choices are in the script. (Ex. There are a total of 3 choices, with a total of 11 choice options.) <3
That's a great idea! I'm not sure if I'll actually find a way to do that, but I can definitely try.
Getting the amount of choices should be easy(ish) by counting the "menu:" commands. Getting the # of choice options might be a bit more difficult, but should still be possible.
You're right, that turned out to be no issue at all.
Both the number of menus and choices should be available now. Thanks for the suggestion!