Igrys

by egorexW

Igrys – A new planet with magic-powered science, advanced glassworking, and alternative production chains.

Content
15 days ago
2.0
12.4K
Factorio: Space Age Icon Space Age Mod
Planets Environment Mining Fluids Manufacturing

b Barrel names "incompatible" with other mods

4 months ago

Hi there

First of all, I feel calling this a bug is a bit on the harsh side.

When I use the following mods which try to do something with filled barrels (cosmetic), the Igrys barrels are not processed because of how you named them. Which is your decision obviously, but if it's all the same to you, I think it might be great if you could rename them? Your barrels seem to be some of the very few that aren't captured by these mods:
- BarrelFluidIcons, you can quickly infer why it doesn't work by looking here: https://github.com/TheTaurunti/factorio-barrelfluidicons/blob/d6e18d44b645c63d57f80fafcfee58c184366228/data-updates.lua#L64 (I thought it's a bug there and opened https://mods.factorio.com/mod/BarrelFluidIcons/discussion/680409d625f2185e0c75e4c2, but after digging around I'm not sure what's the best approach here)
- barreling-group2 the same, they try to group barrels into a dedicated group, but the Igrys barrels aren't captured (it's obvious by looking at how they do it, see https://github.com/pla/barreling-group2/blob/main/data-final-fixes.lua)

There seems to be no clear indicator whether an item is a barrel filled with a fluid or not, see discussion in the first link with BarrelFluidIcons.

I think if you would rename
- item igrys-strong-barrel-filled-magic-fluid to igrys-magic-fluid-barrel
- recipe igrys-strong-barrel-filled-magic-fluid to igrys-magic-fluid-barrel
- recipe igrys-empty-strong-barrel-filled-magic-fluid to empty-igrys-magic-fluid-barrel (regrettybly, the prefix could not be "igrys" I believe, but would have to be "empty"...)

it might work, and I feel that's the pattern vanilla barrels and most mod's barrels are named, too... - although, at least BarrelFluidIcons has to exclude your igrys-strong-barrel from its processing (since it assumes everything besides "empty-barrel" ending in "-barrel" is a filled barrel I think)

What do you think? Thank you! :-)

4 months ago
  • Renamed recipe: igrys-strong-barrel-filled-magic-fluid → igrys-magic-fluid-strong-barrel
  • Renamed recipe: igrys-empty-strong-barrel-filled-magic-fluid → empty-igrys-magic-fluid-strong-barrel
  • Renamed item: igrys-strong-barrel-filled-magic-fluid → igrys-magic-fluid-strong-barrel
    I renamed them like that, think it will work. Will soon push the update. Let me know if it's okay
4 months ago

Sorry for the delay, took a break for easter:)

4 months ago

Thanks a lot and no worries about taking a break - if you're refreshed, there's a chance you can support this mod even longer so we all get to enjoy it. :-)

I'm not 100% sure about the naming, I think there was a reason why I suggested the new names without the "strong" element, but I don't remember... I'll let you know if I encouter anything after your patch. :-)

4 months ago

Dang, I fear this doesn't work... https://mods.factorio.com/mod/BarrelFluidIcons crashes Factorio again.

I get the feeling that there's no good solution... both mods BarrelFluidIcons and Barreling Group seem to expect a very distinct behaviour when mods add barrels...

  • BarrelFluidIcons seems to expect for all items ending in "-barrel" (except the vanilla "empty-barrel" and the ones they explicitely exclude via compatibility code) having an ingredient "fluid" associated with them, which your igrys-strong-barrel and igrys-magic-fluid-strong-barrel don't have. This seems to work for things like the vanilla water barrel since the item is named exactly like the recipe...
  • Barreling Group iterates over all fluids and expects to find "empty-FLUID-barrel", and either "fill-FLUID-barrel" or "FLUID-barrel"...

When you introduce a new type of "empty" barrel (your strong barrel), I don't see a way to satisfy all these conditions.
Your fluid's name is "igrys-magic-fluid", that's why I thought these might work:
- item igrys-magic-fluid-barrel
- recipe igrys-magic-fluid-barrel
- recipe empty-igrys-magic-fluid-barrel

