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
a day ago
0.18 - 2.0
50.7K
Mining Fluids Blueprints

i Support for Tiberium

1 year, 10 months ago

Greetings. I've just recently begun using your mod, and I must say it's awesome.

Even better would be if I could use it for tiberium spikes from this mod: https://mods.factorio.com/mod/Factorio-Tiberium.
I've looked into the source and if I understand it correctly, it should automatically detect any fluid wells. However, in the case of this mod, tiberium blossom trees do not produce the liquid. Their resource is solid. It only changes to liquid once you place a tiberium spike (basically an oil pump) on it. Then it behaves like an oil well.

I don't really know where in the code I would have to add checks for this, as the planner basically needs a fixed mapping from tiberium nodes, which produce green tiberium to a tiberium spike, and then place that on top of the node, all the while ignoring tiberium on the ground.
Can you help me out with that?

1 year, 10 months ago
(updated 1 year, 10 months ago)

Thanks. I'm glad you like it.

I'm a bit rusty on the topic. It's been a while since I last did anything for this mod. If I recall correctly, PUMP iterates all minables, and checks to see of the result is a liquid. You can find this in the toolbox.lua file, the function get_resource_category_map_from_data(); specifically line 443:

        if resource.minable.results[1].type == "fluid" then
            table.insert(resource_category_map[resource.category].fluids,
                         name)
        end

I do see that the result-array there is forcibly checked for index "1". I have not checked how Factorio-Tiberium works, but maybe it has 2 (or more) entries in that resource.result array, and the liquid one is on index 2 or 3. Checking all entries in that array might already do the trick.

As for the ignoring the tiberium, .. that might already work? If you look in prospector.lua there are can_place_extractor and can_place_pipe functions. They check for defines.build_check_type.manual_ghost. If I recall correctly, it's equivalent that if you can place a ghost manually, in a way that bots will clear obstructions, it'll just place the ghost and let the bots figure out what to remove before placing it.

Hope this helps. Let me know if you figure it out or if you have more questions. If you manage to change it in a manner that doesn't include special exceptions in code for Tiberium (ie. if the index change above is sufficient), I would appreciate a pull request so I can release it as part of PUMP.

1 year, 9 months ago

Any luck yet?

If you could provide a save-file when I can conveniently try out the requested scenario, I can also have a look. If you create an issue on github repo for PUMP, you can attach the save file there.

1 year, 9 months ago

Sorry for the lack of response. I had a lot of sudden work, and am only now getting around to looking into the code again. Thanks for the advice so far.

1 year, 9 months ago

I looked into it, I will also provide you a savegame for convenience, however, the solution will most likely need to be some compatibility adaption for the tiberium mod. They have two types of blossom trees, and one of them provides solid, the other liquid. The tiberium spike (pumpjack prototype) can be placed on both. When it is placed on the solid, the solid one is removed and replaced by a liquid variant, which then serves as a liquid node. Unfortunately that is beyond my capabilities at the moment. If you don 't have time to look into it, I'll try to find a solution, but I don't know when I can dive that deep into the code.

1 year, 9 months ago

For future reference: This discussion continued on github: https://github.com/Xcone/factorio_pump/issues/14

And version 1.1.4. has been released to solve a part of the issue. The other part can hopefully be done on Tiberium-mod's side.

New response