Jump to content

Modding bag inventory


Vandelay

Recommended Posts

Is there a way to add an item directly into an equipped bag rather than the general inventory? I'm trying to add an item straight to the bag equipped on the player's back, but I think I've gotten stuck between trying to identify the back item and trying to treat it as a container.

 

Alternatively, is it possible to create a custom bag that already contains other items? I spent a little while looking through the game lua and source code for the Starter Kit for a clue on this, but I wasn't able to find it. Any help, suggestions, or clues in either direction would be helpful. Below is a snippet I've been working with to test.

if keyNum == 15 then
	local bag = self.character:getClothingItem_Back(); -- Returns InventoryItem
	-- ????
	bag:AddItem("Base.Screwdriver"); -- Requires ItemContainer
end
Edited by Vandelay
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...