Page 1 of 1

How to save inventory between level loads?

Posted: Sat Feb 18, 2017 5:52 am
by game_dev5
How can we save inventory and later when we load another level have the same inventory?

Re: How to save inventory between level loads?

Posted: Sun Feb 19, 2017 1:57 pm
by sunnlok
What language are you using?
In cpp just instantiate your Inventory manager from the primary game or plugin class and it wont do anything in between levels unless you tell it to.

Re: How to save inventory between level loads?

Posted: Sun Feb 19, 2017 5:02 pm
by game_dev5
What language are you using?
I prefer cpp but I'm open to flowgraphs.
In cpp just instantiate your Inventory manager from the primary game or plugin class and it wont do anything in between levels unless you tell it to.
I don't understand. Are you saying that if I load another map while I am in another one, the inventory (ammo count, accessory list and ...) will be preserved?

Re: How to save inventory between level loads?

Posted: Sun Feb 19, 2017 6:22 pm
by sunnlok
That depends what your inventory is. Did you write it yourself, are you using the default cryaction one?

Re: How to save inventory between level loads?

Posted: Mon Feb 20, 2017 5:49 am
by game_dev5
I'm using gamesdk, so the default CryAction one I guess.

Re: How to save inventory between level loads?

Posted: Mon Feb 20, 2017 3:17 pm
by sunnlok
Then you need to save the player inventory at the end of a level and reassign it on load. In the end its just getting the pointer and copying the info somewhere.

Re: How to save inventory between level loads?

Posted: Mon Feb 20, 2017 7:34 pm
by game_dev5
thanks