Bot Servicing

by Mylon

Robots occasionally break and need to be serviced. Adds maintenance and attrition to bot use.

Tweaks
11 months ago
0.16 - 1.1
384
Logistic network

b No recipe for Broken Bots

4 years ago
(updated 4 years ago)

Hi Mylon,

the recipes to process broken bots are missing in my game. I've installed the latest version of this mod mid game and am playing with factorio's normal difficulty and your hard mod setting.

If I take a broken bot item and search for recipes via "what is it used for" nothing is found (not even recipes that are still locked). I fear I'm also missing the recipes for the spare parts.

Maybe this is related to this old post https://mods.factorio.com/mod/Bot_Servicing/discussion/5c66f65a65e257000df90be1

Let me know if you need further details.

Best regards
Maglay

4 years ago

Should be fixed now!

4 years ago
(updated 4 years ago)

Sadly not at my side. Tried even a clean install but the spare part and disassemble recipes do not show up. Maybe you can create your own "Bot Service" Technology which you can use to unlock all the recipes.

4 years ago
(updated 4 years ago)

What mods are you using that add additional bots? I try to limit the disassemble/service recipes to the unlocking of the bot so the crafting menu doesn't get too cluttered early on.

4 years ago
(updated 4 years ago)

I'm playing with full bob and angel.

I had a look at the function retroactivate and did some printf debugging. All the recipes are found and enabled is set to true. Maybe it is a problem with Factorio itself, if I remember correctly one should not unlock recipes in the on_configuration_changed event but use a migration script for that.

Since you already search for the correct technology that unlocks a bot you could add the disassemble recipes also to the recipe unlock effects (in a second loop that only runs in hard mode). Then these recipes are hidden until the research is completed. The powercell and control unit can be unlocked via the base game robotics tech, since this is always mandatory to research (even with angel + bob).

The actual unlocking can be done via a migration script with just a few lines of code:
for index, force in pairs(game.forces) do
force.reset_technology_effects()
end

But despite my problems to get it running: The mod is really great :)

4 years ago

Hi again,

I have realized what I described above and it works. I just learned that the migration script is no longer needed, Factorio handles this now on its own once a mod is changed.

Let me know if you want to have the lua files.

Greetings
Maglay

4 years ago

I've tested this quite a bit and I can't seem to make the migration apply properly. I've reached out to Bob to see if his mod has some interfering scripts.

4 years ago

There also seems to be an incompatibility with Industrial Revolution. Steampunk bots can be serviced properly, easy mode recipe to service other bots doesn't show up. Instead the advanced one is displaying, though without the related intermediaries, leaving the chain unable to be completed. I've done some testing with the mod but I think it's interfering with the recipes because if some of IR's internal algorithmically generated recipe cleanup code to remove excess recipes.

4 years ago
(updated 4 years ago)

This matches what I have observed with bob + angel bots.

Has the method I described a flaw which I do not see and stops you from adapting? I can tell only from my own experience, but searching the techs and adding the unlocks (as you do between line 131 and 150) also for the disassemble recipes works fine so far. Factorio itself handels the rest if the mod configuration has changed (e.g. version increases), meaning "support_recipes" and "retroactivate" are no longer required.

The only uncovered situation I can come up with right now is where a bot recipe is enabled from the very beginning without a corresponding tech. This case should/could be handled by checking if a recipe is not enabled yet.
And if "robotics" gets removed then the easiest solution is to add a single new tech that unlocks the two spare parts, possibly without prerequisites.

Greetings

4 years ago

I found the problem and it's been fixed! Thanks for your patience.

New response