SPM No Military Science


Removes all technologies about dealing with aliens or costing military science packs for alienless runs. Can be applied to an ongoing game.

3 years ago
1.0 - 1.1
330

b Doesn't seem to hide techs in current saves

4 years ago

I tried adding this mod to a current save that I have and it doesn't seem to hide military technologies. I tried starting a new save and it correctly hides military technology. Not sure exactly what the issue is - I did some debugging and in my current save

game.print("Turrets? " .. tostring(technologies["turrets"].enabled) .. ", " .. tostring(technologies["turrets"].prototype.enabled))

Will print out true, false, but calling

force.technologies["turrets"].reload();

or

force.reset_technologies()

in a migration script doesn't seem to fix it. Setting each technology specifically to enabled = false in the migration fixes it though. Not exactly sure why that's needed, I feel like the reload should do the trick.

I'm running v0.18.32 of the game and 0.2.6 of the mod.

4 years ago

Yeah I noticed the mod only applies to new games but with my limited modding knowledge I can't figure out why nor how to change it. I'll try to look into migration scripts.

4 years ago

I was actually working on my own "Remove Military Tech" mod when I stumbled upon this one - I was trying to figure out a way to hide the weapons/ammo slots in the bottom right of the screen (haven't figured out how yet either).

I'm using data.raw.technology.TECH_NAME.hidden = true to hide the technologies. This seems to work even if the mod is loaded into a previously created game. I'm guessing "enabled" is set on game start and isn't affected by reload/resets, it has to be manually overridden using a migration script.

Here's a link to migrations information: https://lua-api.factorio.com/latest/Migrations.html

4 years ago
(updated 4 years ago)

Mmmh, maybe I'll simply rewrite it with hiding techs instead of disabling them, it seems like the easier option.
Thanks for the info!

4 years ago

You're welcome! I ran into some issues hiding them as well (https://forums.factorio.com/viewtopic.php?p=499485#p499485) but I think I got it worked out. I uploaded my mod the other day, you can check it out if you want to see how I'm doing it (feel free to steal anything you like and/or suggest anything I might have missed).

4 years ago

Thanks, I'll look into that!

New response