Some of the code I'm starting with:
Code: Select all
--control.lua
global.pallets = global.pallets
function place_item_on_pallet(self, item)
--get items from pallet inventory
local palletItems = self.entity.inventory.get_content()
--place items on open pallet space
if self.entity.inventory_size > 0 and palletItems ~= nil then
spill_item_stack(self.entity.position, palletItems(1))
end
end
The idea here is that the player can simply walk over the pallet and pick up items without interacting with the inventory (which automatically removes the items out if they're picked up - I haven't gotten that far yet).
Any code references or other work I could look at would be much appreciated!