• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

NPCMod and Addons

Balance of the number of NPCs that spawn is difficult as it varies depending on which expansion packs and how many expansion packs you load.  I use the civialians pack and I see a lot of those.  Soldiers and bandits also spawn a lot.  You can edit the spawn rates directly in each mods entitygroups.xml.  
Well I use quite a few mods so maybe it's a compatibility issue instead. I use multiple expansion packs and zombie packs such as enzombies and snufkin zombie plus, improved wandering hordes, firearm expansion. 

 
Well I use quite a few mods so maybe it's a compatibility issue instead. I use multiple expansion packs and zombie packs such as enzombies and snufkin zombie plus, improved wandering hordes, firearm expansion. 
I may be wrong, but as far as I know enzombies makes changes to several things (like entity groups) so you want it to load before any other zombie mods. Simply rename that mod folder so it loads before the others (I think I had to put a 0a at the beginning of it so it loads before the noc mods… just make sure when you sort the mods in the mod folder it appears before them when sorted alphabetically from a-z)  and see if that helps. I’m not sure if this has changed since I last loaded it and other zed mods.

 
Do you by chance plan on adding back the voices like what was in the A19 version?
Not sure which voices you were looking for. Xyth has harley voiced and i have one of the soldiers and a couple of the gurls from the survivorz pack voiced. Its not really a feature thats had great feedback, most ive heard is can you please make them not voiced lol.

 
Last edited by a moderator:
I may be wrong, but as far as I know enzombies makes changes to several things (like entity groups) so you want it to load before any other zombie mods. Simply rename that mod folder so it loads before the others (I think I had to put a 0a at the beginning of it so it loads before the noc mods… just make sure when you sort the mods in the mod folder it appears before them when sorted alphabetically from a-z)  and see if that helps. I’m not sure if this has changed since I last loaded it and other zed mods.
I will go ahead and give this a try now and see if it helps, thanks for ANY help on the matter because im pretty lost lol.

 
Not sure which voices you were looking for. Xyth has harley voiced and i have one of the soldiers and a couple of the gurls from the survivorz pack voiced. Its not really a feature thats had great feedback, most ive heard is can you please make them not voiced lol.
I realize now that the voices I was thinking about were from the raiders in bdubyahs wasteland mod so that's a goof on my part.

 
So I saw that it can be set for them to attack during a horde night. I’m not seeing options for that in the files. Were you meaning to get your NPCs to fight for you? If so, is there a way to get a certain percentage of horde night mobs to be hostile NPCs?  

Side note to that, seems some of the NPC packs spawn far more frequently than others.  Not all that many NPCs spawning vs the zombies etc. Not seeing an option to change ratios, does that exist somewhere?

 
So I saw that it can be set for them to attack during a horde night. I’m not seeing options for that in the files. Were you meaning to get your NPCs to fight for you? If so, is there a way to get a certain percentage of horde night mobs to be hostile NPCs?  

Side note to that, seems some of the NPC packs spawn far more frequently than others.  Not all that many NPCs spawning vs the zombies etc. Not seeing an option to change ratios, does that exist somewhere?


Bandits can spawn during a bloodmoon if they are setup to use the BM template rather than the default templates.  Hireable NPCs that spawned before the bloodmoons will fight against zombies and bloodmoon bandits.   The mod isnt setup by default to use bloodmoon bandits though.   Again, this mod is more an NPC engine than a full featured mod, the idea other mods will use this engine as a base for their own vision of NPCs in the game.

Spawning is handles by entitygroups.xml.   You can edit the values to increase or decrease spawn rates.

 
Here is an update for the A20 NPCMod Prefabs that are specifically set up to complement the NPCMod and NPCMod Addons.

https://github.com/arramus/A20-NPCMod-Prefabs

Bandit Settlement 02. A 100 x 100 POI that will spawn in the Wilderness as a T4 Bandit location for fetch, clear, and restore power quest type.

20220418040610_1.jpg

The ground level is sand box style game play while the underground is more scripted pathing.

There may be a surprise or two.

20220419134501_1.jpg

This POI will be best used in association with Darkstardragon's Bandit Addon packs, including the new Orcs Pack.

