Miniloader

by therax

Compact and UPS-friendly 1x1 loaders. Works with train cargo wagons, circuits, filters, and modded belts from Bob's, Krastorio, FactorioExtended Plus, Space Exploration, and Ultimate Belts.

Content
7 months ago
0.15 - 1.1
176K
Logistics

g lua command to replace all loaders with miniloader

3 years ago

hey therax,

i've been trying to get this to work but can't find the magic incantation. do you have any ideas on how to swap loaders for miniloader programmatically?

3 years ago

That's a bit tricky. Are you tryingto replace 2x1 loaders like from Loaders Redux with miniloaders, or 1x1 loaders like Deadlock's?

3 years ago

2x1 with 1x1 and a belt. i was trying to do it with stack inserters and here's what i got:

/c for a,b in pairs(game.surfaces[1].find_entities_filtered{type="loader"})do box=b.loader_container;boxpos=box.position;inorout=b.loader_type;pos=b.position;orient=b.direction;neigh=b.belt_neighbours;if inorout=="input"then belts=neigh.inputs;verb="from"else verb="to"belts=neigh.outputs end;for c,d in pairs(belts)do if inorout=="input"then d_target=d;p_target=box else d_target=box;p_target=d end;if d.name=="express-loader"then game.print("Loader-"..verb.."-Loader!")elseif d.name=="express-transport-belt"then game.print("Dumping "..verb.." a belt!")b.destroy()params={name="express-stack-inserter",position=pos,direction=orient,drop_target=d_target,pickup_target=p_target}game.print(serpent.block(params))ent=game.surfaces.nauvis.create_entity(params)ent.update_connections()end end end 
3 years ago
(updated 3 years ago)

but the thing is it won't orient them correctly and i can't find a way to do that. :(

it also seems to create a weird inserter that doesn't behave like a normal one - can't decon with planner, and doesn't show No Power icon but, does start working when power is given.

oh, and they don't... work! the inserters won't register for wakeup events on the belt/box.

3 years ago

Sorry, just getting back to this. The reason your inserters don't work is that you didn't provide a force, and the default force for create_entity is the enemy force. Since it's not an allied force, the player can't see the No Power icon, and the inserter can't interact with the adjacent belt or box. I'll whip something up for you.

New response