Closest Material

If you liked this item, please rate it up on Steam Workshop page.

Author: Mauro Júnior

Last revision: 11 Oct, 2023 at 02:55 UTC

File size: 332.8 KB

On Steam Workshop

Description:

Do you plan to build stairs that go from your base to the top of the map through different biomes and different materials, but do you want them to build the stairs using the materials that are available near the building regardless of what it is, just use whatever is closest? Or just want them to build anything, not caring about the material used? This MOD is for you.

After building the blueprint using the MOD material or any other material, when using the tool on the blueprint, it will change the materials to the closest ones, obeying the original construction category. If for that category it does not find the material, it leaves the original blueprint material.

MOD USE:

1) Material can be used for planning without delivery of materials
2) Use the tool to update materials from any blueprint to the closest
3) When selecting the material from the MOD, it will build automatically, taking the closest one automatically.

SETTINGS EXPLICATION:

1) Allows if the MOD material is a material available for building blueprints within the game, however if you use a MOD that allows you to build without needing materials, this option becomes irrelevant.

2) Whether the tool will switch to the closest materials, only the blueprints that have the MOD element or all of them

3) If building the blueprint using the MOD material, it will automatically search for the closest material, or need to use the tool later. Disabling allows you to place blueprints for planning using the MOD material, and enabling allows agility in using this.

Channel "Estratégia Em Choque", specialist in strategy games, demonstrating my MOD in practice:

https://www.youtube.com/watch?v=B4w8PlII9lw

Source Code: https://github.com/maurojunior2011/ClosestMaterial

This mod uses Peter Han’s excellent PLib under the MIT license:

PLib: https://github.com/peterhaneve/ONIMods/tree/master/PLib
License: https://opensource.org/licenses/MIT

GAME LIMITATIONS

NOTE 1: The DUPLICATOR will not always take the first material that is on the construction side, the game calculates the PATHFIND and it takes it from wherever it is faster, so the MOD helps in the sense that he does not need to take a material far away to continue the tasks. constructions. For example, if you ask him to build 10 stairs, he takes the material closest to him and the stairs and if he lacks material, he will use the one closest to the stairs, because the stairs were built using the closest materials.

NOTE 2: When creating the pipes and such, the DUPs already start digging, other constructions do not. This more or less allows you to use the MOD stuff as a planner. Unfortunately this happens in the core logic of the game, there is no way to remove it.

NOTE 3: Sometimes while building pipes and blocks, they seem to get disconnected, especially when clicking on just one that is connected in other blueprints, but it’s only visually, so building all of them connects… When replacing it doesn’t it happens. I’m seeing how to fix it, but it’s just visual.

NOTE 4: Due to the unavailability of a specific method/logic for this in the game code, I cannot fully validate the amount of material available, sometimes it can happen that he assigns 400kg of Copper (because it is the closest element) to build 10 blocks ( They would use 2000kg ), and the rest will remain as "Material Unavailable" until excavating / crafting more material.

UPDATE: 1.1
Fixed some items not crafting:
Fiber and Wood aren’t exactly "Building Materials" in the game, so I made a specific condition for them.

Update 1.2:
Now the MOD allows you to build inside rockets or use the material that is inside the rockets.

A) Build in the world using the materials inside the rockets that are landed
B) Builds on a landed rocket, using materials from the world that is landed or from within other rockets that are landed on the same world
C) In case the rocket is taking off, flying or landing, it will use the materials only inside the passenger module itself

Update 1.3:
Fixed the category of secondary materials, due to the game update and generating error when deconstructing things built using the MOD functionality. Unfortunately constructions already carried out, it can still generate an error when deconstructing, due to the game changing the categories, but allowing construction using the old data.

=> Any mistake/suggestion/criticism/compliment can let me know.

Did you like the MOD? Buy me a coffee… More utilities coming soon…
Buy me a Coffee[www.buymeacoffee.com]

[www.paypal.com]