This POI is heavily influenced by Bdubyah's 'The Wasteland' mod which will receive its own customised version in due course. 'The Wasteland' is also powered by the NCPMod which allows for some interesting crossover.

 
Side note to that, seems some of the NPC packs spawn far more frequently than others.  Not all that many NPCs spawning vs the zombies etc. Not seeing an option to change ratios, does that exist somewhere?
This is a very good point and something Addon creators will be given more guidance on as things move forward.
These settings are governed independently by the Addon creators, with the NPCMod acting as base for them to be powered by, but guidance is clearly essential to ensure parity when multiple Addon Packs are installed.

While things are being set up and stabilised, it has been a bit of a free for all with one pack setting higher spawn rates than another. This makes it rather futile to combine Addon Packs if one is not going to spawn. Some guidance for Addon Pack creators is just being worked out in order to find an optimal balance. This will be based on a hierarchy of spawn rates to modulate appearances, and one possible candidate is as follows:

Default Settings (which can naturally be changed by Server Admin/Host to suit their own game play styles)

1. Standard zombies will always have the highest spawn chance out in the Biomes and take priority. Typically 100% chance.

2. Non standard zombies will have the second highest chance to spawn out in the Biomes. Typically 5% to 50% chance.

3. Then comes the NPCMod Addon Packs which should be lower than the lowest non standard zombie. They have a chance of 2.5% to 10%.

These are all dependent on the Biome as well.

For example, these are some of the most important Biome spawning zombie groups which the NPC are also added to:

All Zombies - The Janitor Zombie is the lowest Vanilla spawner with a 20% chance to appear.

Night Zombies - The Zombie Dog is the lowest Vanilla spawner with a 5% chance to appear.
Snow Zombies - The Feral Lumberjack Zombie has a 10% chance to appear. (There are also some separate game stage considerations for the snow biome)
Wasteland Zombies - All Vanilla spawners have a 100% chance to spawn with some being given even more chance.

Wasteland Night Zombies - All Vanilla spawners have a 100% chance to spawn with some being given even more chance. In addition, spawning frequency is much higher as we all well know if we venture into the Wasteland Biome 'alone' at night.

If there are too many NPCs, then the regular zombies will be wiped out too quickly and probability eventually says they will ultimately be replaced by another NPC. This can create a sterile World. But if there are too few NPCs then it will take some time for their numbers to increase. And as you are seeing, if one Addon Pack allows a high spawn chance (compared to other NPCs and zombies) then it can upset the Biomes.

It is a delicate balancing act, but it is being addressed.
It will also require a level of compliance from Addon creators to ensure all Addon Packs are given a fair and equal chance to appear in the World by default.

If you want to share what you have installed, and what you would like to see, then provide the details and we can advise you on a one setting fits all that can be added to all of the packs you have installed. It may take a little time for you to edit the entitygroups.xml for each but you'll always have those as templates. It will also help us see if the candidate settings are working out in the wild based on your future feedback.

 
A new POI for the NPCMod POI pack from WildPig has been uploaded for use.

https://github.com/arramus/A20-NPCMod-Prefabs

Cursed Manor is a Tier 4 fetch/clear POI populated by the Bandit class. It was made by WildPig in a World during regular gameplay with modded blocks, exported to the Editor, 'renovated' back to Vanilla blocks and then made good for the NPCMod.

Here are a few pikkies to showcase.

20220422020959_1.jpg

20220422021344_1.jpg

20220422021440_1.jpg

It follows a very scripted path and will offer a decent challenge for both questing and regular looting. Thank you to WildPig for giving permission for the Cursed Manor to be included in the NPCMod POI Pack.

 
Pushed small update that rebaselines the NPCCore's NPC character spawn rate to facilitate standardizing the spawn rate settings of expansion packs.  

 
Pushed small update that rebaselines the NPCCore's NPC character spawn rate to facilitate standardizing the spawn rate settings of expansion packs.  
Thank you. This allowed a much wider variety of Addon characters to appear in a Quest POI but still allowed the NPCCore's NPC characters to appear, but at a reduced rate. It was decent to see all of the Addon Packs make an appearance.

 
So currently we have a trader that if we walk into the area we get spammed with IndexOutofRange errors. It doesn't bring up the F1 menu at all, but we can't jump or do anything in the area.  We are still able to interact with things, just not jump.  When trying to figure out whats going on, i went into god/fly/no colision mode and even then I get bugged out and stuck and can't move within the trader.  The log for the server shows the below error.   We are playing the Wasteland Mod if that is of any import.  Also, is there a way to get a list of IDs for the NPCs in the packs?  We killed a players NPC thinking it was causing the issue when it wasn't and was wanting to respawn it if possible.

