havenphillip Posted July 19, 2017 Share Posted July 19, 2017 Hey Community. I'm new to Leadwerks and I've been going through Aggror's Project Saturn and I got stuck at a point where I was unable to put items in the inventory. I moved some things around and found some scripts and got it to work but now my problem is I don't know how to add just one item to the inventory. It just adds the item to any open slot. I'm sure it's something dumb that I would never guess because I'm new to programming. I have the Player Inventory script attached to the Bottle the Inventory Item script is being imported to the Player Inventory. Also, it is saying System:Print("We place the bottle in the inventory") so I'm assuming I'm close. Could someone please help me out with this? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted July 20, 2017 Share Posted July 20, 2017 The AddItemToInventory function only takes 1 argument. self.playerInventoryMgr:AddItem(item) Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 20, 2017 Author Share Posted July 20, 2017 Nice. A response from the man himself. I did what you said and I didn't have any luck initially but I messed with it some more and for whatever reason ended up also changing the self:AddItem(item) in the PostRender function to self:AddItem(self.item) to see what would happen and those two changes seem to have done it. I have no idea why but It appears to be working perfectly now. Thanks, man! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.