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

NPCMod and Addons

@xyth@sphereii@Darkstardragon@arramus@GanTheGrey@khzmusik@stallionsden May I have permission to use your NPCs/mods in a pack I am working on? I originally put it together for myself & my husband, but people who have been watching us play it have been asking for it so thought I would tweak it a little, add a list to credit everyone properly, & put it out. It will be called CMS World Restoration, & the whole point is to restore the world, build settlements, & add back in some of the best parts of A16. I just want everyone's permission before I include their work in it. Thanks!


You are always free to use any of my modlets however you like. Credit is appreciated but not required.

When your mod/pack is released, let me know and I'll check it out.

 
i still hope u do an animal pack sometime it would be good to have tigers ,elephants ,scorpions, rhinos and other animals just to make maps more alive i used to love do the starvation mod when it was around

 
i still hope u do an animal pack sometime it would be good to have tigers ,elephants ,scorpions, rhinos and other animals just to make maps more alive i used to love do the starvation mod when it was around
I believe Age of Oblivion or the Apocalypse Now overhauls add some of those animals to the game.

 
For the NPC Mod, the limited things I have submitted were dependent on another creators' additions. Feel free to include in a modpack.
Thanks so much!

These mods are intended to be used in packs and other mods, so have at it and enjoy.
Thank you so much!

You are always free to use any of my modlets however you like. Credit is appreciated but not required.

