Project Zomboid

Project Zomboid

Superb Survivors!
Activating this mod in a save that has already been played for months in-game
I don't really have time to learn steam's formatting, but here's something I dug up when trying to fix my save that kept only spawning hostile NPCs despite how my LUA config is set to 0% chance of spawning hostile NPCs.

Apparently as much as they said you don't need a fresh save to get this mod to work it will be a little janky and expect some visitors with a gun at your doorstep.

A workaround I found is messing with the actual mod itself in a file called "SuperSurvivorsMod.lua" which can be found on the mod's folder.
whether it's in your workshop folder or mods folder the location for it is roughly around:
"<Mod Location> \mods\Superb-Survivors\media\lua\client\3_Other"

Now the line that you have to change is a variable that factors in the chance of spawning Hostile NPCs, keep searching(Ctrl+f) for the keyword hostile until you find this:
"local FinalChanceToBeHostile = ChanceToBeHostileNPC + math.floor(hoursSurvived/48)"
there's 2 of them to be found, one is for normal spawns and the other is for Alt spawns.

What you want to do is to play around with "math.floor(hoursSurvived/48)". That basically means that the longer your save has been played the higher chance it'll come out as hostile to the point where it will bombard you with nothing but hostile NPCs and just a few lines below that is the same kind of calculation for the chance of them spawning with firearms regardless of what % you set in the options.

(extra tidbit, they have decent aim since the script also grants NPC skill bonuses for aiming, I guess you can get rid of that line if you want them to aim as bad as someone with Aiming skill level 0. The line for it is:
ASuperSurvivor.player:LevelPerk(Perks.FromString("Aiming"));
)

Feel free to experiment with the value replacing 48 with whatever number you choose, these are just my findings since it really confused me as to why NPCs keep coming out as hostile.
< >
Showing 1-2 of 2 comments
Choko 31 Oct, 2022 @ 4:55pm 
This also works for me if I have a chance hostile at 15%?
76561199259050575 31 Oct, 2022 @ 10:36pm 
Originally posted by Choko:
This also works for me if I have a chance hostile at 15%?

Yup. Changing the math.floor part only adds a certain percentage of what was already in your hostile spawn rate.

ChanceToBeHostileNPC = SuperSurvivorGetOptionValue("HostileSpawnRate") MaxChanceToBeHostileNPC = SuperSurvivorGetOptionValue("MaxHostileSpawnRate")

These are the variables that are in your in-game settings and are utilized in these lines mentioned earlier:

local FinalChanceToBeHostile = ChanceToBeHostileNPC + math.floor(hoursSurvived/48)

(restarts usually required to apply changes)
Last edited by Hazama (S)imp; 31 Oct, 2022 @ 10:40pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50