Heavy Machine Gun Turret for Krastorio2


Adds a semi-early Heavy Machine Gun turret for Krastorio 2 that takes Anti-Materiel Rifle magazines. Generates AMR magazines if MWR is disabled. Damage and fire rate bonuses on the ammo and turret may not persist if MWR is enabled or disabled on a prior save.

Content
24 days ago
1.1 - 2.0
5.94K
Combat

b Fails to load. [Fixed]

2 years ago
(updated 2 years ago)

Greetings,

Missing ammo-category 'anti-material-rifle-ammo' (Perhaps spelling should be 'anti-materiel-rifle-ammo'?)

https://i.imgur.com/sbd6otg.png

2 years ago

Oversight with dependencies. My bad. Fixed now.

2 years ago

Thanks, unfortunately this mod still fails to load. Could be a conflict with some other mod then, but other mods work fine, so perhaps it's a mod setting.

I looked briefly in the K2 mod and I didn't find that ammo-category. Could you tell me where it's defined?

Here's another screenshot: https://i.imgur.com/tL7m5ff.png

Best Regards,

2 years ago
(updated 2 years ago)

The ammo-category is defined within Krastorio2 itself proper.

Although, it does seem dependent upon the More Realistic Weapons configuration option being enabled - otherwise that ammo and ammo category doesn't exist. Woops.

2 years ago
(updated 2 years ago)

Yeah... I eventually came across what seeems to be the definition that I was looking for.

I stumbled across it as I made a fix for another mod that didn't interact well with projectile travel distance and targeting range.

The solution was pretty straightforward for that mod, and I've posted on the modpage about the fix.

Now the strange thing was, I had that startup setting enabled (more-realistic-weapon) while trying to load this mod but it still failed to load at the time, but perhaps it would be prudent that I give this mod another go at loading, now that the rest of my modlist is working fine :)

This is something you could handle in your mod somehow, when the setting is disabled (and log a warning about it, at least).

if mods["Krastorio2"] and not krastorio.general.getSafeSettingValue("kr-more-realistic-weapon") then --[[ Handle the missing ammo, perhaps with a warning ]] end

Alternatively (the easy solution) you could skip loading in the definitions if the required mod option is disabled (although this could cause a data purge when loading a saved game - it would however allow the mod to load, but with a stern warning :)

2 years ago

Very interesting. I might do exactly that - create a fallback ammunition type - when I have time to. Thanks!

New response