Krastorio 2


An overhaul mod focusing on end-game technologies and moderately increased complexity.

Overhaul
7 months ago
0.18 - 1.1
338K
Transportation Logistics Trains Combat Armor Mining Fluids Logistic network Manufacturing Power Storage

b SE Tech Tree Ingredient Issue

3 years ago

Hey raiguard,

Could you help me to understand why k2 has to remove all science packs that aren't its own from the ingredients of all techs in the tech tree in its data-final-fixes.lua on line 39? Someone in the SE discord reported that they couldn't make a mod that depended on K2 and SE and specify SE science packs as the ingredients for their tech properly and I've determined that it's because K2 is deleting the SE techs from the ingredients for the tech. The way K2 was made compatible with SE's science packs was by making it so that in compatibility-scripts/data/space-exploration.lua all techs that start with "se-" are flagged as check_science_packs_incompatibilities = false so that deletion script doesn't run on the ingredients in SE's techs. However if another mod that's not SE wants to have the SE science packs as tech ingredients, then their modded tech won't start with "se-" and will have its ingredients purged by the sanitizeUnitsOfAllTechnologiesInPacks function. I've got an alternative fix that instead of setting check_science_packs_incompatibilities = false for specifically se- techs, the list of science packs that K2 considers valid can just be appended to include all of SE's science packs. Do you have any thoughts on this? (sorry for the ping, wasn't sure the best way to reach you about something like this - would you prefer a post on the k2 issue tracker?). In addition to fixing the issue of an external mod trying to use SE science packs, it also fixes a couple issues with infinite techs only having K2 science packs in K2+SE (b/c the SE science packs are removed since the techs are vanilla and don't start with "se-"). I can make a PR for review if you feel this is an ok change.

Best,
~test447