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

NPCMod and Addons

Found a strange bug, upgrades on weapons given to NPCs disappear after loading the game, but this does not always happen. I accidentally noticed this bug, it appeared 2 times in about 25 launches of the game. I do not know under what conditions this happens. In the console log there is only one mention of weapons, I attach a screenshot. Game version 1.2 (b27), mod version (0-SCore-1.2.61.2007).

92e68fe3e44ba62eb7544ff616bbaa59.jpg


I'm not sure if this message is related to a bug. Maybe there is some way to break upgrades on weapons I don't know about. If it helps, I have 2 saves, one with upgrades and one with missing upgrades.

 
Last edited by a moderator:
Found a strange bug, upgrades on weapons given to NPCs disappear after loading the game, but this does not always happen.


When you say "weapons given to NPCs," do you mean that you put the weapon in their backpack, or that you have the NPCs wield the weapon?

Also, did you pick up the NPCs while they had the weapons?

There were some issues when NPCs were picked up and put into players' backpacks, and some mod authors didn't want players to have the ability to put NPCs into storage containers. Changes were made to SCore to handle those issues, but I don't remember which version(s) have those changes. It's possible you might have to update the game and SCore. I don't know that for sure though.

 
When you say "weapons given to NPCs," do you mean that you put the weapon in their backpack, or that you have the NPCs wield the weapon?

Also, did you pick up the NPCs while they had the weapons?

There were some issues when NPCs were picked up and put into players' backpacks, and some mod authors didn't want players to have the ability to put NPCs into storage containers. Changes were made to SCore to handle those issues, but I don't remember which version(s) have those changes. It's possible you might have to update the game and SCore. I don't know that for sure though.


Yes, I created an NPC with empty hands. Then I inserted upgrades into the weapon and put this weapon into the NPC's inventory. Using the menu, I told the NPC to use this weapon. I checked your words by removing the NPC into the player's inventory. Yes, after this manipulation, the weapon in the NPC's inventory loses upgrades.

 
Yes, I created an NPC with empty hands. Then I inserted upgrades into the weapon and put this weapon into the NPC's inventory. Using the menu, I told the NPC to use this weapon. I checked your words by removing the NPC into the player's inventory. Yes, after this manipulation, the weapon in the NPC's inventory loses upgrades.
By upgrades, do you mean mods attached to the weapon? If so, that is a known issue. I mentioned it to sphereii a while back but not sure what his plan was. May need to bring it up again with 2.0 on the horizon.

 
By upgrades, do you mean mods attached to the weapon? If so, that is a known issue. I mentioned it to sphereii a while back but not sure what his plan was. May need to bring it up again with 2.0 on the horizon.
Yes, modifications to increase damage and durability of weapons, etc.

 
I've dug through over half of all the posts regarding this mod and I have not found any that has dealt with the problem of using weapons outside the vanilla V1.0, for example the EFT Overhaul Mod/Modpack. https://7daystodiemods.com/escape-from-tarkov-overhaul/ just to be specific. I understand how to add custom weapons is by editing the XML, however I do not know how or where to do so.
I have gotten the NPC mod to work, with SCore, and am able to play with no errors from console or game crashes. I have also been able to change the casino coins to Roubles thanks to an earlier post I found, and Notepad++. I would really appreciate any help with this.
Do note I have 0 modding experience.

 
I've dug through over half of all the posts regarding this mod and I have not found any that has dealt with the problem of using weapons outside the vanilla V1.0


That's because non-vanilla weapons are not supported, and getting them to work at all requires a lot of work.

Keep these things in mind:

  • The weapons that NPCs wield are not vanilla weapons, they're "bespoke" weapons made for NPCs, and they need XML entries to tell SCore what their "equivalent" vanilla weapons are.
  • NPCs do not use the player animations or controller. Xyth has manually taken some of the player animations and modified them so they can be used by NPCs. But this is a time-consuming and manual process.
  • Every weapon (vanilla or otherwise) requires the NPC character author to manually adjust every single supported weapon. Xyth's Unity tutorial project has examples of the supported weapons, but each pack author has to adjust them by hand. And since every character is different, there are some characters who simply cannot wield all weapons. (They have skeletons with different bone lengths and that doesn't work with some of the weapon animations.)
    This is the reason that most NPC pack characters do not wield all weapons that are supported by NPC Core.



If you want custom weapons to be supported, then you will have to implement all of this yourself. And since you aren't the author of most of the characters you're using, you can't really do that without trampling the rights of all authors of the NPC packs that you want to use.

 
Last edited by a moderator:
That's because non-vanilla weapons are not supported, and getting them to work at all requires a lot of work.

Keep these things in mind:

  • The weapons that NPCs wield are not vanilla weapons, they're "bespoke" weapons made for NPCs, and they need XML entries to tell SCore what their "equivalent" vanilla weapons are.
  • NPCs do not use the player animations or controller. Xyth has manually taken some of the player animations and modified them so they can be used by NPCs. But this is a time-consuming and manual process.
  • Every weapon (vanilla or otherwise) requires the NPC character author to manually adjust every single supported weapon. Xyth's Unity tutorial project has examples of the supported weapons, but each pack author has to adjust them by hand. And since every character is different, there are some characters who simply cannot wield all weapons. (They have skeletons with different bone lengths and that doesn't work with some of the weapon animations.)
    This is the reason that most NPC pack characters do not wield all weapons that are supported by NPC Core.



