ClaudeMetz / FactoryPlanner

A mod for Factorio. Allows you to plan out your production in detail.
https://mods.factorio.com/mod/factoryplanner
MIT License
87 stars 43 forks source link

Add fluids to ingredient combinator #41

Closed ClaudeMetz closed 1 year ago

ClaudeMetz commented 1 year ago

I don't actually know what I wanted to do here anymore ...

pkoziol commented 1 year ago

@ClaudeMetz I'm not 100% sure, but I ๐Ÿ‘-ed the issue, because it sounded like something I would like to see, so...

When Factory Planner is in collapsed mode (is that correct name?) you can click buildings/beacons to get blueprint of them. You can also click ingredietns (and probably products and byproducts as well? I'm not sure right now) and get constant combinator with the a signal telling you what resource you need and how much per 1s/1m/1h. It's useful for marking belts when doing designs.

But that only works for non-fluid items. For fluids it shows message "Fluids canโ€™t be blueprinted as a combinator".

ClaudeMetz commented 1 year ago

Hmm right, I'm not sure why I excluded fluids from this in the first place, there's probably a reason? Can you think of any reasons for excluding fluids from the combinators?

pkoziol commented 1 year ago

I'm not super familiar with Lua nor modding Factorio, but from the user (player) perspective fluids work the same as other items - you can just set a signal that is a fluid.

So the question might be: is the function used in many places or only to generate constant combinators? Like, I don't know... calculating needed belts or something?

Do fluids need to be handled differently when creating a signal? Like, for example, when you add an icon to station names or blueprints you have to use [item=iron-plate], but [fluid=water].

ClaudeMetz commented 1 year ago

Appreciate the reply. I was mostly asking from a player perspective, I can work out the internals :)

pkoziol commented 1 year ago

My bad, it was a reflex ๐Ÿ˜‚

ClaudeMetz commented 1 year ago

Turns out this isn't very hard after all, which is why I added it for the next major release! Thanks for the help.

https://github.com/ClaudeMetz/FactoryPlanner/commit/edd6436e90d13dc11d8f56bd2eaa744ed18fab47