|
Post by Terrence on Apr 19, 2014 10:09:09 GMT 1
First off everything works great execpt on saves it seems that all my inventory gets saved in a hash table. But it doesnt seem to save any of the Items GUI. If their in a chest through a save it seems to save it until its transfered back it in to the inventory then it dissapears. I played around with the prefab setting on both the Item and GUI. Didnt seem to help. I rebuilt all my items and test the stock items with the same result. I deleted the inventory system and reinstalled it. Same result. Any help would be greatly apprecieated. Thanks
|
|
|
Post by Super Admin on Apr 19, 2014 13:37:38 GMT 1
Hi! You have to store each hash table, in inventory you have ItemCount and Items to be stored so on load it will check what you stored and populate your inventory with items. Did yo read Save section from page 40 in GUIDE about save and serializer? If other hash table / store load values works then inventory should work too cause it use the same method for that.
I also want to rewrite some inventory stuff to be more efficient because right now we have many hash tables and many objects, i will create everything to be on single object with different references. A lot of global variables also can be a problem i will reduce that number too. After that i will create video about serializer and saves so other people can use it properly.
|
|
|
Post by Terrence on Apr 19, 2014 22:55:31 GMT 1
I have the Inventory Saving the hash tables. The items are in the hash tables on load. Just not popping up in the inventory like they got disconnencted from there gui through the save. The chest seems to save objects and they pop up on load, but after load if I transfer them into my inventory they disapear, but are in my inventory hash table. Also all Items have both GUI and the 3d have prefabs on them.
|
|
|
Post by Super Admin on Apr 19, 2014 23:36:28 GMT 1
I see, then some event is not sent properly, event that should create items on load. This can be caused by few reasons, first is that event is sent before inventory is stored into global variable or event is sent to wrong variable. Item list should be created and based on hash table values item will pop up in inventory so have a look at this image : and the problem is that this setup should be restarted cause there will be created and set values. When you load your game, find this game object ( you can use action FindGameObject, or many people will suggest to tag and search by tag because is better and easier for system when have some filters) and create some global event on that start state so you can refresh everything, here is the example: just basic Global Event called Reset and it will transition to that state and everything should refresh and items should pop up after. Try it and let me know if problem still persists, ok? If there are some bugs with that let me know so i can fix those bugs in next version. Cheers!!!
|
|
|
Post by terrence on Apr 20, 2014 10:03:46 GMT 1
Yup that fixed it I have it set to reset it on O key down right now. I just push O after load and all my Items appear. Will problably set a custom reset after load in the future. Thanks for the quick replies.
|
|
|
Post by Super Admin on Apr 20, 2014 10:27:50 GMT 1
Glad it helped man I will work on some stuff to simplify this system a bit and to have in next versions, so stay tunned. Cheers!!!
|
|