If you want custom weapons to be supported, then you will have to implement all of this yourself. And since you aren't the author of most of the characters you're using, you can't really do that without trampling the rights of all authors of the NPC packs that you want to use.
Oh. Fair enough.
Next question is I vaguely remember seeing a post regarding ranged NPCs charging into melee. So far I've only seen the Pipe shotgun wielders use this as those have been the only ones I could find. Is there a way I can fix this or is this an issue that this modpack author has to look into/the other modpack authors have to look into?

 
Oh. Fair enough.
Next question is I vaguely remember seeing a post regarding ranged NPCs charging into melee. So far I've only seen the Pipe shotgun wielders use this as those have been the only ones I could find. Is there a way I can fix this or is this an issue that this modpack author has to look into/the other modpack authors have to look into?


What is supposed to happen is that ranged NPCs will back up (or move forward) until they are within the weapon's range. But sometimes that isn't possible, or the NPC gets "stun locked" by a zombie attacking them, and at that point they will switch to using the ranged weapon as a melee weapon (they hit their target with the butt of their gun).

It's what I've always observed, although it's not perfect.

If you're seeing something else, then maybe the UAI has been modified somehow. (UAI = "Utility AI," and it determines NPC behavior; it's not the same system that vanilla uses for zombies.) It's possible an overhaul did this? I'm not sure.

If you've observed this with any of my NPCs then let me know. I actually use different UAI - it's based on NPC Core, but it adds new AI behavior, like writhing in pain when set on fire, or crouching if alerted, or going to the nearest ally when spawned into wandering hordes. Maybe I screwed something up?

 
What is supposed to happen is that ranged NPCs will back up (or move forward) until they are within the weapon's range. But sometimes that isn't possible, or the NPC gets "stun locked" by a zombie attacking them, and at that point they will switch to using the ranged weapon as a melee weapon (they hit their target with the butt of their gun).

It's what I've always observed, although it's not perfect.

If you're seeing something else, then maybe the UAI has been modified somehow. (UAI = "Utility AI," and it determines NPC behavior; it's not the same system that vanilla uses for zombies.) It's possible an overhaul did this? I'm not sure.

If you've observed this with any of my NPCs then let me know. I actually use different UAI - it's based on NPC Core, but it adds new AI behavior, like writhing in pain when set on fire, or crouching if alerted, or going to the nearest ally when spawned into wandering hordes. Maybe I screwed something up?
Testing in a creative world results in all NPCs with guns charging into melee. I am only using the base NPCs, DarksSoldiers and Prepperz, and khzmusik's NPC civilians. I am also only using the EFT Overhaul modpack along these mods.
 

 
Last edited by a moderator:
Why are my friendly NPC’s ignoring all commands and only wandering? Extremely infuriating. Does this mod only work on game version 1.3?

 
Why are my friendly NPC’s ignoring all commands and only wandering? Extremely infuriating. Does this mod only work on game version 1.3?


I have never seen this happen on any version.

What are the versions you are using (vanilla, NPC Core, SCore, NPC Packs)? Did you install the mods into an existing game? Were there any errors in the console, and if so, can you provide the complete logs via Pastebin?

 
Sorry, I just realized I forgot to announce this here.

I have updated my Rogues and Psychos packs to version 1. These were developed on 1.3 but were tested with 1.0 and work in both those versions, so they should be safe for any 1.x version.

Unlike previous alphas, they are separated into two separate packs. (Many people seemed to want either one of the other, and they have different features, so it just makes sense.)

Details in my forum thread:







Also - I want to re-iterate that players should start a new game after installing NPC Core. There are a lot of issues if you don't do this, but the most obvious one is that certain enemies can't damage players (or vice versa). If you install NPC Core, always start a new game. (I have fielded a lot of questions from players who don't do this, so want to repeat it as often as I can.)

 
Hello friend, I'm trying to use the GenericNPC dialog template in dialogs.xml from XPNCCore to create new options for implementing a new outfit change feature. I attempted to add the options into it, and the game didn't report any errors when loading the dialogs. However, I don't know why the new options I added aren't appearing in the game. Here's the code I added:

    <dialog id="dressnpc1" startstatementid="start">
      <statement id="start" text="GenericNPC_start" ref_text="Hello friend, how can I help you?">
        <response_entry id="Hire" ref_text="I am interested in hiring you." />
        <response_entry id="Command Menu" ref_text="Command Menu" />
        <response_entry id="Weapon Menu" ref_text="Weapon Menu" />
        <response_entry id="Outfit Menu" ref_text="Change outfit" />
        <response_entry id="Admin Menu" ref_text="Admin Menu" />
        <response_entry id="Pickup" ref_text="Pick Me up!" />
        <response_entry id="ShowMe" ref_text="Show Me your inventory" />
        <response_entry id="done" ref_text="Nevermind." />
      </statement>

      <statement id="Outfit Menu"  ref_text="Change outfit:">
        <response_entry id="Toggledress1" ref_text="Outfit1" />
        <response_entry id="Toggledress2" ref_text="Outfit2" />
        <response_entry id="done" ref_text="Nevermind."/>
      </statement>

      <response id="Toggledress1"  ref_text="Outfit11">
        <requirement type="Leader, SCore" requirementtype="Hide" />
        <action type="AddBuffSDX, SCoref" id="buffdress1mauk1" value="Self" />
      </response>
      <response id="Toggledress2"  ref_text="Outfit2">
        <requirement type="Leader, SCore" requirementtype="Hide" />
        <action type="AddBuffSDX, SCore" id="buffdress2mauk1" value="Self" />
      </response>

 
Back
Top