Bug reports and spelling/grammar feedback is critical to polishing projects. Sometimes it’s hard to solicit feedback, and it can be a pain in the ass to give feedback. With renpy, what? Am I supposed to screenshot every typo? Or retype it for the dev? Who has time for that?
I’m going into a polishing phase for my project and this problem has been on my mind for awhile? How can I get feedback in a way that doesn’t require the person giving feedback to do a bunch of extra work on top of what i’m already asking of them? (shameless plug): Myre’s Massive Mealtime - development (v0.57 - 10/24 dinner done!) - #130 by Juxtaterrestrial
This is a solution I came up with.
Tool is probably not the right word. But, when enabled the menu in the top left appears. When they find a typo they hit the corresponding button and it logs the current text, plus the file and line number into typo_report.txt . When they’re done they just send you that file. I even added an option to submit a comment in case the end user wants to provide more details.
For me, often just knowing a line has a typo is enough for me to easily fix it. If that doesn’t come as easily to you, then at least you have the specific line of code to run through a more detailed spell check.
And as I hinted at, I hope this will reduce the burden someone may feel towards reporting typos or bugs. All you have to do is turn it on, and press the button when you see something.
Example:
Here is the code/script for you to use freely - please credit.
#Init stuff
#debug toggle
#toggle to True to enable
define debug_toggle = True
#Variable to toggle the bug report screen
#Set to "True" to have it always on. Set to "True" here just to save time
default show_typo_reporter = "True"
#Variable for user comment input
default user_comment = ""
#snakes
init python:
#By Juxtaterrestrial
#called from typo_report_screen, writes things to a file
def typo_bug(button_name):
global user_comment
# Filepath for the bug report
filepath = renpy.config.basedir + "/typo_report.txt"
# Get the current dialogue and its location
#Pop.whaaaaat?
dialogue = _history_list.pop().what
filename, line_number = renpy.get_filename_line()
# Write to the typo report file
with open(filepath, "a") as f:
f.write(f"{button_name} at: ")
f.write(f"{filename}:{line_number}")
f.write(f" in: '{dialogue}'")
if user_comment != "":
f.write(f" #USER COMMENT#: '{user_comment}'")
f.write("\n")
#clears comment so it doesn't linger between flags.
user_comment = ""
#In screens.rpy
#This first bit should be nested in a menu somewhere. Preferences would work.
#By Juxtaterrestrial
vbox:
#if debug_toggle:
label _("\n\nDebug options\n")
box_wrap True
label _("Typo/bug report menu\n")
vbox:
text _("Adds a menu to the game with buttons to flag typos or errors.\n\n")
text _("Instructions:\n")
text _("1: Play the visual novel. When you find a typo or bug press one of the relevant buttons.\n")
text _("This saves a line 'typo_report.txt' in the main directory of the visual novel.\n\n")
text _("2: Send this file to the developer to report the typos.\n")
hbox:
style_prefix "radio"
textbutton _("Enable") action ToggleVariable("show_typo_reporter", true_value="True")
textbutton _("Disable") action ToggleVariable("show_typo_reporter", true_value="False")
#next two are their own screens.
#By Juxtaterrestrial
#A screen for flagging typos. User hits a button and the current dialogue + the line of script is printed to a txt file. The user can then send that to the developer as a typo report.
screen typo_report_screen():
if show_typo_reporter == "True":
fixed:
xalign 1.0
yalign 0.0
frame:
background Solid("#7c9c94")
vbox:
text _("Press button")
text _("to log current")
text _("dialogue")
#Would be trivial to customize the buttons to suit your need
textbutton "Spelling" action Function(typo_bug, "Spelling error")
textbutton "Grammar" action Function(typo_bug, "Grammar error")
textbutton "Image Error" action Function(typo_bug, "Image error")
textbutton "Comment" action Show('comment_screen')
#By Juxtaterrestrial
screen comment_screen():
modal True
#to prevent accidental advance of story
add "gui/overlay/confirm.png"
vbox:
xalign 0.5
yalign 0.5
label "Please enter your comment:"
input value VariableInputValue("user_comment")
hbox:
textbutton "Submit" action [Function(typo_bug,"Comment"), Hide('comment_screen'), Return()]
textbutton "Cancel" action [Hide('comment_screen'), Return()]
#In the actual script
label start:
show screen typo_report_screen