Hello, I'm the developer of research-multipliers
. I hacked this mod together in a single night, so I never meant for it to be bulletproof, and more or less, my mod is at fault for crashing hard and not just ignoring technologies it fails to handle. That said, my mod works perfectly fine when it encounters other mods that adhere to the Lua API correctly.
In the main body of my mod, I properly checked whether or not the research_trigger
property is set (in the case of trigger techs), and I ignore any technology that has that. This is all that should be required.
A person on discord mentioned 'I smell a mistake with checking for science packs not accounting for trigger techs'
That's exactly it.
My code was not tripping on trigger techs, it was tripping on a normal unit count technology, specifically, it was tripping on these, from Moshine: github.com/snouz/Moshine/data-final-fixes.lua#L28-L36
I checked your data.lua definitions (which calls technology.lua), and each of these technologies doesn't properly define a valid research_trigger or unit before returning (example). Technically, you're returning invalid types as a Factorio mod. This is well documented in the Lua API provided by Factorio.
More specifically, your initial data.lua implementation provides TechnologyPrototype
s that have the unit
as non-nil, but do not provide the time
or ingredients
properties, which are NOT documented as "Optional". This is why my mod crashed.
Of course, this is later corrected in data-final-fixes.lua, and it seems like it's a choice made to handle discrepancies with other mods that may modify your mod's technologies. If my mod loaded later (something I am not sure that I can control at all), my mod would not have crashed in that case either, as data-final-fixes.lua
would have applied, bringing your mod within spec properly.
I'll be releasing a fix (which is just to check whether or not the technology it encounters correctly adheres to the TechnologyPrototype/TechnologyUnit types. I'll also be adjusting things to error quietly, as that should have been the default behavior anyways. I might look into options to prevent modification of ingredient counts of 1
, as that generally hints at a more special research being involved.
but I can't really do anything on my side
This is inaccurate. I can only recommend that you update your technology.lua
file to include valid TechnologyUnit
objects so that mods running in between the data
and data-final-fixes
stages won't blow up when encountering your data, like mine did.