[Question] Save Game

Exportforce

  • *
  • Posts: 90
Hello,

except the Numberformatting my game works very well, so I wanted to add save and loading.
So I created a copy of all variables I need to save as a game attribute and went this way to save them every few seconds:

But the values stay empty, eventhough the variables are being saved, but they stay at their standard value and this setting seems to be fully ignored.

« Last Edit: July 13, 2015, 02:09:59 pm by Exportforce »

Justin

  • *
  • Posts: 4310
It looks like you're placing a game attribute getter into the name slot of the dynamic setter.

You could read what you're doing like this:

set GA with name: [get value of GA amount_small_rocket_save] to [get value of attribute amount_small_rocket]

Assuming the current value of the GA amount_small_rocket_save is 0, and the value of the attribute amount_small_rocket is 50, it would become this:

set GA with name "0" to the value "50"

For your case, you should use blocks found in the "Setters" section of the Game Attributes category.

[ set amount_small_rocket_save to [ small_rocket_save ] ]

For Live Support: Join our discord server and ping me @justin.
I'm most often available between 8am and midnight Japan time. (GMT+9)

Exportforce

  • *
  • Posts: 90
I don't want to save the Game Attributes to Attributes, I want the Attributes saved in the Game Attributes and that would be this way. Because I can't use the Game Attributes everywhere I need to create them specifically and I thought the best time to do that is directly before I save, so they are super actual.

Or I misunderstood you...

letmethink

  • *
  • Posts: 2547
You misunderstood. There are specific setters for game attributes in the game attribute section of the palette. Here you can set the game attribute (using a similar way to how you would set a normal attribute) and that way would work.
~Letmethink

Exportforce

  • *
  • Posts: 90
Yeah I have just seen that. I don't even know where I got those... well... but practically it should be the same, no ?

But no matter. It WORKS! Saving and Loading like a charm!
Tomorrow I'll try myself on an overlay window with some little achievements.

(And I need some little math tricks to get some helpful algorythms running ^^ but that is on a way different level)

Remade

  • *
  • Posts: 10
You've asked couple of questions about your game today, and kinda made me wanna see it. Mind sending me a link after you're done? :D

Exportforce

  • *
  • Posts: 90
Sent you a PM.
I'm quite happy how it turned out. Just a shame I am not good with graphics.
I already know my next steps and hope they will work out :)