Castra Prime


Fork of Castra, military planet, to fix balance issues.

Content
9 days ago
2.0
3.29K
Factorio: Space Age Icon Space Age Mod
Planets Logistics Combat Armor Enemies Environment Mining

b castra turrets doesnt work [edit: w/ K2]

14 days ago

The issue is that in Castra, ammo types are defined directly inside the file that spawns turrets. That means it's impossible for another mod to change the ammo types properly without hurting performance. In Krastorio 2, all regular ammo gets replaced with pistol ammo, so it doesn't fit into the turret. As a result, the turrets don't shoot.

Here's a piece of code inside castra-cache.lua that fixes the problem - but it still needs a trigger to activate it for normal use.
local sorted_ammo_types = {
bullet = {"kr-rifle-magazine", "kr-armor-piercing-rifle-magazine", "kr-uranium-rifle-magazine", "kr-plutonium-rifle-magazine"},
rocket = {"rocket", "explosive-rocket", "kr-nuclear-turret-rocket", "cerys-hydrogen-bomb"},
railgun = {"railgun-ammo" },
artillery_shell = {"artillery-shell", "cerys-neutron-bomb", "maraxsis-fat-man" },
}

14 days ago

Hi timzyxel,

Thanks for reporting this and the specific suggestion. I'm going to keep this open looking to hear from other users. I don't necessarily consider this a bug with Castra Prime. K2 is a major overhaul mod, and that is going to introduce some problems, especially with a "wacky" planet like Castra. In this case it sounds like the planet is still usable, albeit with perhaps a "cheesy" experience since some of the enemy turrets cannot fire. I will keep this in mind for potentially the next version, but I'm not really keen to start referencing a mod that I know nothing about in my mod, especially given that this is not an absolute blocker or crash type situation. Maybe K2 decides to change something in a few months, and then I would need to change it again. Or maybe someone's been building their factory/base defense off the fact that these turrets don't work, and this "fix" breaks their game.

I'm open to hearing more from the K2/Castra Prime overlap community.

14 days ago

Yeah, that makes sense. I’m not suggesting that Castra should add a K2-specific fix or start maintaining ammo lists for other overhaul mods.

What I meant is more of a generic compatibility option. If Castra exposed the enemy ammo list through a small API or remote interface, then compatibility mods could override it themselves without Castra needing to know anything about K2.

That way Castra keeps its current default behavior, and any K2/Castra compatibility can be handled externally by the people using that mod combination.

14 days ago

Yep, agreed. I will look for a way to do this in a more "abstract" way that doesn't need to reference K2. I don't think it'll be a simple refactor, so likely next week target.

New response