Page 1 of 1

Lua creating logistic chest

Posted: Fri Nov 08, 2013 11:25 pm
by FreeER
Using game.createentity to create a logistic chest does not add it to the logistic network (aka, it shows available robots: 0/0 and nothing gets picked up or delivered)...I'd tried using this function while beta testing a mod :)

Code: Select all

function FullChest(name, position) local chest=game.createentity{name="logistic-chest-provider", position=position} chest.insert{name=name, count=6660} end

Re: Lua creating logistic chest

Posted: Sat Nov 09, 2013 1:50 am
by kovarex
You need to set the force of the chest to the player.
Specify the force in the createentity command

Code: Select all

local chest=game.createentity{name="logistic-chest-provider", position=position, force=game.player.force}
By default the force is the enemy ...

Re: Lua creating logistic chest

Posted: Sat Nov 09, 2013 2:29 am
by FreeER
oops, didn't even think about that...I'll just move to not a bug :)