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

NPCMod and Addons

Sorry for the incredible amounts of questions! one of the final few!
I've changed it so that raiders are friendly and soldiers are hostile yet... I can't remove the pront to 'talk' from the soldiers. And i can't add the prompt to add 'talking' to bandits.
I've figured out how to lower the amount of spawns via the groups file. Changing .1 to .03 making them per town pretty much 'less'.


There are different templates for NPC Core characters. The ones that are usually used are "basic" and "advanced." "Basic" characters can't be hired, and thus have less complicated AI. "Advanced" characters can be hired.

To switch from one to the other, you can choose what template the NPC extends. This is done in the pack's entityclasses.xml file. For example, if you want to make "npcSoldierGBDAxe" not hirable, change the value of the "extends" attribute from "npcAdvancedAxeTemplate" to "npcAxeTemplate".

There are other ways, but that's probably the easiest.

Also, if you're changing the spawn numbers anyway, you might as well make them a bit more balanced. For example, if you're in the forest biome, you might have a .03 probability of running across a guy with an axe, but a .01 chance of running across one with a tactical rifle; and if you're in the wasteland, it would be the other way around.

EDIT: This double posted for some reason. No idea why. Sorry about that.

 
Last edited by a moderator:
not sure how to search the topic for this, but how does one change the spawn chance of npc so that are very rare to non existent?

 
not sure how to search the topic for this, but how does one change the spawn chance of npc so that are very rare to non existent?


If you go to the entitygroups.xml file for each NPC pack, you will see the XML that adds that pack's entities to entity groups. The numbers represent probabilities. Lower those numbers and NPCs have a lower probability to spawn.

 
If you go to the entitygroups.xml file for each NPC pack, you will see the XML that adds that pack's entities to entity groups. The numbers represent probabilities. Lower those numbers and NPCs have a lower probability to spawn.
Looking in that file there is like 5,800 lines there. Do I have to individually change all of them?

 
I don't know exactly which Add On Packs you installed @Kogg but the Darkstardragon ones were uploaded again recently, as their spawning rates were using an old testing file by mistake. The update calms things down a lot but can be further decreased if needed. The file with over 5800 lines is for 0-XNPCCore. This isn't the one you need to be looking at. The ones to check have a 1- in front of them such as 1-NPCXSpiderPack and 1-DarksRaiderz.

 
There are different templates for NPC Core characters. The ones that are usually used are "basic" and "advanced." "Basic" characters can't be hired, and thus have less complicated AI. "Advanced" characters can be hired.

To switch from one to the other, you can choose what template the NPC extends. This is done in the pack's entityclasses.xml file. For example, if you want to make "npcSoldierGBDAxe" not hirable, change the value of the "extends" attribute from "npcAdvancedAxeTemplate" to "npcAxeTemplate".

There are other ways, but that's probably the easiest.

Also, if you're changing the spawn numbers anyway, you might as well make them a bit more balanced. For example, if you're in the forest biome, you might have a .03 probability of running across a guy with an axe, but a .01 chance of running across one with a tactical rifle; and if you're in the wasteland, it would be the other way around.

EDIT: This double posted for some reason. No idea why. Sorry about that.
Once again, sorry for writing so much!
I kind of had the right idea in that case by moving the code from the bandit over to the soldiers like: <property name="AIPackages" value="NPCModCoreNoChat, NPCModHostileMeleeBasic, NPCModHostileRangedBasic"/> In the command line. Sadly that doesn't do much. Although. the loot code line does work! so thats nice.

Although, this explaination actually helps a sh*t ton! Thanks, i haven't really checked the template tutorials, and hoped it was easy. Now the National Guardsmen are entirely 'non-interactable' and the bandits are! Cheers!

Ps: Yeah i was thinking on balancing the spawns because its crazy how often i keep running into rocket dudes and/or m60's. Since i'm going to use this for a server. I might as well pull through all of the code to balance the spawns. (This was a quite nice confidence boost to know that i can somewhat read code after all!)

Thanks!

Looking in that file there is like 5,800 lines there. Do I have to individually change all of them?
Check the image, the last number aka ".03" (These are my own values i made.) Are the spawn chances. If you change them to .03 like i did, they'll spawn less. Increase the number such as .05 or .09 will increase it. .1 they're pretty common. But hell. I'm changing them to .02 and .01 to make them awfully rare.

Example.PNG

 
the largest difference in the hostile AI packages vs. the basic ones is an added AI task to hostile where the AI will move to your last know position and search for you.  Its not like horde night GPS where they know your current location, rather its the last location they saw or heard you at.   There is also a breakblock task that is commented out as I'm still working on that.

 
Last edited by a moderator:
Looking in that file there is like 5,800 lines there. Do I have to individually change all of them?


As Arramus said, you need to change this in whatever NPC Packs you have installed. At this point those are mostly from Darkstar Dragon. His packs use the same probabilities for all biome spawning, so you can just do a search-and-replace using a text editor.

