Bob's Adjustable Inserters


Adds hotkeys and a GUI to adjust inserter pickup and drop locations.

Content
4 months ago
0.13 - 1.1
305K
Logistics

g trying to switch to mod from more long inserters

1 year, 5 months ago

I was trying to switch to this mod from More Long Inserters (or at least try it out) but when I install it removes all the More Long Inserters from the game.... which isn't ideal... Is there a way to prevent this? I am aware that they are incompatible, i just wanted to have them side-by-side so I could start switching over.

I am also aware that there is some animositiy? between these mods (https://mods.factorio.com/mod/kry-inserters/discussion/5acb47f4440d00000bf1216c). I hope I am not poking the bear....

1 year, 5 months ago

This mod doesn't do anything specific to More Long Inserters, and I can't see anything in their mod looking for this one, but it does specifically look for Bob Logistics.

Logistics does disable the base game long inserter, but this mod shouldn't, it just gives you the ability to change any inserter to be long handed, or the long inserters to be short handed (and if you wonder why, the long inserter has a speed somewhere between the standard one and fast one in the base game)

So, I don't know why the other mod's inserters would be removed.

1 year, 5 months ago

hmmm I posted on his mod, not sure if I will get a response. Do you have any ideas on how to proceed? there are a great deal of inserters removed when I do this, im not sure why.

1 year, 5 months ago

i am considering writing a game file with the surface and location of each long stack inserter, loading your mod, then replacing them with your variant of it. any ideas on how to script create on of your inserters that matches th the pick-up drop off point? also how create stack filters with specific filter settings?

KiwiHawk β˜†
1 year, 5 months ago

Create a blueprint of all the inserter in your base? That should include all the pickup/dropoff location info. Either use an upgrade planner on the blueprint or alternatively, Helmod includes a tool for modifying blueprints.

1 year, 5 months ago

Thats an options, programmatically might be better, I have multiple surfaces with bases

1 year, 5 months ago

In theory, you could write your own migration file (Just stick it in the game's migration folder, with a unique name. The game records what scripts have been run so they only run once)
You'll want to use the json version of the migration, because that loads when you load the save game, and convert all of entity 1, into entity 2.
write the script, and have it convert all of the ones from the mod, into ones from the base game, or another mod.

The only issue with this is, Positions are only retained if they've been changed (Like, if you use Bob's Inserters to change positions, those are saved as extra information in the entity, and if you change the entity via the mentioned method, the extra information is copied onto it, so the new positions are retained). If you replace a long handed inserter with a normal inserter, then the pick up and drop positions will change to that of the new inserter.

1 year, 5 months ago

I was thinking of starting with something like this:

for , surface in pairs(game.surfaces) do
for
, entity in pairs(surface.find_entities_filtered({name="long-stack-inserter"})) do
game.write_file(surface.name,entity.position,true)
end
end

Then theoretically I could run another script which iterates through the file, and places new inserters at the same location.

Any idea how to store the drop positions and the filter settings (for long stack filters) then how how do I make one of your stack inserters with the same drop positions + filter settings?

1 year, 5 months ago

Another tack, is there a way to debug WHY they are being removed? I don't know how to mod, but you seemed surprised that they are.

1 year, 5 months ago

Ok I got them loaded side-by-side is there a way to replace long with your version of long?

1 year, 5 months ago

My mod doesn't actually add any inserters, it just lets you choose the pickup and drop positions of inserters that currently exist.

1 year, 5 months ago

Right. I understand that part. Now that I know how to do get them to work, i am thinking I will just upload a modified version of his code, giving all credit to him only explaining the change.

As I understand there is a compatibility issue with bob's logistics when inserter overhaul is turn on, but there is no issue if this mod (adjustable inserters) is turned on. The other mod checks for bobmods then for settings.startup["bobmods-inserters-long2"] if that value is set to true, it disables itself. So it seems like I want to keep that only if you have bob's logistics installed (but when only adjustable is installed). So Im thinking I can do the same check but only turn off if game.active_mods["boblogistics"]. Unless there is another way in settings that you can think of...

Is there anyway to write a migration where you change the inserters AND set the drop/pickup points? I just don't have any idea how to set those programmatically (if that is at all possible).

1 year, 5 months ago

That should work fine. Though If I were you, I'd talk to him to try and get him to make the change in his mod, rather than uploading a version of your own.

Migration can be pretty complex, you'd have to use a LUA script (not a JSON) and perform the following actions (It's been a while since I looked at code, and aren't right now)
Scan the entire map for entity type inserter. (it will give you a list that you need to iterate)
check those to see if it's one of the types of inserter you want to replace.
save values for pickup and drop locations, it's position and facing
Place the new inserter in the same position, with the same facing, as the old one, with fast replace option turned on.
Set the saved pickup and drop locations to the new inserter.

I think that's what it involves.

KiwiHawk β˜†
1 year, 5 months ago

If you can do a fast replace, that would be a lot easier. The settings should all transfer automatically!

1 year, 5 months ago

Exactly, All settings would be copied on fast replace, but to perform a fast replace, you need to put the inserter in the same position, and ideally with the same facing.
Pickup and Drop locations might copy over if they've been changed away from the entity defaults, but if they've not been changed, then the defaults on the new inserter will be used, which is why you need to copy the original locations.

It's fine if you're changing Long to Long, or Standard to Standard, but modded inserters often have non-standard placements. Like right angles, or long reach, etc.

New response