There are a few steps, some of which you can skip, and all of which you can change.
Step 1: Adding a menu option, because it's a logical place to have it.
Open your screens.rpy, and find a part called screen navigation. Add a button for the testers to press somewhere amongst the similar existing buttons.
Code: Select all
textbutton _("Generate Feedback") action Jump("generate_feedback_file")
You can put this code anywhere you like. Personally I created a new .rpy file called Feedback.rpy, just to stay organized. Change the info to match your project.
Code: Select all
init python:
import pickle
with open(os.path.join(config.renpy_base, "feedback.txt"), "w") as file:
pickle.dump(s, file)
# This part puts together all the info that will be saved to the text file.
label generate_feedback_file:
$ feedback = str("The protagonist's name is " + mcs_name + " " + mcs_surname + ".\n\They are "
+ mcs_gender + ", and " + mc_he_or_she + " is from " + mcs_city + " in " + mcs_country + ".\n\The player took "
+ str(time_taken_to_choose_gender_in_minutes) + " minutes and " + str(time_taken_to_choose_gender_in_seconds) + " seconds to choose the protagonist's gender.\n\ "
+ str(mcs_initial_feelings_about_the_first_invitation_to_japan) + ".\n\ "
+ what_did_the_mc_tell_dave_about_their_japanese_ability + ".")
# If you want to show the player a message to confirm this functionality is working, do it here.
$ create_feedback(feedback)
infodump "[feedback]"
return
# Don't forget to set an initial state for variables, to avoid errors later.
# Don't be afraid of variable names that are easy to read.
# Call this next label at the start of your game.
label prepare_variables:
$ mcs_name = "undecided"
$ mcs_surname = ""
$ mcs_gender = "of an undetermined gender"
$ mc_he_or_she = "this person"
$ mcs_city = "an unknown city"
$ mcs_country = "an unknown country"
$ time_taken_to_choose_gender_in_minutes = 0
$ time_taken_to_choose_gender_in_seconds = 0
$ mcs_initial_feelings_about_the_first_invitation_to_japan = "They have not yet been invited to Japan"
$ what_did_the_mc_tell_dave_about_their_japanese_ability = "They have not met Dave yet"
Any thoughts, questions or improvements? Let me know.