P.U.M.P.

by Xcone

P.U.M.P. (Prevent Unwanted Manual Pump-placement) adds a selection-tool with which you can select oil wells, and then plans the layout of pumpjacks and pipes for you.

Utilities
2 months ago
0.18 - 1.1
38.5K
Fluids Blueprints

g Rendered nonfunctional by "Armor Frames"

3 years ago

Hello,

thanks for this awesome mod.

There's another mod, called Armor Frames, which introduces "buddies", specialized pumps, miners, assemblers etc., that are fast and powerful but can be built only once. P.U.M.P. unfortunately uses the pump buddy automatically.
Is there anything you can do about that? The best would most likely be to just ignore that pump specifically.

Regards
Merikolus

3 years ago

You're welcome, and thank you for using it, as well as bringing an issue to my attention.

I know exactly why this is. It's a limitation for being able to address any-liquid with any-pump, without me having to adjust my mod for other mods. The limitation is that it can only work as long as 1 resource has 1 suitable pump. It was only a matter of time before someone would notice. xD

I rather not hardcode values from other mods into P.U.M.P.. That's maintenance and risk for breaking-changes that I'm not interested in. But your remark triggers me to finally address this limitation in some way. I'll start tinkering with it.

3 years ago

If you're willing to write something up, I'd be very interested in your solution.
I haven't really modded Factorio so far, but have some coding experience.

3 years ago

Well, I was trying to avoid it, but I think it's inevitable that P.U.M.P. will have to show a UI to the user with the available pumps for a resource. I'd hate having a pop-up all the time, though. So care needs to be taken to only show as few times as possible. I was thinking in the lines of:
- If there's no options, don't show the UI
- First time use, if there's multiple options, show the UI once. Remember selection and available options.
- Every use of pump, check if available options have changed (mods added/removed), if so, show UI again. If available options haven't changed, don't show UI but use previous selection instead.
- When using P.U.M.P. with the right mouse button, always show the UI, even if there's only 1 option.

I think that will make the UI as little intrusive as possible.

3 years ago
(updated 3 years ago)

That sounds like a good approach, except for being more work for you.

  • Every use of pump, check if available options have changed (mods added/removed), if so, show UI again. If available options haven't changed, don't show UI but use previous selection instead.

Does this take into account that research might add more pumps?
Also, even if P.U.M.P. would show a popup every single time, it would be so much better than having to place the pumps manually. (Just in case this might save you a lot of work.)

3 years ago

I had not considered research. Not sure how valuable that will be. By the time you've got bots, I assume most of that kind of research is complete already. Though mods can certainly mess that order up. I'll think about it, but probably won't include that straight away.

I suspect the UI itself to be the most work. It's something I need to learn first, as I've not made a UI in factorio yet. A little extra check when to show that UI is the easy part. :-)

3 years ago

Yeah, it's always the UI :-)

I'm trying to think of a way of using the game itself, like constructing an item or making you have to set up a configurator box or something like that to spare you the work of creating a UI, but nothing really good comes to my mind.

What do you think about a configurator where you could insert the pumps to use, in the order they should be selected?

3 years ago

Do you mean some kind of magic chest acting as an inventory for P.U.M.P.?

It's an interesting idea, but it's not how P.U.M.P. works. The mod does some lookup in game, querying which kind of building act as a miner for oil (or, .. any kind of liquid resource on the ground). After it figures out what kind of pump is suitable, it just places a ghost on that spot. That's it. (apart from weird routine that also connects the pipes ... ) From there it's up to you and your bots to place the things from the players inventory.

So a magic chest:
- is kinda cheaty, because it bypasses the player's inventory, as the game intends
- needs to change P.U.M.P. to place actual buildings, instead of ghosts.
- needs lots of checks to ensure the player only puts in pumps and nothing else. Imagine if it could accept electric poles, factories, rocket silos, tanks, green circuits; that'd be a mess.
- probably still needs some kind of custom UI

Nice idea for a separate mod though. Some way to extend the inventory by involving the factory. Maybe let the content of passive provider chests in the network you're standing in count to your inventory. No bot travel times and waiting for logistics to refill inventory!
.. but not for P.U.M.P. :-)

Anyway, it's also not that big of a deal to make a UI. Just something that wasn't needed yet for other player. And personally I don't need it as well as I play close to vanilla (just some QoL mods). In the meantime I have a really simple UI. Nothing fancy, but it gets the job done. I also track when I want to show the UI as I described earlier. Should also be possible for some future update to take research into account (provided it's something I can query in the game).

Currently figuring out how I can postpone P.U.M.P. to place the ghosts until after the UI is closed, because UI's don't freeze the game. There's some code I need to move around in order to make that work. Got a busy week ahead though. Not sure when I can wrap it up.

3 years ago

I didn't mean the box to provide the items, just the configuration.

For example:
You put one oil-only pump mk2 in slot one, the vanilla pump into slot two.
Lets assume there is oil and water added by a mod.

The box would only tell the mod what to use, but the mod would still place ghosts.
So if you used it to layout an oil patch, it would use the oil-only pump, as it fits.
If you used the mod on a water patch, it would find the oil pump mk2 unsuitable and use the vanilla one from slot two instead.

I didn't mean the box to be a building material provider, just an information provider, so you could skip building your GUI.

A GUI would be nicer for the player, of course :-)

As for the research: Do not yet researched pumps still count as available? Maybe that problem auto-resolves.

3 years ago

GUI it will be, then :-)

I have not explicitly tested for (not) researched items. I suspect my lookups in the game currently include all pumps, including the ones not yet researched.

You mention oil-only pump mk2. Is that hypothetical, or is there a mod that offers that? I would be interested in an as-small-as-possible mod to better test the behavior of having multiple suitable pumps. My current testing with armor frames is still limited to just one other pump. I also got sent in a test-map for Krastorio2 earlier. But that mod is HUGE, I'd prefer something more accessible for a vanilla player like me. If you have a recommendation that matches this, please share :-)

3 years ago

The mk2 was just hypothetical, sorry.
I've run into a few mods that might help you digest something as big as Krastorio2 quickly, though.
There's the "Creative Mod" and I've run into 2 mods to view global variables and such, unfortunately, I can't remember the names of those. Maybe that helps.

3 years ago

I was able to test all edge-cases I could think of with Armor Frames. So I think we're good. I've uploaded a new version of P.U.M.P. that should prompt a selection for which pump to use. Please let me know if it works for you. :-)

3 years ago

Awesome, it works, just as intended, I guess.
I didn't test the research yet, as my mod test environment is pretty messed up :-)

Either way, even if research does not get handled properly, that alternative placement mode that forces the UI prompt will take care of it.
Thanks a lot!

3 years ago

Glad to hear it works. If you find anything else, let me know! :-)

3 years ago

I surely will :)

New response