[0.16.42] bob_power bug after latest update

Some mods, made by Bob. Basically streaks every Factroio-area.

Moderator: bobingabout

User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

[0.16.42] bob_power bug after latest update

Post by Trblz »

Just updated my mods and got
9.781 Loading mod bobpower 0.16.4 (data-updates.lua)
9.783 Script @__boblibrary__/technology-functions.lua:152: Technology bob-boiler-2 does not exist.
9.783 Script @__boblibrary__/technology-functions.lua:152: Technology bob-boiler-2 does not exist.
9.783 Script @__boblibrary__/technology-functions.lua:152: Technology bob-boiler-3 does not exist.
9.785 Script @__boblibrary__/technology-functions.lua:152: Technology steam-engine-generator-2 does not exist.
9.785 Script @__boblibrary__/technology-functions.lua:152: Technology steam-engine-generator-2 does not exist.
9.785 Script @__boblibrary__/technology-functions.lua:152: Technology steam-engine-generator-2 does not exist.
9.785 Script @__boblibrary__/technology-functions.lua:152: Technology steam-engine-generator-3 does not exist.
9.785 Script @__boblibrary__/technology-functions.lua:152: Technology steam-engine-generator-3 does not exist.
9.786 Error ModManager.cpp:1024: Failed to load mod "bobpower": __bobpower__/data-updates.lua:8: __boblibrary__/item-functions.lua:47: attempt to compare number with string
My modlist is
mod-list.json
Mod list
(4.03 KiB) Downloaded 131 times
My Mod list: Necormant co-author
gnemonix
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Apr 27, 2014 10:06 pm
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by gnemonix »

I'll re-post this from here
gnemonix wrote:A recent update of Nanobots (2.0.5) seemed to break BobPower.
Without Nanobots or with an older version (2.02) the game loads just fine.

Investigation discovered the culprit to be these:

bobpower/prototypes/fluid-generator-updates.lua

Code: Select all

if data.raw.item["steel-pipe"] then
  bobmods.lib.recipe.add_ingredient("fluid-generator-2", "normal", {"steel-pipe", 5})
end

Code: Select all

if data.raw.item["titanium-pipe"] then
  bobmods.lib.recipe.add_ingredient("fluid-generator-3", "normal", {"titanium-pipe", 5})
end
With the BobLibrary function defined as this:
boblibrary/recipe-functions.lua

Code: Select all

function bobmods.lib.recipe.add_ingredient(recipe, item)
The library function is defined with 2 parameters while the code calling it is using 3 parameters.

Due to the "normal" parameter in the middle, I noticed that there is a different function that might have been intended: add_difficulty_ingredient() which does have 3 parameters.

To get my game working for now I removed the "normal" parameter in the problem lines like so:

Code: Select all

if data.raw.item["steel-pipe"] then
  bobmods.lib.recipe.add_ingredient("fluid-generator-2", {"steel-pipe", 5})
end

Code: Select all

if data.raw.item["titanium-pipe"] then
  bobmods.lib.recipe.add_ingredient("fluid-generator-3", {"titanium-pipe", 5})
end
However, which is inteded? add_ingredient() or add_difficulty_ingredient()
User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by Trblz »

The actual trigger was not bob_power but the nanobots update beyond 2.0.2 - this broke bob's code. (https://mods.factorio.com/mod/Nanobots/discussion)
Reversing the nano_bots version solved the current problem.
My Mod list: Necormant co-author
gnemonix
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Apr 27, 2014 10:06 pm
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by gnemonix »

It's not Nanobots itself so much as a major bump in STDLIB that potentially broke it. However, the API calls for boblibrary are still inconsistent and need to be addressed.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by bobingabout »

It's bob's fault. he needs to fix Power mod.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by Nexela »

Actually was a mixture of Bobs and Nexela's fault

Bob was using the wrong function so the parameters were not what was expected. In normal cases this didn't error it just logged.

Nexela then made an stdlib update that had a changed pushed to the wrong repo that changed the way strings behaved. which now caused caused bobs function to return a non number value (instead of nil) causing things to go boom.
Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by Aeternus »

Here's to never needing error handling, ay Bob? :D

Seems like a fairly simple fix though.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by bobingabout »

if you have recomendations to make that function in my library more robust, I'm open to sugestions.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by Nexela »

bobingabout wrote:if you have recomendations to make that function in my library more robust, I'm open to sugestions.
I didn't follow the full logic of the function put it it is meant to only take a table then doing an if not type(input) == table then return log('blah") end at the top of the function will help

Other than that your function was working correctly just the string change broke it. So fixing it so bob-power calls the correct function would be the best first step :)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.42] bob_power bug after latest update

Post by bobingabout »

Nexela wrote:
bobingabout wrote:if you have recomendations to make that function in my library more robust, I'm open to sugestions.
I didn't follow the full logic of the function put it it is meant to only take a table then doing an if not type(input) == table then return log('blah") end at the top of the function will help

Other than that your function was working correctly just the string change broke it.
So, add a check in bobmods.lib.item.basic_item to make sure input variable is actually a table.
Nexela wrote:So fixing it so bob-power calls the correct function would be the best first step :)
I already did this bit.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Bob's mods”