player inventory

Post Reply
User avatar
indriApollo
Member
Posts: 146
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay
Location: Belgium
Contact:

player inventory

by indriApollo » Post

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: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: player inventory

by twoelk » Post

like the info dumped into the player files?

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

Re: player inventory

by indriApollo » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests