Then you’ve missed a step, or applied a step incorrectly.
Remember to use the debugger to confirm the variables (global and scene) hold the values you expect. And use the crtl + shift + i when the game is running to see what is being saved.
If it’s not getting saved, then the issue is at or before the write command, and you’ll need to confirm the structure has the data in it. If this hasn’t, then the issue lies in the adding the variable to the structure.
I believe I have it right now (though I am obviously bad at that), but it’s still not working, so I probably still have something wrong. Here’s what shows up on the “you won” screen after playing a level.
This is all reminding me of the time I tried to make ice in the microwave.
I do have some neuro atypical issues that are probably not doing me any favors. I seem to have flipped where some of these things go. I fixed what you showed about the global variable being all_level_times, but I’m still getting the exact same as my last screen shot of the key.
That value component says to me that a value is being written to storage, not a text (in my screen shot a few posts back it has “str”, not “value”). Can you check the write to storage and confirm it’s correct?
I typed it out because I couldn’t figure out how to find it since search didn’t yield it. I’m really bad with typos.
Now I fixed it, and I’m definitely getting some results, but am confused by the results. Even after clearing the key, it will say that one second is my best time. Also, it doesn’t display the best time at all if I get a slower time than the last round.
I am really confused. Hopefully I followed what you did, but it’s still not acting the way I want it to.
I want to see text with the current level’s time, and text that shows the best time the player has had on that level if they’ve played it before. I don’t want anything to say “current time” or “previous time”.
To you does “current time” mean the time for the most recent round, and “previous time” mean the best time ever played on that level?
OK. I fixed that capital “L”, and found another line in which I put a capital when I shouldn’t have. I’m going to need to really stay on top of checking for that sort of thing.
I copied exactly what you have for the last bit now. (I think)
Still not working though. As little as I understand coding, I tried to figure out what is going on. Is it supposed to hide the text that shows the actual best time if there isn’t one yet, and replace it with the text object that has “Best time: 00:00”?
It seems like when it shows the text object for bestTime, there is nothing to change the text of the text object “bestTime” to actually show the best time so far. Which would make sense based on the results when running the program.
I appreciate that you have spent so much time helping, especially after I pointed out that I am in way over my head. I feel like I am starting to understand some of what you are explaining.
This should be current_level, not current_playing_level (the latter is a global variable)
Not really. It does hide or show the “New Best Time!” message depending on whether it is a better time than previously (the subevent of the subevent) or if there’s no previous time (the inverted condition event)
The events check if a previous time exists, and set the previous best time text to that if it does.
If a previous time doesn’t exist, then previous best time text is set to “Best time: 00:00”.
That’s what the forums are for. And it’s great that you’re starting to understand what it’s doing