Flow Control for Bob's Logistics


- Extends Flow Control to Bob's Logistics pipes - Compatible with Angel mods and AAI mods - Supports Artisanal Reskins

Content
1 year, 10 months ago
1.1
8.24K
Logistics

i SeaBlock and Artisanal Reskins Angel's Mods [IMPLEMENTED]

3 years ago
(updated 3 years ago)

Thanks so much for reviving this with support for the Artisanal Reskin line! I've added this to a tweaked SeaBlock pack, however, and run into a few quirks:

1) The mod fails to load w/ SeaBlock ( see: https://postimg.cc/BXL1kShw ) likely because the Bob's Mod pumpjacks are removed / disabled. I added a naïve existence check in data-updates for the entities to test this, which seems to work, but I'm unsure if this is the best way to implement this:

if data.raw.item["bob-pumpjack-1"] then data.raw.item["bob-pumpjack-1"].subgroup = "jack" end
if data.raw.item["bob-pumpjack-2"] then data.raw.item["bob-pumpjack-2"].subgroup = "jack" end
if data.raw.item["bob-pumpjack-3"] then data.raw.item["bob-pumpjack-3"].subgroup = "jack" end
if data.raw.item["bob-pumpjack-4"] then data.raw.item["bob-pumpjack-4"].subgroup = "jack" end

2) Artisanal Reskins Angel's Mods re-skins certain materials, impacting {titanium, ceramic, tungsten, nitinol} pipes ( see https://postimg.cc/Jt5CcZc1 ). It would be amazing for Flow Control to match!

3 years ago
(updated 3 years ago)

Thanks for addressing these issues.
That solution is serviceable though it'll look more elegant if worked off a function, i'll do my best to get it fixed ASAP

3 years ago
(updated 3 years ago)

As of now i managed to make the code extremely flexible (v1.1.19), i don't think there's anything that could conflict with it as everything's in double-check nutshell now, I'll sort angel's pipe colours in the next update (v1.1.20 which is almost ready)

3 years ago

...I was going to warn you that the pipe materials are gated behind a setting, but it looks like that is actually bugged on my end...

3 years ago
(updated 3 years ago)

@Kirazy
Shit happens, did quite a bit of testing and didn't notice it though, if you're going to change this, let me know, i'll change the line calling the override sheet in relation to the setting rather than mod-presence check

EDIT: as i said i'm no programmer (though constantly dealing with PLCs makes me akin), and your tables (again) taught me a lot, i think the code is starting to look somewhat "nice", thanks i guess

3 years ago

I made the setting and the locales for it, but didn't actually put the pipes behind it, lmao...

So this will go live at the end of April, but I'm going to go through and add a "status" check that mods can use to determine whether to act or not.

So some status table to quickly determine if any reskinning took place, or any material was reskinned, etc. I'll have to think about what that should look like. 'Cause there's three different ways that the pipes could not be reskinned. :D

3 years ago

@Kirazy
The ways of the Code are infinite...

3 years ago
(updated 3 years ago)

Many thanks you two for your hard work! It can be quite the challenge to iron out compatibility between different code bases - the effort and extensibility is very much appreciated.

@OldSkoolMatt
Apologies, I noticed some unexpected behavior with the pipe entities with angel's reskins you may want to look at (see https://i.postimg.cc/Hn1ttjYn/color-mismatch-2.png). On initial inspection, it appears that the reskinned pipes (titanium, ceramic, tungsten, nitinol) happily match their counterparts -- except for the covers. Conversely, non-reskinned pipes all default to iron while their covers match. This is true of the straight pipes as well as the elbows / t-junctions.

The covers for reskinned pipes looks to be easily fixable by replacing cover directory in flow-control-angels-override.lua:

local covers_path = "reskins-angels/graphics/entity/smelting/pipe-covers/"

Not exactly sure why the rest of the pipes are defaulting to iron textures though.

3 years ago
(updated 3 years ago)

Pipe covers may be handled more directly than that where the reskin is concerned:
entity.fluid_box.pipe_covers = reskins.lib.pipe_covers({mod = "angels", group = "smelting", material = "titanium/ceramic/tungsten/nitinol"})

mod can be either "bobs" or "angels", group either "logistics" or "smelting", for all the supported materials you already use, I believe.

3 years ago
(updated 3 years ago)

@Kirazy
Thanks for pointing this out, i'll see if i can get it to work this way then.
Also, going OT i have just completed THIS, could you help me with draw masks (i'm a shit artist) to have it fit your tier coloring?

3 years ago
(updated 3 years ago)

@Xanarios
Managed to fix everything, fuck knows what i touched during the last updates, since v1.1.21 all pipes were shown as iron pipes, i had to rollback to 1.1.20 and start again...
doing last adjustements now

3 years ago

FIXED!!!

3 years ago

...you forgot to commit your changes to github. :D

3 years ago

i was not bothered hehehehe, anyway i saw your fork, studying it now, i'll implement your stuff too lolololololol thanks man

3 years ago
(updated 3 years ago)

@Kirazy
Found a thing (very minor) in editor, the pipes do not show the appropriate icon nor tiering (all works in the crafting menu) not sure on how that's working tbh

and in data-updates.lua
an if check was missing :D

-- Conform pipe materials to those added by reskins-angels
if mods ["reskins-angels"] then
require("prototypes.flow-control-angels-override")
end

3 years ago
(updated 3 years ago)

The if then end check was moved to inside flow-control-angels-override, because conditional requires are advised against. It's probably fine to required based on mod presence (I do this for ShinyGFX...) but it can be avoided in this case.

The entity.icon not being properly set was related to me forgetting to specify type = "storage-tank" for the reskins.lib.assign_icons function. :D That should be fixed now.

3 years ago
(updated 3 years ago)

@Kirazy
Regarding the if check you're theoretically right, but the crash on startup if reskins-angels isn't enabled doesn't really look cool xD

Anyways, i'm sorting some compatibility issues with AAI, can i roll out the update based on your fork (as it is clearly more elegant and less clogged with useless stuff)?

3 years ago

Wait that shouldn't be happening, sec.

3 years ago

Ah, I see. I removed the check for the mod when I replaced it with trigger-based checks. Woops.

3 years ago

Ok you should be good to go now. I would merge the pull request, and then release based on your repository.

3 years ago

BREAKING NEWS:
I'm a shitbag when it comes to using github, give me a couple of hours to understand how to do it
._.

3 years ago

https://discord.gg/Ysnwumdc You should come here so we can talk live, I can fix the AAI issues (as far as I can tell it's related to tech unlocks?)

New response