(Filename: C:/Program Files (x86)/Steam/steamapps/common/7 Days To Die/Mods/0-SCore/Scripts/Entities/EntityAliveSDX.cs Line: 923)

IndexOutOfRangeException: Index was outside the bounds of the array.
  at TraderData.get_TraderInfo () [0x00009] in <cd87b52f55b340409d519927eeec4b44>:0 
  at EntityTrader.get_TraderInfo () [0x00008] in <cd87b52f55b340409d519927eeec4b44>:0 
  at EntityTrader.OnUpdateLive () [0x001fd] in <cd87b52f55b340409d519927eeec4b44>:0 
  at EntityAliveSDX.OnUpdateLive () [0x000fc] in C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die\Mods\0-SCore\Scripts\Entities\EntityAliveSDX.cs:923 
  at EntityAlive.OnUpdateEntity () [0x0001e] in <cd87b52f55b340409d519927eeec4b44>:0 
  at World.TickEntity (Entity e, System.Single _partialTicks) [0x00127] in <cd87b52f55b340409d519927eeec4b44>:0 
  at World.TickEntitiesSlice (System.Int32 count) [0x00037] in <cd87b52f55b340409d519927eeec4b44>:0 
  at World.TickEntitiesFlush () [0x0000c] in <cd87b52f55b340409d519927eeec4b44>:0 
  at GameManager.UpdateTick () [0x00033] in <cd87b52f55b340409d519927eeec4b44>:0 
  at GameManager.gmUpdate () [0x002f4] in <cd87b52f55b340409d519927eeec4b44>:0 
  at GameManager.Update () [0x00000] in <cd87b52f55b340409d519927eeec4b44>:0 

Line 923 starts the syntax for this code

