chest behavior understanding lists and text

Behappy859

  • Posts: 51
Hello,

        I've been trying to figure out a simple way of lowering my game attribute lists. So I have been trying to teach myself playing with text and figuring out a way to save. When it came to creating items that I can craft and place in the game I would use  3 to 4 game attribute lists. 1 for actor, 2 for X pos, 3 for Y pos, 4 for scene name.    I feel like I use way too many game attribute lists. I recently created a chest and set it in one of my scenes. The scene has 4 chests total.  Each chests  has a random pick and amount of 3 different items.  this behavior partially works. I can take all items out the chest and it reads it as empty and then do the same to the other chest.  I can take one item out in each chest in a order. But if I take 1  item out in one chest and another item out in a different in another chest, then go back to the first chest the game will crash. If I take an item out and then try to open a chest after hitting continue in the main menu the game will crash.
I don't know what its not reading properly hoping to get some help please.  heres the pictures of the code one for player one for chest and one for scene. Any help would be great.

Behappy859

  • Posts: 51
Ok. So unworked on this a bit more doing the same thing I did in older behaviors which involves no texts but alot of GA lists. I'm still getting the same results. After doing a little debugging. I found out where it crashes at which is the created item. My theory is it has to do something with a block that is not in there called the "for each item in list" question is where should it be at?

Behappy859

  • Posts: 51
hey guys,
i've been up all night trying to figure this out and happy to say I figured it out almost.
I went down to one item now. little did I know there was something missing in the very beginning I wasn't putting in correctly.
So here is a 4.0 version of a 1 item chest behavior assuming your inventory slots isn't full, if not having the item already. Hope these pics help to whoever that may need to them to use. I will still work on pulling out 3 items from different chest as well as saving.

merrak

  • *
  • Posts: 2644
Quote
When it came to creating items that I can craft and place in the game I would use  3 to 4 game attribute lists. 1 for actor, 2 for X pos, 3 for Y pos, 4 for scene name.    I feel like I use way too many game attribute lists.

A cleaner approach would be to use one 'list of lists'. Each element of the list of chests is itself a list containing the properties of the chest. One of the properties could itself be another list with the contents.

I haven't looked at the code--that's a lot to sit down and try to analyze. But when juggling multiple lists at once it's easy to get them out of sync, and crashing is one possible consequence.