I'm trying to make a little pokemon-like rpg, where I meet some enemies on my way, and I've to store some variables changes after the battle.
Practically, I need to store and change informations (variables) about how many enemies of a certain type I killed and how many of them I "forgive".
The point is, when the battle finish, I want to restart from the same point where I was before meeting the enemy, so now my logic is this: collision with an enemy -> "save game" -> go to layout "fight" -> load last game save.
With this logic, if I change any of the global variables during the fight, I'll lose the changes when I load the last game save.
Would a workaround be not using the save/load game, but storing in variables the position of the player before the collision with the enemy?
What could I do to store variables during the fight so I can access them after the loading too?
What would be your workaround?