Hi everyone, I’m having a weird problem with my project’s code.
In the stats page, you can choose to go to another scene, then to another. Here you can use a “cheat” to increase a certain stat percentage. The cheat works as a consumable token, and you start the game with 10 of them.
The problem is that after consuming 1 cheat and adding points to the stat percentage, when you exit the stats page and then re-enter it, the tokens are refilled and the stat is gone back to its previous level. Trying to do it again and again, I’ve randomly been able to take down the tokens at 9, but when I do the same thing I’ve just done, it doesn’t go down at 8 —again. At this point, I really don’t know what I’m doing wrong.
This is the code:
*choice
#Use 1 chip.
You have ${frtok} remaining chip@{(frtok>1) s|}.
Do you want to use 1 chip?
*choice
#What are these chips?
Blah blah, mock test. This is an explanation of the game mechanics.
Do you want to use 1 chip?
*choice
*selectable_if (Egg<95) #Yes, use 1 chip.
*set frtok (frtok-1)
Thank you! 1 chip used!
*set Egg +5
*choice
#Exit.
*goto_scene cheats
#Go back.
*goto top_scene.
*selectable_if (Egg<95) #Yes, use 1 chip.
*set frtok (frtok-1)
Thank you! 1 chip used!
*set Egg +5
*choice
#Exit.
*goto_scene cheat
#Go back.
*goto top_scene
#Go back.
*goto top_scene
