Paste Logistic Settings (Continued)


Copy and paste logistic chest and inserter filters.

Utilities
2 months ago
2.0
187
Logistic network Circuit network Storage

i Suggestion:

3 months ago
(updated 3 months ago)

Control Shift left clicking the inserter adds 1 stack of assemblers recipe result to the enable/disable logistic connection

Can we add stacks for consecutive clicks?
2 clicks 2 stacks, 3 clicks 3 stacks and so on

Maybe have a little floating text on clicking that says filter: 1 stack / 2 stacks or 50 transport belts / 100 transport belts

3 months ago

Hey thanks for the feedback. It’s an interesting idea… I would definitely make it an off-by-default setting. In your mind is this just useful for the “outserter” or would you want the ingredient chest requests to work this way as well? My gut tells me just the outserter, which would also simplify the implementation drastically.

3 months ago

the Inserter / outserter only really. I think this will be a huge QOL upgrade

Although I can see it being beneficial for the ingredient chests, needing this feature for the ingredient chest will be rare.

3 months ago

I haven't had time to consider implementing this in the current version, but I just wanted to ping you back and say after some deep playtesting, I actually think I agree with you. There are 2 things I see missing right now:
1. It WOULD have been convenient in a few cases to multi-click and multiply the limit as you've suggested.
2. With or without that, I've realized there's really no user feedback on activation. I'm going to experiment with sounds and/or floating text as you suggested.

I'm trying to wrap up work on a test harness right now; once that's done I'll come back. These changes, plus a major new feature I want to add, plus a bug report I can't fully pinpoint all point me towards the big refactor I know I need to do, but I'm not going to even try that until I have proper tests in place.

3 months ago

Hey man, no problem if you need help implementing or bug hunting let me know

I've just reread your reply to my initial comment. i think some players put the filter on the inserter, and others on the outserter, it shouldn't really matter as the products in the outserter chest will be limited. Definitely wasn't asking for the chest filters, although, another feature I have just thought of:

I use a 6x6 aai buffer chest with assemblers all around, the first assembler ingredients are added fine, the second assemblers recipe ingredients overwrite the first ingredients. It would be beneficial to add them rather than overwrite. However, I do use the filter helper mod that adds a gui which is a few extra clicks but does the job.

I feel really invested now and couldn't help myself: (feel free to not use / tweak)

function lib.apply_inserter_settings(game, player_index, inserter, data)
local behavior = inserter.get_or_create_control_behavior()
if not data then return end
if not behavior then return end

if not data.item then return end -- happens when the output is a fluid

local proto = prototypes.item[data.name]
if not proto then return end -- e.g. fluids don't have a useful prototype
local output_limit_type = settings.get_player_settings(player_index)["paste-logistic-settings-continued-output-limit-type"].value
local output_limit = settings.get_player_settings(player_index)["paste-logistic-settings-continued-output-limit"].value
local limit = helpers.get_limit(game, proto, output_limit_type, output_limit)

-- Check existing logistic condition
local current_limit = limit
if behavior.logistic_condition and behavior.logistic_condition.first_signal and behavior.logistic_condition.first_signal.name == data.name then
-- Same filter, increment by one stack size
local stack_size = proto.stack_size or 1
current_limit = behavior.logistic_condition.constant + stack_size
end

behavior.connect_to_logistic_network = true
behavior.logistic_condition = {
comparator = "<",
first_signal = { type = "item", name = data.name, quality = helpers.get_quality_string(data.quality) },
constant = current_limit,
}

-- Create flying text at inserter's position to display the filter
local text = "Filter: " .. data.name .. " < " .. current_limit
game.players[player_index].create_local_flying_text{
text = text,
position = inserter.position,
color = {r = 1, g = 1, b = 1}, -- White text
time_to_live = 120, -- Extended duration for readability
speed = 0.05 -- Default speed for short text
}
end

3 months ago

My guy/gal - first of all I LOVE the enthusiasm, I'm so happy this mod is actually seeing real world use, second of all, it's MIT for a reason so don't apologize for contributing! Feel free to send PRs! (the formatting here kinda breaks my ability to straight copy/paste but I will review when I have time and use whatever I can)!

I am curious though, why it wasn't working with AAI. What I'm seeing is inconsistent behavior for sure - this is 100% a bug (probably in the matching logic), I've just got to find it, which I may not have time for tonight. Here's how I'm testing:

I have four different machines each set with a different recipe:
- EM plant / legendary green circuit
- Foundry / red underground
- Assembler 3 / rail ramp
- EM plant / supercapacitor

And pasting to the same blue chest (even non-AAI) from each of them sometimes works, sometimes doesn't, but it never seems to set more than 2 sections, so I could just be returning a value early.

Thanks for all this! Like I said I'll take a look as soon as I can, but now this is going to bug me while I'm gone :D

3 months ago

I don't know how to use git so I shared the snippet via discord

Let the aai 6x6 buffer thing actually, I'm away on the laptop not the normal pc

3 months ago

Ok with some deeper testing, the issue is absolutely inside get_or_create_section() for sure. Looking now.

3 months ago

It's definitely in has_same_ingredient_names()...... maybe ;)

3 months ago

Ok, by any chance, do any of the recipes you're using in that case have fluid ingredients? I think this may be YET ANOTHER fluid bug, but I'm not certain.

3 months ago

No to the fluids, the assembler recipes were yellow and red belts, splitter, and undergrounds

Still on the laptop on factorio 2.0.43 so I'm hesitant to provide any information as the issues may not be accurate due to the old factorio version. I'm home on tuesday night and can have a proper look.

3 months ago

Solutions? None.

But I know (better) what's happening now. I had tested it with two recipes, but never three. It will create a second section correctly, but when trying to add a third, it will always replace one of the existing two and I clearly don't have the brainpower to figure out the pattern in terms of which it chooses, or why.

This one seemingly stupid little bug/quirk is going to wind up forcing me to do The Big Refactor and I hate it lol :)

3 months ago

This is exactly the issue I was experiencing. After a Quick Look on the laptop I couldn’t recreate this so I was hesitant to say anything more.

I’m not able to load factorio at the moment - are you able to just add filters to the same logistic section rather than add multiple

For example, yellow belt and yellow underground

Both need plates and gears. Underground needs the yellow belts too

The requester / buffer has one logistic request section for the belt (plates and gears). Then when the second recipe is pasted, it adds the yellow belt ingredient request to the same logistic section and ignores the new requests for the plates and gears, as they are requested already

2 months ago

Hey Man
Finally had a chance to dive into this a bit more

I created a fork of the mod addressing both the issues here (all commits only address each change and are inline with version 1.3.8 + each individual change)

  1. Inserter consecutive pastes increase stack + floating text
    https://gitlab.com/ceeloman/paste-logistic-settings-continued/-/commit/bf5388a5433211e93b35512c8805290d9e3032b1

  2. Requester . Buffer changes
    2.1 Pasting recipe ingredients adds to one logistic section - unique ingredients from other recipes are added to the same section - already requested ingredients are ignored as they are already requested
    https://gitlab.com/ceeloman/paste-logistic-settings-continued/-/commit/f5003d81ab462a037de12a6c32e906d455c00dca

2.2 Pasting recipe ingredients always adds a new logistic section each time
https://gitlab.com/ceeloman/paste-logistic-settings-continued/-/commit/301ab1c43ba10e9d665c50ade38d9227454bd3dc

New response