player inventory

User avatar
indriApollo
Member
 
Posts: 146
Joined: Fri Sep 26, 2014 11:34
Location: Belgium
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
Code: Select all
local player_inv = player:get_inventory()
   local inv_list = player_inv:get_list("full_inv")
without much result :/
 

twoelk
Member
 
Posts: 1345
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

Re: player inventory

by twoelk » Sat Dec 27, 2014 17:37

like the info dumped into the player files?
 

User avatar
indriApollo
Member
 
Posts: 146
Joined: Fri Sep 26, 2014 11:34
Location: Belgium
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 2 guests