Rampant Arsenal (Fork)


Fork of abandoned mod Rampant Arsenal. Ported to Factorio 2.0 Adds a variety of weapons to wage war. Adds Additional Turrets, Ammo Types, Landmines, Equipment, Capsules, Walls, Vehicles. Origninal mod is Rampant Arsenal https://mods.factorio.com/mod/RampantArsenal?from=search

Content
3 months ago
2.0
15.9K
Combat

g Fixed the resistances bug crash.

a month ago

Hello if anyone is having troubles launching this I've used ChatGPT to give me to code necessary to fix this mod, I can now successfully launch the game.
In "data-final-fixes.lua" copy this code over the "setResistancePercent" function.

"local function setResistancePercent(entity, resistanceType, setPercent)
if not entity then return 0 end

-- Create resistances table if it doesn't exist
if not entity.resistances then
    entity.resistances = {}
end

-- Find existing resistance
local entityResist = nil
for i = 1, #entity.resistances do
    if entity.resistances[i].type == resistanceType then
        entityResist = entity.resistances[i]
        break
    end
end

-- If we’re just reading the percent
if not setPercent then
    if entityResist then
        return entityResist.percent or 0
    else
        return 0
    end
end

-- If resistance doesn’t exist, add it
if not entityResist then
    entityResist = {type = resistanceType, decrease = 0, percent = 0}
    table.insert(entity.resistances, entityResist)
end

-- Finally, set the new percent
entityResist.percent = setPercent
return entityResist.percent

end"

25 days ago

The code suggested by the ChatGPT is correct, but figuring out where he changed the function wasn't easy, even in such a simple function. It would have been better to include only the lines of code that were being added.

I'll add fix in the next release.

24 days ago

Thanks Dimm, sorry just was a easy fix for me. ^_^'

New response