But even then BarrelFluidIcons (when not excluding the barrel items via compatibility code) would crash since the item igrys-magic-fluid-barrel has no fluid ingredient but is only an empty barrel...

e.g. the vanilla water barrel works for these mods since:
fluid: water
filling recipe: water-barrel
emptying recipe: empty-water-barrel
empty barrel item: empty-barrel
filled barrel item: water-barrel

=> BarrelFluidIcons
- ignores item: empty_barrel
- finds item: water-barrel
- finds a recipe with the same name water-barrel that has ingredient water
- finds recipe with prefix empty to empty the fluid: empty-water-barrel

=> Barreling Group
- gets water from iteration over all fluids
- from that, finds item water-barrel
- and finds recipes water-barrel and empty-water-barrel

Wouldn't know what to do there... at least, to fix the crash, BarrelFluidIcons has to add igrys-magic-fluid-strong-barrel to its compatibility list, and the other effects would not work, but at least there's no crash... :-(

4 months ago

I made a dumb mistake i thought it was just looking for the -barrel suffix

4 months ago

But you are saying that evenr removing the "strong" will not work?
Will it still be better? I can change it

4 months ago
(updated 4 months ago)
  • Renamed recipe: igrys-strong-barrel-filled-magic-fluid → igrys-magic-fluid-strong-barrel
  • Renamed recipe: igrys-empty-strong-barrel-filled-magic-fluid → empty-igrys-magic-fluid-strong-barrel
  • Renamed item: igrys-strong-barrel-filled-magic-fluid → igrys-magic-fluid-strong-barrel
    I renamed them like that, think it will work. Will soon push the update. Let me know if it's okay

The above would work IF your fluid's name was "igrys-magic-fluid-strong". Base game naming convention is "{fluid_name}-barrel" for the item and the fill recipe, and "empty-{fluid_name}-barrel" for the emptying recipe.

If you remove the word "strong" then yes - those names will match up with your magic fluid prototype's name, and should get picked up by mods that are looking for fluid barrels

4 months ago
(updated 4 months ago)

Hm, ok, I tried to understand it better. Here's what I found:

If you:
- rename the filled barrel item to igrys-magic-fluid-barrel
- rename the fill recipe to igrys-magic-fluid-barrel
- rename the empty recipe to empty-igrys-magic-fluid-barrel
AND
- swich the order of the result array of the empty recipe (index 0: the fluid, index 1: the empty strong barrel)

THEN those mods seem do their thing quite well:
- BarrelFluidIcons picks up the correct filled barrel and applies the changes to its icon it wants to make
- Barreling Group detects the filled item barrel, the fill recipe, and the empty recipe, and puts those in its new group barreling

BUT:
BarrelFluidIcons still crashes because it thinks the empty ITEM igrys-strong-barrel is something separate and has a fill and empty recipe too. There's no way to prevent this from your side (apart from you using the vanilla empty-barrel which you probably wouldn't want).

SO, BarrelFluidIcons would have to handle this case; I'll post in the other thread over there https://mods.factorio.com/mod/BarrelFluidIcons/discussion/680409d625f2185e0c75e4c2 what I experimented with and maybe it all works together in the end... (and I'll mention the strange need to switch the results array there, too...)

For completeness, there's still some strangeness going on in Barreling Group's new barreling group, in some GUIs (Helmod, Factoriopedia, Recipe Book, combinator signals, crafting, ...) I see all of the Igrys barrel things, in others not... I tried to compare with the vanilla water barrel, but couldn't reach a conclusion, maybe there's some subtle differences I didn't understand, or maybe Factorio handles barrels using the vanilla empty-barrel in some special way a mod can't even access. I need to stop there, I mean it works pretty good when those changes are applied, and after all BarrelFluidIcons and Barreling Group should only be cosmetical, so I wouldn't want to spend more hours there...

And, obviously, I can't say anything about other behaviour with other mods, I just looked into this issue and tried to understand...

What do you think?

4 months ago

Implemented all your change suggestions, hopefully works as good as it can:)

4 months ago

I think it works well now, thanks a lot! I'll come back if I find any more strange things. :-)

This thread has been locked.