FIXED Load game block breaks 3 game attribute lists in my game, how to fix it?

SpookyBurger

  • Posts: 82
Hi.  I've been having problems with a few of my lists becoming filled with "object Object" after I use the Load Save File behavior.  It's kinda weird since I haven't noticed anything wrong with any other game attributes besides my Book ones.  The length of the contents in the Book Text list is rather long, perhaps that might be a problem?

Below I attached screenshots of the Load behavior, the blocks that are drawing the list contents out, and the display before and after load game is being used.

I tested saving the game, killing the player, and going for new game and that keeps the Book Name and Book Text lists safe.  So it's something wrong with the load game behavior.  Thanks in advance for any help.

« Last Edit: December 09, 2013, 10:56:34 pm by SpookyBurger »
Please try out my latest build of Patient 9 here.   http://www.stencyl.com/game/play/23179

SpookyBurger

  • Posts: 82
Please try out my latest build of Patient 9 here.   http://www.stencyl.com/game/play/23179

thinkster

  • Posts: 149
No guarantee that this will work but try putting the "get item x from list" in a "anything as text wrapper."

You can find the anything as text wrapper in the text menu bit.

Tuo

  • *
  • Posts: 2469
Whenever using a GA list, do NOT rely on initial values stored in the game to work (the ones you can set when first making the list or via the "Settings" button). Leave those blank.

Instead, you need to initialize them in the first scene before loading the game. For example, it the title menu of your game, use the following:

When Created
  Set Save List to [create new list]
  Add [The patients are rioting] to Save List
  Add [I've been attacked] to Save List
  ...
  Load Saved Game

This way will initialize the values correctly and then the load game will overwrite those saves with the new values if the user has already played through once. Also, since you have been doing it the other way, you may need to run your game without the "load" block once (but still with a "save" block later on) so that it resets your values.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Luyren

  • *
  • Posts: 2423
As far as I recall, that was a bug, and I think it is fixed in 3.0. Have to confirm though.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

SpookyBurger

  • Posts: 82
No guarantee that this will work but try putting the "get item x from list" in a "anything as text wrapper."

I gave it a quick try and no luck, thanks though, worth a shot.


As far as I recall, that was a bug, and I think it is fixed in 3.0. Have to confirm though.

Not having "load game" as a block not work in your engine seems really loose on their end and incredibly frustrating for a noob like myself :(  Hopefully they did fix it, maybe ill throw money at em

Whenever using a GA list, do NOT rely on initial values stored in the game to work (the ones you can set when first making the list or via the "Settings" button). Leave those blank.

Instead, you need to initialize them in the first scene before loading the game. For example, it the title menu of your game, use the following:

When Created
  Set Save List to [create new list]
  Add [The patients are rioting] to Save List
  Add [I've been attacked] to Save List
  ...
  Load Saved Game

This way will initialize the values correctly and then the load game will overwrite those saves with the new values if the user has already played through once. Also, since you have been doing it the other way, you may need to run your game without the "load" block once (but still with a "save" block later on) so that it resets your values.

Would using values from the title screen behavior list work?  I could have the title screen hold the values I want.  Is it just Game Attribute Lists that are sketchy when being loaded from the "load game" block?

Please try out my latest build of Patient 9 here.   http://www.stencyl.com/game/play/23179

Tuo

  • *
  • Posts: 2469
Yes, only GA lists are funky. Normal lists work... well normally ;).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

SpookyBurger

  • Posts: 82
Worked like a charm, thanks!
Please try out my latest build of Patient 9 here.   http://www.stencyl.com/game/play/23179

mikhog

  • Posts: 151
I'm having a similar problem with lists giving back [object Object] after loading. So am I understanding you correctly that you can't save values in lists? (not even numbers or strings)

In the doumentation there's a note about only using numbers and text so I assumed that it would work...
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

Tuo

  • *
  • Posts: 2469
My route of initializing the list in the title screen isn't working for you Mik?
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

mikhog

  • Posts: 151
Yeah it's working but that means I can't edit lists during gameplay and have the changes persist. Found a workaround by having a string separated with ; for every item so now I can still have a list, just store it in a string instead :) I wonder if there is a character limit, I'm planning on storing the entire game history (every player death and their accomplishments) in a string like that :)
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

Tuo

  • *
  • Posts: 2469
It's definitely possible to do via lists. I do it all the time. String manipulation is fine as well. I do that rather often too.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

mikhog

  • Posts: 151
Ok, so you CAN edit lists during gameplay AND save them? I tried it and got back errors like NaN. That's why I went the route of storing semicolon separated strings instead which I use to populate the list at runtime...
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D

Tuo

  • *
  • Posts: 2469
Definitely. Come to my stream sometime, and I'll demonstrate for you.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

mikhog

  • Posts: 151
Ahh alright I must have screwed something up then :)
"It came from the forest!" a zombie defense shooter
http://www.kongregate.com/games/mikhog/it-came-from-the-forest
Also, check out my RPG inventory system on stencyl forge or test it: http://www.stencyl.com/game/play/25268
Current project (hack n slash RPG): http://www.stencyl.com/game/play/25366
I also do Unity development both 2D and 3D