Hi Boxers, need your help. ^^ In my game, when the player dies, I would like to save his progress by passing checkpoints. When he passes one, his progress is saved. So all the collectables he has collected are also saved and don't reappear when he restart (after a death for example). Currently, I use "Set checkpoint" to do this. But it only saves his new start position. I Hope someone has the solution.^^ Thanks for the help
I dont fully understand what you are trying to do. After you press restart you want the character to continue from the last checkpoint he reached? If that is hat you want. you have to make an action with set checkpoint and place it in the scene. and another action set as restart checkpoint.(give it another name). then on the game over menu. the restart button set it to the action with the restart checkpoint. here is a video on youtube I found:
Thanks, @Tars Tarkas. I already used this method and it works. When my player dies he restarts from the checkpoint. But all the objects (gems, coins...) he has picked up before reaching the checkpoint aren't saved. What I would is all the objects collected by the player when he reaches the checkpoint are already collected when he restart from the checkpoint. For example. My player is a ship (O). 1- He moves to the right and collects 2 coins (+). O >>---------+----+ ----------------------------------|||----------------------- 2- When he collects those coins, they disappear. ---------------------------O >> ----------------------------------|||----------------------- 3- Next, he reaches a checkpoint (|||) and passes it. -----------------------------------O ----------------------------------|||----------------------- 4- Then he falls in lava and dies. you lose ----------------------------------|||----°------------------- 5- The game restart and the player appears on the checkpoint. -----------------------------------O ----------------------------------|||----------------------- 6- The coins he has already collected are no longer there (-) -----------------------------------O ----------------------------------|||----------------------- 0- When I use the method above, when the player restart from the checkpoint, the coins are already there -------------------+-----+------O ----------------------------------|||-----------------------
so you want the gems that he collected not to appear in the scene when you restart? I don't think it's possible. sorry. maybe somebody else knows a way.
Damn :/ I really hope, someone knows a way. I think others people will find it useful. Anyway thanks a lot for all your priceless help. :]
Ok so you are saying your collectibles are showing zero when u dies and replay from last checkpoint. If this is the case you can save those collectibles during checkpoint save. For example if u collect (n)keys and save it in global variable (Settings.keys) you can write code in checkpoint save node: checkpoint.keys = Settings.keys; And then in 2D/3D world add node checkpoint loader and in that you must write: Settings.keys = checkpoint.keys; That will save your keys during the game play ...
But i am also have a trouble here... If u want to save those keys forever (example: like when you quit your app and start it over again these keys should still be saved) likewise BestScore & GlobalCoins. i couldn't have any clue how to save those keys permanently so that they still got saved forever. With the above stated method we can save keys just for a single session of app... But in 2nd session the data will lost!
I believe this is what your looking for Buildbox 3: Variable Save/Load Node - How to Save Object State in Your Game - YouTube