I’m having trouble with building a save system. I have two areas of confusion, one is around coding and the other is more general.
Here is the general question - if a save system is created using choicescript and the game is published, my understanding is that the game sits inside an app. Also, that the app does not have a save system inbuilt? So, if a player saves the game - where does it go? Into cache?
secondly, To build a save system I believe I have to do the following:
Create a scene , I will call it gamesave
In the scene, I create a variable save for every variable , so here is an excerpt from the startup:
*create max_stamina 0
*create max_luck 0
*create max_skill 0
*create stat1 100
*create bullets false
*create bullets_number 0
*create bulletclip false
*create diceresult 0
*create dicetoroll 0
*create dicesides 12
*create dicesix 6
*create male false
*create female false
*create gm false
*create gf false
*create sm false
*create sf false
and in gamesave I do this:
*create max_stamina_save 0
*create max_luck_save 0
*create max_skill_save 0
*create stat1 100_save 0
etc
Am I correct so far? Some of these variables are not relevant to a save state or not, for example dicesides and the stats of characters you fight along the way
How can I save the variable of true or false please?
This is what I have so far, just using Luck to keep things simple for testing
This is sample code provided as an answer before:
*label save
*set alt_var1 var1
*set alt_var2 var2
*set alt_var3 var3
*return
*label load
*set var1 alt_var1
*set var2 alt_var2
*set var3 alt_var3
*return
This is my code:
*label save
*create max_luck_save 0
*return
*label load
*set max_luck_save
*return
I think I have it wrong? This will set luck to zero?