Page 1 of 1

View Player Choices [Helped by PyTom]

Posted: Wed Apr 01, 2015 10:31 pm
by Clestae
I'm 99% sure this is impossible, but since I'm a bit desperate, I thought I would ask anyway.

Basically, I'm using Ren'py for an experiment that involves answering a questionnaire in the beginning. This test is measuring self-esteem, but each question corresponds to one of three categories: Social, Appearance, and Performance (three different types of self-esteem).

I want to know the total score, but also the score of each area. So I coded each question as so:

Code: Select all

label pretest17:
    menu:
        "17. I feel concerned about the impression I am making."
        "A: Not at all.":
            $ PreScore += 5
            $ Social += 5
            jump pretest18
        "B: A little bit.":
            $ PreScore += 4
            $ Social += 4
            jump pretest18
        "C: Somewhat.":
            $ PreScore += 3
            $ Social += 3
            jump pretest18
        "D: Very much so.":
            $ PreScore += 2
            $ Social += 2
            jump pretest18
        "E: Extremely.":
            $ PreScore += 1
            $ Social += 1
            jump pretest18
And at the end, there's a section only I can access with a password that tells me the total score along with the scores of each of the three dimensions. Simple, right?

Unfortunately, I did not beta test it thoroughly and encountered a very bad problem. Two of the questions, I accidentally did something like this:

Code: Select all

"19. I feel like I'm not doing well."
        "A: Not at all.":
            $ PreScore += 5
            $ Performance += 5
            jump pretest20
        "B: A little bit.":
            $ PreScore += 4
            $ Performance += 5
            jump pretest20
I accidentally wrote the wrong number for the "performance" score. Another question, affecting the "social" score, did the same thing. While I can tell something is wrong because the total of the three scores does not equal the overall score, I have no clue which question was incorrect, since I did it twice.

So my question is: is there ANY possible way I would be able to find some kind of "feedback" text, or even "crack" a game (I'm sorry, I know PyTom would not want this program to be crackable, but desperate), to see in each save file what a player chose?
I'm pretty sure this is not possible as I did not put in flags to show this to me, and the error was completely my fault, but thought I would ask.

Thank you and I apologize if my explanation is confusing.

Re: View Player Choices

Posted: Wed Apr 01, 2015 10:47 pm
by xela
Search for JSON callback if you want to add stuff to save data, screens or renpy.watch to view stuff in real time. Whatever suits you the best.

Re: View Player Choices

Posted: Thu Apr 02, 2015 3:10 pm
by Clestae
I'm still looking into this, but I have to ask: is this something I can do after I've already had someone play the game and all I have left are their save files? This just seems to be something I can only do before the game is published. Or--

--wait, stupid question alert--

If I add this JSON to my game, repackage the game, load it onto the computer where the original game was...am I able to keep my old save files and then use this JSON thing to look through the decision points!?

I'm so sorry, I'm horrible at coding, so I may need more help :(

Re: View Player Choices

Posted: Thu Apr 02, 2015 4:26 pm
by xela
If you know what you're doing, you can do both. You know that there is a console right? Shift + O in the dev mode, just load the game in a dev mode (options.rpy file) or any rpy file loaded at init face after the original, load your file/game, open the console and type the name of the variable into it. It will return you it's value.

Re: View Player Choices

Posted: Thu Apr 02, 2015 4:31 pm
by trooper6
Wouldn't it be easier to fix the game and then have the people retake the test? Or get new test subjects?

Re: View Player Choices

Posted: Thu Apr 02, 2015 4:37 pm
by xela
Ir prolly would but that's not the question :)

Re: View Player Choices

Posted: Thu Apr 02, 2015 5:19 pm
by Clestae
trooper6 wrote:Wouldn't it be easier to fix the game and then have the people retake the test? Or get new test subjects?
With graduation looming in less than two weeks and the difficulty I had finding enough people to do this in the first place, unfortunately I do not have that option (and with how the experiment actually works, I also am not able to have my subjects retake it) :( thus my "desperation". I'm rather ashamed of such a simple error, as I should have caught it before going live with such an important, time-sensitive project, but alas... >.<
xela wrote:If you know what you're doing, you can do both. You know that there is a console right? Shift + O in the dev mode, just load the game in a dev mode (options.rpy file) or any rpy file loaded at init face after the original, load your file/game, open the console and type the name of the variable into it. It will return you it's value.
Oh! I know of that, I just had never tried it. I'll try it out and see although...I foresee a problem. My point values are accumulation, so wouldn't it just return to me the value I already have? Unless it is able to tell me what point values were accumulated where...? (I am probably not using the right words).

Thank you Xela for helping me!

Re: View Player Choices

Posted: Thu Apr 02, 2015 6:32 pm
by xela
Unless there is a log and values are recorded, you will not be able to get the step by step progression out of your savefile. I still do not know what you're actually asking...

Re: View Player Choices

Posted: Fri Apr 03, 2015 12:28 am
by Clestae
I apologize, I was not clear.
My code adds up the scores as a result of accumulations. The problem is I accidentally typed in the wrong value for an accumulation for two questions, so my numbers are off, and I wanted to know if there was a way to basically know which choice in a given menu a user picked.

Unfortunately, all the dev mode can tell me is what I already know: what the accumulation ended up being at the end. So there is no way (that I can conceivably see) how to figure out that on question 15, a user chose "Somewhat" as their answer. I did not code in some kind of log output or anything like that ahead of time.
Even more unfortunate, I had figured out a possible roundabout way to still make this work, but since you cannot rollback from a saved file, that idea doesn't work either (I was going to rollback to the questions on a save file, and keep checking the score to see how much had "decreased" as I went back to the past, so to speak--I don't even know if this would've worked even if I could've done rollback).

I'm sorry, I am not very good at explaining myself. So thank you for helping, but I'm pretty sure that due to my lack of foresight, there's not much I can do.

Re: View Player Choices

Posted: Fri Apr 03, 2015 12:42 am
by PyTom
You can rollback from a save file, actually, at least for a little bit. It depends on how long things are.

Can you send me the game and a save file or two? I can try to poke around to see if the data wound up there somehow. (It depends a lot on how long the game was.)