Hi Klonan,
Sorry to bother you, but I'm really stuck and don't know where to ask.
I'm building a mod that uses mining depots as outposts that need to be rescued. When the player has destroyed all nearby spawners, I want to insert 20 drones in the depot so that they can start mining the nearby patch.
But no matter how much I've tried, I can't seem to insert them in the input inventory. I keep getting the error "attempt to call field 'get_inventory' (a nil value)". It would be much appreciated if you could point me in the right direction.
-- yes, depot is a LuaEntity
function builder.add_drones(depot)
local inventory = depot.get_inventory(defines.inventory.assembling_machine_input)
inventory.insert{name="mining-drone", count=20}
end
Probably obvious, but this is my first mod attempt (so please be gentle if I am missing something obvious.) :)