base.OnUpdateLive();

        // Allow EntityAliveSDX to get buffs from blocks
        if (!isEntityRemote && !SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
            UpdateBlockRadiusEffects();

        // No NPC info, don't continue
        if (NPCInfo == null)
            return;

       // if (isQuestGiver)
        {
            // If the Tile Entity Trader isn't set, set it now. Sometimes this fails, and won't allow interaction.
            if (_tileEntityTrader == null)
            {
                _tileEntityTrader = new TileEntityTrader(null);
                _tileEntityTrader.entityId = entityId;
                _tileEntityTrader.TraderData.TraderID = NPCInfo.TraderID;
            }
        }
        if (!this.isEntityRemote)
        {
            if (this.emodel)
            {
                AvatarController avatarController = this.emodel.avatarController;
                if (avatarController)
                {
                    var flag = this.onGround || this.isSwimming || this.bInElevator;
                    if (flag)
                    {
                        this.fallTime = 0f;
                        this.fallThresholdTime = 0f;
                        if (this.bInElevator)
                        {
                            this.fallThresholdTime = 0.6f;
                        }
                    }
                    else
                    {
                        if (this.fallThresholdTime == 0f)
                        {
                            this.fallThresholdTime = 0.1f + this.rand.RandomFloat * 0.3f;
                        }
                        this.fallTime += 0.05f;
                    }
                    var canFall = !this.emodel.IsRagdollActive && this.bodyDamage.CurrentStun == EnumEntityStunType.None && !this.isSwimming && !this.bInElevator && this.jumpState == EntityAlive.JumpState.Off && !this.IsDead();
                    if (this.fallTime <= this.fallThresholdTime)
                    {
                        canFall = false;
                    }
                    avatarController?.SetFallAndGround(canFall, flag);
                }
            }

        }

 
Last edited by a moderator:
I"ll go ahead and try the update as well because I think that is exactly the problem im having because I also have a lot of addon packs.
This update was primarily for the POI spawning. If the problem you are having is for how they are spawning out in the Biomes, it is probably because the Addon packs all use different spawning rates. Typically, the one with the highest will appear most frequently and the lowest may be incredibly rare, if at all. I'm going to start with Darkstardragon's Addon Packs and make them all spawn at identical rates when they are out in the Biome so they all have a fair chance to appear. The odd one or two, such as the Rocket NPCs, can be lower so they are a rarer exception. For other Addon Pack creators, guidance can be shared on best practices to help keep the Biomes fairly populated but it will require some level of compliance across all packs. We'll just have to see how it goes. On an individual level though, feel free to share what you're using and it will allow us to share a few changes that may balance things out. This comment is a common one for sure and tweaking is going on in the background.

 
So currently we have a trader that if we walk into the area we get spammed with IndexOutofRange errors. It doesn't bring up the F1 menu at all, but we can't jump or do anything in the area.  We are still able to interact with things, just not jump.  When trying to figure out whats going on, i went into god/fly/no colision mode and even then I get bugged out and stuck and can't move within the trader.  The log for the server shows the below error.   We are playing the Wasteland Mod if that is of any import.  Also, is there a way to get a list of IDs for the NPCs in the packs?  We killed a players NPC thinking it was causing the issue when it wasn't and was wanting to respawn it if possible.

(Filename: C:/Program Files (x86)/Steam/steamapps/common/7 Days To Die/Mods/0-SCore/Scripts/Entities/EntityAliveSDX.cs Line: 923)

IndexOutOfRangeException: Index was outside the bounds of the array.
  at TraderData.get_TraderInfo () [0x00009] in <cd87b52f55b340409d519927eeec4b44>:0 
  at EntityTrader.get_TraderInfo () [0x00008] in <cd87b52f55b340409d519927eeec4b44>:0 
  at EntityTrader.OnUpdateLive () [0x001fd] in <cd87b52f55b340409d519927eeec4b44>:0 
  at EntityAliveSDX.OnUpdateLive () [0x000fc] in C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die\Mods\0-SCore\Scripts\Entities\EntityAliveSDX.cs:923 
  at EntityAlive.OnUpdateEntity () [0x0001e] in <cd87b52f55b340409d519927eeec4b44>:0 
  at World.TickEntity (Entity e, System.Single _partialTicks) [0x00127] in <cd87b52f55b340409d519927eeec4b44>:0 
  at World.TickEntitiesSlice (System.Int32 count) [0x00037] in <cd87b52f55b340409d519927eeec4b44>:0 
  at World.TickEntitiesFlush () [0x0000c] in <cd87b52f55b340409d519927eeec4b44>:0 
  at GameManager.UpdateTick () [0x00033] in <cd87b52f55b340409d519927eeec4b44>:0 
  at GameManager.gmUpdate () [0x002f4] in <cd87b52f55b340409d519927eeec4b44>:0 
  at GameManager.Update () [0x00000] in <cd87b52f55b340409d519927eeec4b44>:0 

Line 923 starts the syntax for this code

base.OnUpdateLive();

        // Allow EntityAliveSDX to get buffs from blocks
        if (!isEntityRemote && !SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
            UpdateBlockRadiusEffects();

        // No NPC info, don't continue
        if (NPCInfo == null)
            return;

       // if (isQuestGiver)
        {
            // If the Tile Entity Trader isn't set, set it now. Sometimes this fails, and won't allow interaction.
            if (_tileEntityTrader == null)
            {
                _tileEntityTrader = new TileEntityTrader(null);
                _tileEntityTrader.entityId = entityId;
                _tileEntityTrader.TraderData.TraderID = NPCInfo.TraderID;
            }
        }
        if (!this.isEntityRemote)
        {
            if (this.emodel)
            {
                AvatarController avatarController = this.emodel.avatarController;
                if (avatarController)
                {
                    var flag = this.onGround || this.isSwimming || this.bInElevator;
                    if (flag)
                    {
                        this.fallTime = 0f;
                        this.fallThresholdTime = 0f;
                        if (this.bInElevator)
                        {
                            this.fallThresholdTime = 0.6f;
                        }
                    }
                    else
                    {
                        if (this.fallThresholdTime == 0f)
                        {
                            this.fallThresholdTime = 0.1f + this.rand.RandomFloat * 0.3f;
                        }
                        this.fallTime += 0.05f;
                    }
                    var canFall = !this.emodel.IsRagdollActive && this.bodyDamage.CurrentStun == EnumEntityStunType.None && !this.isSwimming && !this.bInElevator && this.jumpState == EntityAlive.JumpState.Off && !this.IsDead();
                    if (this.fallTime <= this.fallThresholdTime)
                    {
                        canFall = false;
                    }
                    avatarController?.SetFallAndGround(canFall, flag);
                }
            }

        }
Logged on today and... it's fixed? Not sure how.

 
Logged on today and... it's fixed? Not sure how.
Spooky. The WL uses the .ddl for Disabling Protection and hard to say if that has rare moments like that.

I don't believe spawning in an NPC to replace a lost one will be a long term stable solution. I believe it will eventually disappear after the player logs out and returns. Maybe bringing back one of the Rad Cat Power Armor NPCs from the Big Rocket Trader will make up for the loss.

 
Back
Top