player inventory

User avatar
indriApollo
Member
 
Posts: 144
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay

player inventory

by indriApollo » Sat Dec 27, 2014 15:57

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 :/
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: player inventory

by twoelk » Sat Dec 27, 2014 17:37

like the info dumped into the player files?
 

User avatar
indriApollo
Member
 
Posts: 144
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay

Re: player inventory

by indriApollo » Sat Dec 27, 2014 19:13

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.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron