Page 1 of 1

player inventory

PostPosted: Sat Dec 27, 2014 15:57
by indriApollo
Hi,

How do you get a table with the entire player inventory so it can be serialized to a text file ?
I'm trying to make a save/restore function.

I tried
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local player_inv = player:get_inventory()
   local inv_list = player_inv:get_list("full_inv")
without much result :/

Re: player inventory

PostPosted: Sat Dec 27, 2014 17:37
by twoelk
like the info dumped into the player files?

Re: player inventory

PostPosted: Sat Dec 27, 2014 19:13
by indriApollo
I want something like fwritef in C. The text file doesn't have to be human readable. I'm making a mod which clears the players inventory when he enters a certain area and I want to be able to give his stuff back once he leaves.