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

NPCMod and Addons

Until you tell them "follow me" like the "Stay here" command.

Basicly the new command is an extention of the "Stay here" which put the NPC into a "turret mode".
The new command allow them to move and attack, and once the thread is gone they going back to the spot.
Very useful for mellee only NPCs like animals, so they can attack ranged attackers and don't be target dummies.

 
What happens if the NPC goes "Where I am standing" and no enemy shows up. For how long he/she will remain at that position ?


@Canute has it right. If you tell an NPC to guard where you are standing, and no enemies ever show up, they'll just remain there.

Of course, you can always talk to them again and issue a different command. (Or even issue the "Guard and return" command again if you want to give them a different guard position.) You can also talk to them while they're in the process of going back to their guard position, if you want.

 
Hi Guys, what a great job...

3 observations:

The NPC's are alwas running on my spikes and barbed wires - lot of uhs and ohs and then the are dying... any idea to fix that?

The guys with the rocket aunchers are a disaster - destroying everything randomly. Maybe skipping that - I did and it's much better.

If your paid NPC is behind a fence or bars and Z's are coming they do not shoot regulary only sometimes. 

And is there a possibility to rename them? I mean in game? Would be great for animal friends...

Talking NPC's are a bit a pain - repating alwas the same and very loud - especialy some officers 😉 

Thank's for makinging the game more fun.

 
Hi Guys, what a great job...

3 observations:

The NPC's are alwas running on my spikes and barbed wires - lot of uhs and ohs and then the are dying... any idea to fix that?

The guys with the rocket aunchers are a disaster - destroying everything randomly. Maybe skipping that - I did and it's much better.

If your paid NPC is behind a fence or bars and Z's are coming they do not shoot regulary only sometimes. 

And is there a possibility to rename them? I mean in game? Would be great for animal friends...

Talking NPC's are a bit a pain - repating alwas the same and very loud - especialy some officers 😉 

Thank's for makinging the game more fun.


I don't think there is any way to make NPCs avoid spikes. It's baked into the game's pathing algorithms.

It is possible to make NPCs destroy spikes when they walk on them. I'm not sure that's what you want, but if it is, then add the "StompSpikes" property to the "npcMeleeTemplate" entity class in the NPC Core entityclasses.xml file. If you're using XPath, this is the code:

<append xpath="//entity_class[@name='npcMeleeTemplate']">
<property name="StompsSpikes" value="true" />
</append>




If you don't want the rocket launcher NPCs in game, then you can remove them from the entity groups in entitygroups.xml. Note, you'd have to do that for any NPC Packs too. For that reason, a modlet using XPath probably best because it can remove all the rocket launcher NPCs, as long as the modlet is named such that it will load after all of the NPC Packs. This is the XPath to use:

<remove xpath="//entitygroup/entity[contains(@name, 'RocketL') or contains(@extends, 'RocketL')]" />