The NPC Core characters spawning (Nurse, Baker, and Harley) spawn at much lower rates than Darkstar Dragon's NPCs, so they might not be a problem. But if they are - then you only need to change the probabilities for the biome spawn groups.

There are a lot of groups that are used only for sleeper volumes in NPC POIs - those start at line 126 (as of this writing). You don't need to do anything with those. (DD's packs don't spawn into those volumes, for whatever reason, so you don't have to worry about it with his packs.)

 
Last edited by a moderator:
As Arramus said, you need to change this in whatever NPC Packs you have installed. At this point those are mostly from Darkstar Dragon. His packs use the same probabilities for all biome spawning, so you can just do a search-and-replace using a text editor.

The NPC Core characters spawning (Nurse, Baker, and Harley) spawn at much lower rates than Darkstar Dragon's NPCs, so they might not be a problem. But if they are - then you only need to change the probabilities for the biome spawn groups.

There are a lot of groups that are used only for sleeper volumes in NPC POIs - those start at line 126 (as of this writing). You don't need to do anything with those. (DD's packs don't spawn into those volumes, for whatever reason, so you don't have to worry about it with his packs.)
Yes, replace all for changing values is the quickest and easiest way to bulk edit the spawning Kogg.

 
Last edited by a moderator:
hello guys because no one did answered to my question so here you go 
 

What question?  Looks like you added tracking tags to NPC bandits.  Not tagging them isnt a bug, just a choice we made.

The mod has issues on A21.1 dedi.  Please do not use this mod on dedi unless you are running A21.0 until we can fix the bugs.

 
xyth in npc what you made is missing code so i just add own piece of code + navobject lets say i override your code with my own code.

by the way I run NPC on A21.1b6 as single player and i did not see any issue with them like for now.

 
Last edited by a moderator:
xyth in npc what you made is missing code so i just add own piece of code + navobject lets say i override your code with my own code.

by the way I run NPC on A21.1b6 as single player and i did not see any issue with them like for now.
Overriding the mods code is what we want folks to do.  Well done.   This mod runs fine on experimental 21.1 in single player mode, just not on the dedicated server yet.   That might have to wait for 21.1 stable 

 
Please publish a list of files, after downloading which, there would be only unfriendly NPCs!
Preferably with a firearm!
Saved!

 
One thing that's always confounded me is why do the npc randomly change the direction they were told to stand when a horde night starts.

Anyone have any ideas?

 
One thing that's always confounded me is why do the npc randomly change the direction they were told to stand when a horde night starts.

Anyone have any ideas?
If they're constantly looking at you instead of shooting at zeds, it's because you're too close to them. I learned that the hard way. Stick them outside your base on a ledge or or in a room above or below you where you can't see them or they're far enough away and that'll solve the problem.

Maybe there's a way for the modders to program them to prioritize looking at zeds over the player or stay focused in the correct general direction and ignore the player during horde nights.

 
Last edited by a moderator:
If they're constantly looking at you instead of shooting at zeds, it's because you're too close to them. I learned that the hard way. Stick them outside your base on a ledge or or in a room above or below you where you can't see them or they're far enough away and that'll solve the problem.

Maybe there's a way for the modders to program them to prioritize looking at zeds over the player or stay focused in the correct general direction and ignore the player during horde nights.
I have them in a separate area so my proximity doesn't cause them to turn but the min the clock hits 22:00 on a horde night they shift direction. Something about horde night causes the shift.

At first i thought they maybe defaulting to pointing north but this is not the case as i pointed them north before horde night and they still shift.

It looks like the horde spawning cause them to random shift.

 
I have them in a separate area so my proximity doesn't cause them to turn but the min the clock hits 22:00 on a horde night they shift direction. Something about horde night causes the shift.

At first i thought they maybe defaulting to pointing north but this is not the case as i pointed them north before horde night and they still shift.

It looks like the horde spawning cause them to random shift.
Oh, interesting, I never got that issue.

 
Hi xyth or any modder. It's been a while since Ive commented, but just a quick question (after this);

I'm still playing A-20.7 the latest for A-20, and haven't upgraded yet, because I have a few family members who don't like to change and/or don't play much but when they do they prefer to stay on old version.😂. So I kept the old "Mod file" (this NPC Mod) when I first installed it. Don't get me wrong, I enjoy it so far(except the accuracy of the raiders mod, but that gives me a little challenge).

Anyway, sorry if this sounds like a dumb question:

Will this current mod version still work with A-20.7, or only compatible with A-21 now? 

waiting on anyones reply.

 
Will this current mod version still work with A-20.7, or only compatible with A-21 now? 

waiting on anyones reply.


This version will only work with A21. Too much has changed in TFP code for them to be compatible.

But the A20 version is still around, and should work perfectly fine on A20.7:
https://github.com/7D2D/A20Mods

If you liked my A20 packs, they're still around too:

https://gitlab.com/karlgiesing/7d2d-a20-modlets

If you don't want to update to A21, then sticking with those is your best bet.

 
  • Like
Reactions: Fox
Back
Top