Jump to content

NPCMod - A Community Project


xyth

Recommended Posts

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

Link to comment
Share on other sites

 

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!

Link to comment
Share on other sites

15 hours ago, work22 said:

 

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

 

Edited by drkstardragon (see edit history)
Link to comment
Share on other sites

On 1/29/2023 at 4:15 PM, work22 said:

 

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.

Link to comment
Share on other sites

29 minutes ago, work22 said:

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

Link to comment
Share on other sites

On 1/22/2023 at 9:36 PM, smithsguild said:

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.afe811daf96e89b93ebea014d388acd9.png

 

 

Link to comment
Share on other sites

6 hours ago, smithsguild said:

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.

 

I'm pretty sure the "SmarterEntities" property is an attempt to have NPCs avoid traps. I don't think SphereII ever got that to work.

 

I'm fairly certain the thing that allows them to open doors is the "HumanTags" property, under "AdvancedNPCFeatures". If an entity has any one of the tags listed there, then it's considered "human" and (I believe) can open doors. But being "human" allows a lot of other behavior too, so I don't think that should be messed with.

 

It should apply to any NPCs, as far as I know, since all of them have the "npc" tag (at least) and that's always been a "human" tag.

 

If you don't like it, then you can always lock your doors. :) 

 

The notion of "leadership" has been talked about for quite a while (since at least A18, probably earlier). But there are a lot of technical challenges, for example with spawning "squads" from entity groups, and I don't think anyone got it even close to working.

Link to comment
Share on other sites

We did wandering traders and they worked great in a17 but there was something causing them not to work properly so it hasnt been updated. Yes, keep your doors locked with npc mod installed and watch your back at the traders lol. Leadership was attempted in a17 didnt really work properly, although you could designate one the leader and the others would follow them around, and defend them if they were attacked.

Link to comment
Share on other sites

Cool, Thank you both! For the prompt informative responses AND your wonderful NPCMod contributions. They have certainly raised the bar for my wife's and my own gaming experience with 7d2d.

 

On 2/1/2023 at 9:35 PM, khzmusik said:

If you don't like it, then you can always lock your doors. :)

 

Actually I do lock them after the scare, & it has increased my immersion immeasurably!

 

Would it be a workable 'thing' to give a Zed that same human trait and make a "Hawking" (ZL2-dbl tap reference AKA smart zombie) that strolls up opens your unlocked door and begins rooting for your liver?

Edited by smithsguild
(incomplete thought , avoid multiposting) (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...