The issue with bars and fences might have to do with visibility issues. If an NPC can't damage an entity because there is a block in the way which blocks their attack, they behave as if they can't see the entity. (Or at least that's the idea.) Also, NPCs have a view cone, they don't see 360 degrees around them. If they didn't do this, stealth against them would be impossible, they'd run after enemies they can't even reach, etc.

Renaming them is not currently possible. (Maybe next alpha?) For entities that haven't spawned yet, you can re-define the list of names that they can spawn with. They are in the "Names" property of the character's entity class in entityclasses.xml. Each entity has a different list of names, so you'd have to hunt down which one(s) you want to change.

You can change the frequency of NPCs making their random sounds. That is in the "SoundRandomTime" property of the entity's class in entityclasses.xml. The NPC Core template sets the default as 200 seconds (real time). But NPC Pack authors often override this, especially when they use custom sounds, so you might have to hunt down which specific NPC is making the sound you don't like, and modifying that.

Hope this helps!

 
Last edited by a moderator:
I don't think there is any way to make NPCs avoid spikes. It's baked into the game's pathing algorithms.
There is the SmarterEntities property in SCore's config stuff in its blocks.xml. But it is under zombie features so it might apply to all entities, which wouldn't be ideal. I thought NPCs were supposed to avoid them on their own, but maybe not.

 
Hello all, I once tripped over a thread showcasing three "Wandering Merchant" NPC's that were made using NPCMod/SCore.





Was this idea abandoned, or is there any news on its progress for A20 with this ideas development?

I would love to have access to a functional wandering merchant mod.

 
Last edited by a moderator:
I have another question, has anyone experimented with making a 'grenadier' style NPC?

(My brain is screaming for a Raider styled after "The Tick's" mad bomber what bombs at midnight). Randomly throwing out Molotov's, Pipe Bombs, Grenades, Contact Grenades, & maybe a shaped charge when encountering a locked door. W/t a Demo styled explosive vest 😉)

After all what's an Apocalypse without a random "Trashcan Man" setting the world on fire just to watch it burn?

brx-groatman-embcolor.jpg


(image from ArtStation by Brad Groatman, all rights his)

Occasional grenadier utility I'm sure would work nice on static watchtower guards etc...

 
Last edited by a moderator:
It is possible to make NPCs destroy spikes when they walk on them.
After reading this last page of this thread, I realize that a Resident Evil 'Nemesis' T-Type Tyrant inspired "Uber Zed" that stomps spikes while wielding a rocket launcher has become low hanging fruit to those of you who understand the mysteries of modding. I am once again in awe.

Sorry, my enthusiasm has made me hijack the thread with multiposts... hard to contain myself.

 
Last edited by a moderator:
Hello, I seem to be having the same issue as Khlorbolt.  Whenever I speak to a hireable npc the UI for dialogue options is not in frame. When I edit the UI margin in setting the dialogue box seems to enter the frame but its completely chopped in half at the bottom of the screen. I have no other UI mod installed. Is there a fix for this or nay? I tried changing my resolution and other UI options but margin is the only one that seems to move the dialogue box up

 
First, this NPC Mod is incredible, thank you to all the creators. You are amazing.  This has made the game more fun and interesting for so many, myself included.

I’m trying to do my little part with a nearly completed storyline chain of quests (https://community.7daystodie.com/topic/31075-new-storyline-quest-mod-looking-for-feedback/https://community.7daystodie.com/topic/31075-new-storyline-quest-mod-looking-for-feedback/) , and the NPC Mod is perfect to incorporate.  I did have a few questions that are probably simple and easy to those who know, but remain difficult for those like me who are still trying to figure the code out:

1.        How do I spawn a friendly NPC that can be hired near the player?  As perhaps, say a quest Reward?  Like, you kill 25 zombies, and afterwards two hiding survivors emerge from the woods to join you and are suddenly standing a few feet away, ready to be hired. 

Something like <reward type="Item" id="SurvivorSoldier1TRifle" value="2"/>  ?

Or at the beginning of the next quest something like

<action type="SpawnNPC" id="Bob,Brian" value="2" phase="1"/>?

2.       Can you spawn a friendly, hireable NPC into a nearby POI?  Kind of similar coding to the various White River trader “Fetch” quests except instead you are to rescue the NPC (and not a satchel of goods) in the nearby POI?  One could easily see the Final Version of the game having White River Traders dole out “rescue” missions of stranded civilians in POI’s, but I’d like to try and do it myself now.  Has someone already done this?

3.        Is there a way to check that the player has hired an NPC, like an “objective type” that would also fit into quests.xml?  That might be impossible but worth an ask and relates to question #2.

4.       Is there a max number of NPC’s under player control you recommend?  Like under 10 or something?

5.       Is there a way for the game to check how many NPC’s are in an area?  As an “objective type” again?  Let’s say one of the storyline quests is “Find and bring back 10 NPC’s to your base and put them on Stay.”  Once you have rescued 10 NPC’s and put them in your base, you have completed the mission etc.  Or have each NPC disappear as they cross into your base to reduce lag (if having that many NPC’s is a problem). 

6.       Lastly, is there a way (didn't see any in Localization) to change a line of the NPC’s dialogue.  Like, obviously there is a need for the dialogue options to be “Guard” and “Stay” etc, but one that is just “Hi, I’m a survivor like you.  I’m desperate, please take me back to your base.” 

Please if you can help in anyway or steer me in the right direction, thank you!

 
First, this NPC Mod is incredible, thank you to all the creators. You are amazing.  This has made the game more fun and interesting for so many, myself included.

I’m trying to do my little part with a nearly completed storyline chain of quests (https://community.7daystodie.com/topic/31075-new-storyline-quest-mod-looking-for-feedback/https://community.7daystodie.com/topic/31075-new-storyline-quest-mod-looking-for-feedback/) , and the NPC Mod is perfect to incorporate.  I did have a few questions that are probably simple and easy to those who know, but remain difficult for those like me who are still trying to figure the code out:

1.        How do I spawn a friendly NPC that can be hired near the player?  As perhaps, say a quest Reward?  Like, you kill 25 zombies, and afterwards two hiding survivors emerge from the woods to join you and are suddenly standing a few feet away, ready to be hired. 

Something like <reward type="Item" id="SurvivorSoldier1TRifle" value="2"/>  ?

Or at the beginning of the next quest something like

<action type="SpawnNPC" id="Bob,Brian" value="2" phase="1"/>?

2.       Can you spawn a friendly, hireable NPC into a nearby POI?  Kind of similar coding to the various White River trader “Fetch” quests except instead you are to rescue the NPC (and not a satchel of goods) in the nearby POI?  One could easily see the Final Version of the game having White River Traders dole out “rescue” missions of stranded civilians in POI’s, but I’d like to try and do it myself now.  Has someone already done this?

3.        Is there a way to check that the player has hired an NPC, like an “objective type” that would also fit into quests.xml?  That might be impossible but worth an ask and relates to question #2.

4.       Is there a max number of NPC’s under player control you recommend?  Like under 10 or something?

5.       Is there a way for the game to check how many NPC’s are in an area?  As an “objective type” again?  Let’s say one of the storyline quests is “Find and bring back 10 NPC’s to your base and put them on Stay.”  Once you have rescued 10 NPC’s and put them in your base, you have completed the mission etc.  Or have each NPC disappear as they cross into your base to reduce lag (if having that many NPC’s is a problem). 

6.       Lastly, is there a way (didn't see any in Localization) to change a line of the NPC’s dialogue.  Like, obviously there is a need for the dialogue options to be “Guard” and “Stay” etc, but one that is just “Hi, I’m a survivor like you.  I’m desperate, please take me back to your base.” 

Please if you can help in anyway or steer me in the right direction, thank you!
1. can be done, good mod to look at is rebirth by furious ramsay

2. yes, the npcs can be added to sleeper volumes

3. yes, theres a way

4. rebirth mod limits it to 4 depending on your charismatic nature perk

5. you can "pick up" npcs and they are then items

6. yes, you would have to edit their npc and dialog xmls

if it sounds like a lot of xml work, well, thats because it would be, if you want to try and do some of these things but get stumped you can always ask for some assistance on guppys unofficial modding discord

 
Last edited by a moderator:
First, this NPC Mod is incredible, thank you to all the creators. You are amazing.  This has made the game more fun and interesting for so many, myself included.

I’m trying to do my little part with a nearly completed storyline chain of quests (https://community.7daystodie.com/topic/31075-new-storyline-quest-mod-looking-for-feedback/https://community.7daystodie.com/topic/31075-new-storyline-quest-mod-looking-for-feedback/) , and the NPC Mod is perfect to incorporate.  I did have a few questions that are probably simple and easy to those who know, but remain difficult for those like me who are still trying to figure the code out:

1.        How do I spawn a friendly NPC that can be hired near the player?  As perhaps, say a quest Reward?  Like, you kill 25 zombies, and afterwards two hiding survivors emerge from the woods to join you and are suddenly standing a few feet away, ready to be hired. 

Something like <reward type="Item" id="SurvivorSoldier1TRifle" value="2"/>  ?

Or at the beginning of the next quest something like

<action type="SpawnNPC" id="Bob,Brian" value="2" phase="1"/>?

2.       Can you spawn a friendly, hireable NPC into a nearby POI?  Kind of similar coding to the various White River trader “Fetch” quests except instead you are to rescue the NPC (and not a satchel of goods) in the nearby POI?  One could easily see the Final Version of the game having White River Traders dole out “rescue” missions of stranded civilians in POI’s, but I’d like to try and do it myself now.  Has someone already done this?

3.        Is there a way to check that the player has hired an NPC, like an “objective type” that would also fit into quests.xml?  That might be impossible but worth an ask and relates to question #2.

4.       Is there a max number of NPC’s under player control you recommend?  Like under 10 or something?

5.       Is there a way for the game to check how many NPC’s are in an area?  As an “objective type” again?  Let’s say one of the storyline quests is “Find and bring back 10 NPC’s to your base and put them on Stay.”  Once you have rescued 10 NPC’s and put them in your base, you have completed the mission etc.  Or have each NPC disappear as they cross into your base to reduce lag (if having that many NPC’s is a problem). 

6.       Lastly, is there a way (didn't see any in Localization) to change a line of the NPC’s dialogue.  Like, obviously there is a need for the dialogue options to be “Guard” and “Stay” etc, but one that is just “Hi, I’m a survivor like you.  I’m desperate, please take me back to your base.” 

Please if you can help in anyway or steer me in the right direction, thank you!


1. There is a quest reward in SCore called "GiveNPCSDX" which should do the trick:
 

<reward type="GiveNPCSDX, SCore" id="entityGroup" /> <!-- Spawns in an entity from the group to be your NPC -->
<reward type="GiveNPCSDX, SCore" /> <!-- Hires the current NPC -->




2. I don't know if this is possible. I created a very similar quest ("defend Whiteriver") in my "Human faction reputation and quests" modlet, but it is not enabled, because it requires POIs that spawn in Whiteriver NPCs (and have the "whiteriver" tag). That is here:
https://gitlab.com/karlgiesing/7d2d-a20-modlets/-/blob/main/1-khzmusik_Human_Factions_Reputation_Quests/Config/quests.xml#L2338

3. I'm not sure about this one. There is a "HiredSDX" dialog requirement in SCore, but it shows/hides dialog options according to whether the NPC you're talking with is hired by you or not, so I don't think it would work for traders. But here it is if you want to experiment:

<!-- True if the NPC is currently hired by the player -->
<requirement type="HiredSDX, SCore" requirementtype="Hide" />




When you hire an NPC, you also get a cvar that represents that NPC, but you have to know the NPC's entity ID in order to check it. I don't think there's any way to get an NPC's entity ID via XML, so it's probably not useful in this case.

4. Incredibly subjective. :)  I personally go for less than 5, but I know players that want to wage wars and have 20 hired NPCs. Basically, whatever your computer can handle is the upper limit.

5. I suppose you could find some way to keep a cvar of hired NPCs (I haven't researched how but it should be possible). Having them disappear as they enter your base is not currently possible.

6. Look in dialogs.xml in the 0-XNPCCore modlet. You can change the phrases there. But I do agree that they should be translated.

 
thanks too khzmusik, you've given me some serious homework for the week :).   


Welcome to the world of modding.  Be careful as it tends to be addictive.  I started out just wanting to make a small modlet to make some minor changes.  I am now adding custom icons, new items to the game, and overhauling several of the mechanics (at least through xml only right now) to tailor it more to my liking

 
Hello all, I once tripped over a thread showcasing three "Wandering Merchant" NPC's that were made using NPCMod/SCore.





Was this idea abandoned, or is there any news on its progress for A20 with this ideas development?

I would love to have access to a functional wandering merchant mod.
Shamelessly bumping this in the hopes of getting @xyth 's response seeing as it was his project.

 
Is the SmarterEntities property in SCore what allows (both hired & unhired) NPC's to open unlocked Base doors? I was playing solo before I had the tokens to hire anyone and was rather shocked/spooked when a random Joe opened my base door and took an unsanctioned tour. Is this a function Raiders, Whisperers, & Psychos also share?!?

I'd also like to ask if SCore supports 'leadership', IE where you make a 'Boss' and it's minions are tethered to follow the Boss around? Small squads of Soldiers, & groups of Marauders lead by a (slightly) tougher leader would be amazing if possible.

 
Yes @BFT2020, its definitely a fun challenge to mod this game.   Thanks to the community response, like you I've already expanded the mod beyond my original intentions.  

My last big modding project was years ago with Arma 1 (https://www.ofpec.com/missions_depot/index.php?action=details&id=133), a great tactical FPS but not as wide open  world as 7 Days to Die.  However the Mission Editor for the Arma series is arguably easier to learn.  Seems like with 7 Days you need to know a lot more than simple XML (Notepad editing was enough to do tons with Arma).  Like you may need to know some Unity to get more advanced features completed?  For example, I see that the source of audio clips for khzmusik's 1-SoldierPack comes from these types of files pasted below.  Anyway, its obvious a ton of work and TLC went into this NPC Mod, thanks again everyone!!!

image.png

 
Back
Top