0
Answered

How to save loot

Crispy 1 month ago in Game Creator updated by Marti (Lead Developer) 1 month ago 2

Let's say I get rewards after doing a mission. These rewards would be added to my collection. I can navigate through my items in the menu, and choose what to sell, or what to bring on my next mission.
How can I do this?

Unity version:
Game Creator version:
1.0.4

Answer

Answer
Answered

This is an interesting case. What I would do is in the management scene, place all the items you've selected for your mission inside a Container object. In order to transfer the items to the next scene you need to edit the Container identifier (last field in the Container object where there's a bunch of numbers and letters) and replace it to something you can remember (such as "loadout").

Then, in your mission, you should have another empty Container but with the same ID ("loadout"). This will tell Game Creator that these two containers are the same and will be synched between scenes.

This approach should allow you to let the Player have an initial equipment, have your loadout carried over between missions and have a storage with the rest of the items (not available outside the management scene).

I forgot to mention: This is for a mobile game, so the management of inventory will be done "outside of the game". So I'm thinking it'll be a separate scene where it contains the level selecting, the equipment collection, and the shop. Upon further thought, I think this is the same as managing the inventory "inside the game", where you interact with an NPC or your "Stash". I just need some details on how to transfer the loot I gain from finishing a mission, to the inventory of the aforementioned scene. Do I store everything in Global Variables, then retrieve them when loading the "level selecting, equipment collection, etc." scene?

Answer
Answered

This is an interesting case. What I would do is in the management scene, place all the items you've selected for your mission inside a Container object. In order to transfer the items to the next scene you need to edit the Container identifier (last field in the Container object where there's a bunch of numbers and letters) and replace it to something you can remember (such as "loadout").

Then, in your mission, you should have another empty Container but with the same ID ("loadout"). This will tell Game Creator that these two containers are the same and will be synched between scenes.

This approach should allow you to let the Player have an initial equipment, have your loadout carried over between missions and have a storage with the rest of the items (not available outside the management scene).