Lua creating logistic chest

Bugs that are actually features.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Lua creating logistic chest

Post 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
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Lua creating logistic chest

Post 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 ...
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Lua creating logistic chest

Post by FreeER »

oops, didn't even think about that...I'll just move to not a bug :)
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net
Post Reply

Return to “Not a bug”