When your mod/pack is released, let me know and I'll check it out.
Thanks! And I will let ya know asap!

 
i still hope u do an animal pack sometime it would be good to have tigers ,elephants ,scorpions, rhinos and other animals just to make maps more alive i used to love do the starvation mod when it was around
But then you need an africa style overhaul.
These few excotic animals from a zoo maybe, won't survive long enough.

 
Had 3 nstances over a few hours of NPCs who were following me dissapearing. One time it was when i open a double door barn,another i think it was when i knocked a tree down(in previous versions i had often seen npc's die when knocking a tree down with them following me) the other time im unsure of but positive a zed didnt kill him or anything else.

The NPCs where baker axe,soldier4 smg from the sub modlet,if that matters but proably not.

Im on single player,up to date,no other mods. Iv tripled my zed population through 7DTD xml.

Not sure if its known issue or has been reported,nand im unable to reproduce it unfortunately.

 
I'm confused.  I can manually spawn in the NPCs, but they do not spawn naturally.  I have the two main files installed in my mods folder.  Anything in particular I can check to research this?

 
Quick question, to stop the NPCs from opening doors, would I need to make some sort of adjustment in the SCore utilityai? Dang raiders keep waltzing in. Lol!

 
Quick question, to stop the NPCs from opening doors, would I need to make some sort of adjustment in the SCore utilityai? Dang raiders keep waltzing in. Lol!
Make your own door and lock it. Didnt used to work,but new version of the NPC mod seems that NPCs adhere to not opening locked doors. Maybe someone can confirm but in my tests that seemed to work

 
Hello everyone! I just recently started toying with some personal mods. I've modded other games in the past and typically catch on quickly but I'm having trouble getting anything I do for this game to work correctly. 

Initially I was working on a "Faction pack" using the base npc.xml. When it failed I noticed that this mod also alters that file so I opened it and took a look. I've noticed you've added several new Factions. "Aggressiveanimalssmall" etc. But, I don't see that you have changed the vanilla Factions for any of the animals from the default "Animals" faction. What I was trying to do is seperate animals into their own Factions. Things like rabbits, chickens and deer would still share the same passive animals function but things like Wolves, bears and mountain lions would be hostile towards eachother. I also wanted to make zombies actively aggressive towards animals as well. So would I need to pull the original strings from the vanilla npc.xml and add them to this one after editing? Trying to do it separately gave me red errors and I'm unsure why 🤔

Also. After installing this mod, before tinkering with any of the base values I'm running into a couple of issues I wanted to ask about.

When I see an NPC off in the distance there's not really a way to determine if it's friendly or a bandit until it's too late.

So often times I'd treat it like a pvp encounter and take a shot at them. But I noticed that hireable npc cannot be shot. I was considering making them work like boars. Friendly until fired upon. However I assume that doing so would also make it possible to shoot an NPC AFTER I hire them and trigger them into attacking me or am I mistaken? If so. Is there a way around this? To make an NPC neutral until either hired "Allied" or fired upon "Enemy"?

Any insight would be much appreciated 🙏 

 
it doesnt have to be african animals it could be a modlet of any animals i  want more animals and zombies in my worlds im not into bandits as thats boring to me i dont fancy being one shotted if i go somewhere the developers of this mod used to do a seperate creature pack for a19 but cancelled it to do this one 

 
Any insight would be much appreciated 🙏 
For the damaging neutral NPCs, if you look into NPCmod's entityclasses.xml, there's and effect group commented out called Damage All NPCs. It details how that works. You can uncomment that effect group, or if you'd wanna make a small patch modlet to change those values separately, you can have something like
 

<append xpath="/entity_classes/entity_class[@name='playerMale']">
<effect_group name="Damage All NPCs">
<triggered_effect trigger="onSelfFirstSpawn" action="ModifyCVar" cvar="DamageRelationship" operation="set" value="450"/>
<triggered_effect trigger="onSelfEnteredGame" action="ModifyCVar" cvar="DamageRelationship" operation="set" value="450"/>
<triggered_effect trigger="onSelfRespawn" action="ModifyCVar" cvar="DamageRelationship" operation="set" value="450"/>
</effect_group>
</append>


to set it up. The way they are coded is with the above bit used, they become hostile for 30 seconds if attacked. So if you accidentally hit one, you can run away for a bit and they will calm down. If you want all roaming NPCs to be neutral unless you attack them, you'd need to either change their factions to whiteriver or edit the bandits faction to be neutral instead of hate. Hired NPCs cannot be damaged at all, so no worries there.

For the factions, you should be able to do that, but adding new factions needs a new game, so that might be the source of your errors. You'd also need to edit their AI targets/tasks to add the classes of the things you want them to attack. Same for the zombies, you would need to add the classes for the stag and rabbit so they will target the passive ones. You may also need to add the "animal" tag to the UseFactionsTags values in SCore's blocks.xml so they use the factions properly.

 
For the damaging neutral NPCs, if you look into NPCmod's entityclasses.xml, there's and effect group commented out called Damage All NPCs. It details how that works. You can uncomment that effect group, or if you'd wanna make a small patch modlet to change those values separately, you can have something like
 

<append xpath="/entity_classes/entity_class[@name='playerMale']">
<effect_group name="Damage All NPCs">
<triggered_effect trigger="onSelfFirstSpawn" action="ModifyCVar" cvar="DamageRelationship" operation="set" value="450"/>
<triggered_effect trigger="onSelfEnteredGame" action="ModifyCVar" cvar="DamageRelationship" operation="set" value="450"/>
<triggered_effect trigger="onSelfRespawn" action="ModifyCVar" cvar="DamageRelationship" operation="set" value="450"/>
</effect_group>
</append>


to set it up. The way they are coded is with the above bit used, they become hostile for 30 seconds if attacked. So if you accidentally hit one, you can run away for a bit and they will calm down. If you want all roaming NPCs to be neutral unless you attack them, you'd need to either change their factions to whiteriver or edit the bandits faction to be neutral instead of hate. Hired NPCs cannot be damaged at all, so no worries there.

For the factions, you should be able to do that, but adding new factions needs a new game, so that might be the source of your errors. You'd also need to edit their AI targets/tasks to add the classes of the things you want them to attack. Same for the zombies, you would need to add the classes for the stag and rabbit so they will target the passive ones. You may also need to add the "animal" tag to the UseFactionsTags values in SCore's blocks.xml so they use the factions properly.
I was pretty sure I had the right idea with target/tasks and Factions! Thank you! What I didn't know how to do was change that part of entityclasses. Thank you so much!

I do start new games in between tests.

But thanks for making sure!

Edit* Looking at the XNPCCORE entityclasses.xml i notice at the top it says that they stopped using class based targeting in favor of Faction based targeting. If that is the case than wouldnt i only need to define Factions and faction enemies?

it doesnt have to be african animals it could be a modlet of any animals i  want more animals and zombies in my worlds im not into bandits as thats boring to me i dont fancy being one shotted if i go somewhere the developers of this mod used to do a seperate creature pack for a19 but cancelled it to do this one 
If you open it up in notepad you can reduce the bandit spawn rates to 0 and increase animal spawns to whatever you like.

 
Last edited by a moderator:
If you open it up in notepad you can reduce the bandit spawn rates to 0 and increase animal spawns to whatever you like.
This relates to there not being any NPC animal packs released for A20 and the desire to see them make a return since they were a positive feature in previous versions.

A20 saw some pretty fundamental changes to what classes remained and a number of mods had to pretty much begin again for some of the NPC/entity features. The animals will come back in time, but investing time in them now with A21 seeming to be pretty well developing in the background, may require a lot of time investment now and for what changes in A21.

Looking forward to any faction pack/NPC pack releases you may add to the collection. ^^

 
This relates to there not being any NPC animal packs released for A20 and the desire to see them make a return since they were a positive feature in previous versions.

A20 saw some pretty fundamental changes to what classes remained and a number of mods had to pretty much begin again for some of the NPC/entity features. The animals will come back in time, but investing time in them now with A21 seeming to be pretty well developing in the background, may require a lot of time investment now and for what changes in A21.

Looking forward to any faction pack/NPC pack releases you may add to the collection. ^^
I'm working on something for that atm for personal use. I'm trying to use Khaines wandering horde mod to also add occasional bandit groups and animal packs. You could try something similar or use mine if I get it to work 😉

That being said. I do know that with A21 getting closer any large amount of work I do will have to be redone but atm I'm considering it practice. Trying to familiarize myself with the code and what can be accomplished with it for the moment. 

 
Last edited by a moderator:
add occasional bandit groups and animal packs. You could try something similar or use mine if I get it to work 😉
For Wandering Hordes, we set all of the Not Medieval Mod to use only the Skeleton types pack and they are a lot of fun. A creator, Guppy, recently released some Grim Reapers and they also just joined that group. It gives the effect of the Grim Reapers leading all of the Skeleton types into battle. We also increased their numbers quite a lot to keep some alive should they be attacked by friendly armed NPCs. They will be able to overpower attacks in such situations. The same for the entities who appear when a player opens the Buried Supplies. The skeletons arrive as if they were disturbed from their slumber underground.

Bandit groups haven't really been a feature so far so it'll be interesting to see how it works out as you develop it. The ranged bandits in a Wandering Horde will be beastly if a single player gets caught unawares but some players live for moments like that.

 
For Wandering Hordes, we set all of the Not Medieval Mod to use only the Skeleton types pack and they are a lot of fun. A creator, Guppy, recently released some Grim Reapers and they also just joined that group. It gives the effect of the Grim Reapers leading all of the Skeleton types into battle. We also increased their numbers quite a lot to keep some alive should they be attacked by friendly armed NPCs. They will be able to overpower attacks in such situations. The same for the entities who appear when a player opens the Buried Supplies. The skeletons arrive as if they were disturbed from their slumber underground.

Bandit groups haven't really been a feature so far so it'll be interesting to see how it works out as you develop it. The ranged bandits in a Wandering Horde will be beastly if a single player gets caught unawares but some players live for moments like that.
I'm going to try and keep the occurrence rare so that people don't get frustrated by encounters like that lmao 

 
Hello everyone! I just recently started toying with some personal mods. I've modded other games in the past and typically catch on quickly but I'm having trouble getting anything I do for this game to work correctly. 

Initially I was working on a "Faction pack" using the base npc.xml. When it failed I noticed that this mod also alters that file so I opened it and took a look. I've noticed you've added several new Factions. "Aggressiveanimalssmall" etc. But, I don't see that you have changed the vanilla Factions for any of the animals from the default "Animals" faction. What I was trying to do is seperate animals into their own Factions. Things like rabbits, chickens and deer would still share the same passive animals function but things like Wolves, bears and mountain lions would be hostile towards eachother. I also wanted to make zombies actively aggressive towards animals as well. So would I need to pull the original strings from the vanilla npc.xml and add them to this one after editing? Trying to do it separately gave me red errors and I'm unsure why 🤔


The NPC Core mod does add the new animal factions to vanilla animals. It's done in entityclasses.xml:
https://github.com/7D2D/A20Mods/blob/main/0-XNPCCore/Config/entityclasses.xml#L60

NPC Core should also add the C# classes to the vanilla AI targeting tasks:

https://github.com/7D2D/A20Mods/blob/main/0-XNPCCore/Config/entityclasses.xml#L24

The issue is that animals don't use factions by default.

There is a "config feature block" in SCore that determines which tags an entity must have in order to use faction-based targeting/damage rules:

https://github.com/SphereII/SphereII.Mods/blob/master/0-SCore/Config/blocks.xml#L160

Add the "animal" tag for animals to use it.

I thought zombies already attacked animals though?

When I see an NPC off in the distance there's not really a way to determine if it's friendly or a bandit until it's too late.

So often times I'd treat it like a pvp encounter and take a shot at them. But I noticed that hireable npc cannot be shot. I was considering making them work like boars. Friendly until fired upon. However I assume that doing so would also make it possible to shoot an NPC AFTER I hire them and trigger them into attacking me or am I mistaken? If so. Is there a way around this? To make an NPC neutral until either hired "Allied" or fired upon "Enemy"?

Any insight would be much appreciated 🙏 


By default, human (and only human) NPCs cannot be damaged unless their faction relationship is "dislike" or lower. So any faction with a "*" value of "neutral" is immune from damage from the player, and NPCs from different factions that are neutral to each other also can't damage each other.

I also don't like that - I think the player should be able to damage any entity, just like they can damage vanilla neutral entities such as boars. It's also necessary for the faction-related quests I'm doing, which reward the player with a higher faction standing upon completion.

So, I set players to damage anything with a faction relationship below 1001 - which is all factions, since the maximum faction relationship value is 1000.

Here's the code where I did that in my modlet:

https://gitlab.com/karlgiesing/7d2d-a20-modlets/-/blob/main/1-khzmusik_Human_Factions_Reputation_Quests/Config/entityclasses.xml

That also shows the values for all the faction relationships (hate, dislike, neutral, like, love).

Note that hired NPCs are always damage immune from their bosses (and vice versa). In MP, this should also apply to other players, depending on the P2P damage rules set up on the server. This can't be changed and is independent of NPC faction.

I'm working on something for that atm for personal use. I'm trying to use Khaines wandering horde mod to also add occasional bandit groups and animal packs. You could try something similar or use mine if I get it to work 😉


Unfortunately you can't spawn most NPCs into hordes (neither wandering hordes nor blood moon hordes). The vanilla code assumes that the entity's C# class descends from EntityEnemy. The vast majority of NPC Core entities don't, and neither do the majority of entities in packs. So if you try to spawn them into hordes, you'll get big red null reference errors in the console.

There are two exceptions: my Whisperers pack, and my Rogues and Psychos packs. Those have both "advanced" (hireable) versions and "basic" versions. The "basic" versions can be spawned into wandering hordes, and in fact the Whisperers already do. I figured most people would want that for enemies, so the "basic" ones are the ones that are used by default.

You can get those packs from my thread on these forums:

https://community.7daystodie.com/topic/27333-a20-khzmusiks-modlets/

In order to get those to work, I made the "basic" versions descend from the NPC Core "blood moon" templates. Those templates have "BM" in their names (like "npcBMClubTemplate"). If you want, you could try changing the other NPCs (in either Core or whatever packs you're using) to use those same templates.

Using those templates will mean that NPCs can't be hired or interacted with (those features are in the NPC Core class that doesn't descend from EntityEnemy).

There is no problem spawning any NPCs into biome spawns. There is also no problem with spawning them into sleeper volumes in POIs. If you're interested, NPC Core contains a lot of custom spawn groups for sleeper volumes, so you can create NPC POIs just like you would vanilla POIs (just use the different spawn groups).

Hope that helps.

 
Last edited by a moderator:
A small update for the NPC Mod Sample Prefabs.

This is a Road Block incorporating @Darkstardragon's 1-SoldierPack. It is build on the Trader Gateway Tile because this is a sure way to ensure the Road Block appears where it should. It is a static 'POI' that will appear at every Trader area. It is as much as a test as it is for function.

The soldiers will quite potentially get wiped out during the first Blood Moon but as they are built into Sleeper Volumes like in a regular POI, they should respawn every 5 days.

It is crude but demonstrates Pathing Cubes, Sleeper Volumes, and other NPCMod features. The POI for this feature is in the folder NPCMod_Military_rwg_tile_gateway_cap.

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




 
Back
Top