saving / loading... reset my lists!

GregAnims

  • Posts: 305
My game has two list attributes with about 45 values each. "players best times", and "A+ times"..
It loads at the start of the game, and saves at the end of each level.

Well, it saved, but seems to have blanked every A+ time and player time and so these display as NA/NA or in the debug: "object object"... what can i do about this?

(i'm using 1.4)

Safebox

  • Posts: 6
can we see the event blocks please?
SB36

rob1221

  • *
  • Posts: 9466
To get around the bug, set all of your default list entries in a behavior.

GregAnims

  • Posts: 305
To get around the bug, set all of your default list entries in a behavior.

Thanks, could you elaborate a bit.. not sure how this bug works. Cheers!

rob1221

  • *
  • Posts: 9466
The default values you enter for game attribute lists don't save properly, but any values you enter with a behavior do.  So the solution is to ignore entering default values and set those in a behavior, probably in the first scene.

rahulmartin

  • Posts: 315
The default values you enter for game attribute lists don't save properly, but any values you enter with a behavior do.  So the solution is to ignore entering default values and set those in a behavior, probably in the first scene.

Best answer

Jarty

  • Posts: 1
Does this mean that any List that is a Game Attribute with values set by the 'import from text file...' button will be unable to save?

The reason I ask is that I've put together a little RPG with turn based combat and some 'Choose your own adventure' text based encounters. The encounters were stored in a 1649 line text file... which I imported into a list GA. Works fine until I save and load and then the whole thing gets filled with 'object object...'

Will I have to manually set 1649 lines of text into a GA List to get this to work?

UPDATE: Since the list GA seems to work correctly and get processed correctly(right up until the save/load) I tried a work around of:
- Creating a temporary list
- Assigning the original list(default values) to the temporary list
- Emptying the original list
- reloading the original list with the data in the temp list.

What I found was that the temporary list appeared to get filled with the correct data... but as soon as the original list was emptied the temp list was emptied too. (passing a pointer instead of actual list data?)

Oh well, as it stands I guess I will be re-entering these things manually tomorrow. *facepalm*

« Last Edit: February 27, 2013, 07:15:41 am by Jarty »

aprotasenya

  • Posts: 10
Jarty,
if you are still struggling, I've made a little useful loop for myself, which reenters all the list's items in it, so that I could save default values as well.
If you build yourself smth like this, you can just delete a current encounters GA, create new, import text from file, and then just run this loop while saving (actually, at least once, this may not be every time you save).

So, my example:
I have list GAs: "top.names" and "top.points" - and also a text attribute "buf.txt".
On every loop step the buf.txt is assigned one of the list's item and then this very item is replaced with the content of buf.txt (which is similar, yet now it is entered with behavior, so it can be saved).

Ask me if something stays unclear in this. :)