Jump to content

NPCMod and Addons


xyth

Recommended Posts

Minor update to the NPCCOre.  It just edits xml so vanilla entities will fight back when hurt by EntityEnemySDX NPCs.  Few if any modders will be impacted by this change, and it is save game safe.  Also refreshed the SCore.zip found in my repo.

Link to comment
Share on other sites

How can I reuse an asset from a previous mod?

 

ie.  Myzombiemod1  has the assets

      Myzombiemod2  is a separate optional mod but it needs to reuse the assets from the first.

 

I assume I need to change the model path, but I don't know what to.   #@modfolder  isnt working for me.

Link to comment
Share on other sites

5 hours ago, Josephz said:

How can I reuse an asset from a previous mod?

 

ie.  Myzombiemod1  has the assets

      Myzombiemod2  is a separate optional mod but it needs to reuse the assets from the first.

 

I assume I need to change the model path, but I don't know what to.   #@modfolder  isnt working for me.

 

I don't know if this still works in A20, but in A19 you could use this format:

 

#@modfolder(OTHER MOD NAME):Resources/UNITY_FILENAME.unity3d?UNITY_PREFAB_NAME

 

So for example, if you wanted to use the Harley asset from the NPC Core mod, you could reference it like so:

 

#@modfolder(0-XNPCCore):Resources/XythNPCs.unity3d?Quinn_X

 

However - if you want to re-use the assets from one entity to another, you should probably just extend that entity. The "Mesh" property already extends, so you wouldn't need to provide it later. (AFAIK the "Tags" property is the only one that doesn't extend and must be provided... but there might be other properties that I don't know about.)

 

For an example of this, see how the NPC Core "npcHarleyBMEmptyHand" entity extends the "npcHarleyEmptyHand" entity. 

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

1 hour ago, khzmusik said:

 

I don't know if this still works in A20, but in A19 you could use this format:

 

#@modfolder(OTHER MOD NAME):Resources/UNITY_FILENAME.unity3d?UNITY_PREFAB_NAME

 

So for example, if you wanted to use the Harley asset from the NPC Core mod, you could reference it like so:

 

#@modfolder(0-XNPCCore):Resources/XythNPCs.unity3d?Quinn_X

 

However - if you want to re-use the assets from one entity to another, you should probably just extend that entity. The "Mesh" property already extends, so you wouldn't need to provide it later. (AFAIK the "Tags" property is the only one that doesn't extend and must be provided... but there might be other properties that I don't know about.)

 

For an example of this, see how the NPC Core "npcHarleyBMEmptyHand" entity extends the "npcHarleyEmptyHand" entity. 

 Thanks so much ! this worked great.  Just want to clarify that "mod name" is not the same as the name of the folder the mod is in.

Link to comment
Share on other sites

I currently have 2 7DTD series I am working on, both of which have the NPCs & all enemies on. I want to start a series that's a little different though. In this one I only want NPCs, no zombies & such. More of a situation where let's say the zombies have died off & the only threats left are the people & of course hunger & such. Is there a way to have the NPCs spawn with zombies turned off? Thanks!

Link to comment
Share on other sites

2 hours ago, MandyCMoore said:

I currently have 2 7DTD series I am working on, both of which have the NPCs & all enemies on. I want to start a series that's a little different though. In this one I only want NPCs, no zombies & such. More of a situation where let's say the zombies have died off & the only threats left are the people & of course hunger & such. Is there a way to have the NPCs spawn with zombies turned off? Thanks!

 

It can be done, but it is a long process. If you're not interested in learning how to create your own modlet, and spending a couple of days (or more) to create it, then the rest of this post probably won't interest you.

 

It's basically a two step process:

  1. Spawn human NPCs into all the entity groups used for zombies
  2. Remove the zombies from those same entity groups

But there are a number of catches.

 

The first issue is hordes (blood moon hordes, wandering hordes). The horde spawner can only spawn entities that descend from the C# EntityEnemy class. If you try to spawn other entities, the game will spam red errors in the console and nothing will spawn.

 

There are templates in NPC Core which use a custom SCore C# class that descends from EntityEnemy. But most NPC Pack authors don't use them, because that class lacks all but the most basic features. To my knowledge, my Whisperers and Rogues and Psychos packs are the only ones that do use those templates. So you would need to put only those entities into the entity groups used for hordes.

 

This doesn't apply to the entity groups used to spawn entities into biomes, nor to the entity groups used to spawn entities into POIs. All of those should be able to support all NPCs.

 

I don't know if this applies to "scout" spawn groups - the ones that spawn entities in response to a screamer. And that brings us to the next catch. If you want to get rid of screamers, I think that you can replace the screamer entity in the "zombieScreamer", "zombieScreamerFeral", and "zombieScreamerRadiated" entity groups with this:

<entity name="none" />

 

But I haven't tried it myself. It's possible that screamers are hard-coded to spawn when the heat map reaches a certain point. (Hopefully not but I don't know.)

 

The next issue is balance. If you just add in NPCs without any probabilities, things will be completely unbalanced. You want to spawn tougher NPCs with probabilities that increase with gamestage, and weaker NPCs with probabilities that decrease with gamestage.

 

There are a number of ways you could do this:

  • Match NPCs to vanilla zombies in terms of "difficulty," then insert the NPCs after those zombies at the same probability level (so, target probabilities containing "0.1", probabilities containing "0.2", etc.) and remove the zombies afterwards.
  • Look in my NPC packs, and copy what is there for entity groups used to spawn NPCs into NPC POIs ("npcBanditsAll", etc). For other packs I would recommend my "Progression" series of modlets (since the ones in the other NPC packs aren't gamestaged). But there are only six group stages used in NPC POIs, and vanilla uses a lot more than that (e.g. blood moons use over 300 gamestaged entity groups).
  • In each of my NPC packs (and also the "Progression" modlets), there is a "Scripts" directory, containing JavaScript files that I used to populate the entity groups. If you know how to code, you could modify those to automatically generate other entity group lists. (If you need help feel free to PM me.)

...Like I said, it is not easy. But if you still want to do it, I hope this helps.

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

3 hours ago, khzmusik said:

 

It can be done, but it is a long process. If you're not interested in learning how to create your own modlet, and spending a couple of days (or more) to create it, then the rest of this post probably won't interest you.

 

It's basically a two step process:

  1. Spawn human NPCs into all the entity groups used for zombies
  2. Remove the zombies from those same entity groups

But there are a number of catches.

 

The first issue is hordes (blood moon hordes, wandering hordes). The horde spawner can only spawn entities that descend from the C# EntityEnemy class. If you try to spawn other entities, the game will spam red errors in the console and nothing will spawn.

 

There are templates in NPC Core which use a custom SCore C# class that descends from EntityEnemy. But most NPC Pack authors don't use them, because that class lacks all but the most basic features. To my knowledge, my Whisperers and Rogues and Psychos packs are the only ones that do use those templates. So you would need to put only those entities into the entity groups used for hordes.

 

This doesn't apply to the entity groups used to spawn entities into biomes, nor to the entity groups used to spawn entities into POIs. All of those should be able to support all NPCs.

 

I don't know if this applies to "scout" spawn groups - the ones that spawn entities in response to a screamer. And that brings us to the next catch. If you want to get rid of screamers, I think that you can replace the screamer entity in the "zombieScreamer", "zombieScreamerFeral", and "zombieScreamerRadiated" entity groups with this:

<entity name="none" />

 

But I haven't tried it myself. It's possible that screamers are hard-coded to spawn when the heat map reaches a certain point. (Hopefully not but I don't know.)

 

The next issue is balance. If you just add in NPCs without any probabilities, things will be completely unbalanced. You want to spawn tougher NPCs with probabilities that increase with gamestage, and weaker NPCs with probabilities that decrease with gamestage.

 

There are a number of ways you could do this:

  • Match NPCs to vanilla zombies in terms of "difficulty," then insert the NPCs after those zombies at the same probability level (so, target probabilities containing "0.1", probabilities containing "0.2", etc.) and remove the zombies afterwards.
  • Look in my NPC packs, and copy what is there for entity groups used to spawn NPCs into NPC POIs ("npcBanditsAll", etc). For other packs I would recommend my "Progression" series of modlets (since the ones in the other NPC packs aren't gamestaged). But there are only six group stages used in NPC POIs, and vanilla uses a lot more than that (e.g. blood moons use over 300 gamestaged entity groups).
  • In each of my NPC packs (and also the "Progression" modlets), there is a "Scripts" directory, containing JavaScript files that I used to populate the entity groups. If you know how to code, you could modify those to automatically generate other entity group lists. (If you need help feel free to PM me.)

...Like I said, it is not easy. But if you still want to do it, I hope this helps.

I would love to do this. Some of it seems a little confusing right now, but that could be because I haven't had any sleep. Lol. I will sit down & go through this after a nap, & I am definitely going to give it a try. I may have questions, but I swear, I will try to keep them to a minimum. I am excited to try this. Thank you!!!

3 minutes ago, Guppycur said:

You can also just make "evil" copies for the bloodmoons, or find a way to disable them entirely.  That way, it appears the npc's turn viscous during the horde night.

Oh, I like that idea! Thank you!. I intended to do this for my own personal use, but I wonder if anyone else might be interested in trying the game this way. Well, first things first, have to make the modlet. Thank you so much!

Link to comment
Share on other sites

1 hour ago, Guppycur said:

You can also just make "evil" copies for the bloodmoons, or find a way to disable them entirely.  That way, it appears the npc's turn viscous during the horde night.

 

They don't even need to be "evil." "EntityEnemy" is just the name of the C# class, the entities themselves could be of any faction.

 

For example, let's say you want to have versions of Darkstar Dragon's SoldierPack that can spawn into wandering hordes. You can create a new entity that extends the "basic" SoldierPack entity, but use the SCore "EntityEnemySDX" class. Like so:

<entity_class name="survivorBMSoldier1RocketL" extends="survivorSoldier1RocketL">
    <!-- Tags don't extend, but everything else should -->
    <property name="Tags" value="UMA2,entity,male,npc,ranged" />
    <property name="Class" value="EntityEnemySDX, SCore" />
</entity_class>

 

If you're doing this with an "advanced" NPC (like the nurse) then you'll also need to change the entity class to not use any of the advanced features:

<entity_class name="npcBMNurseClub" extends="npcNurseClub">
    <!-- Tags don't extend, but everything else should -->
    <property name="Tags" value="entity,female,npc,melee,cp,DRMid" />
    <property name="Class" value="EntityEnemySDX, SCore" />
    <!-- "Advanced" features to turn off -->
    <property name="Hirable" value="false" />
    <property name="LootListAlive" value="" />
    <property name="NPCID" value="" />
    <!-- The second AI package is determined by weapon type - see line 4240 in NPC Core entityclasses.xml -->
    <property name="AIPackages" value="NPCModBasicMeleeNoChat, NPCModNPCMeleeBasic" />
</entity_class>

 

I might have missed a couple properties, but you get the general idea. Those new entities will still be of the same faction, so they won't be hostile to players, but they'll still spawn into hordes.

 

Of course... you can also make them "evil." :)  Just set their "Faction" property to "bandits" (or another hostile faction like "whisperers" - or even "undead"). Those factions are in npc.xml - "bandits" and "undead" are vanilla factions, "whisperers" is from NPC Core.

 

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

having some issues....ive gotten multiple different models implementing into my 7dtd using the tutorial and the videos on youtube....but im not getting any footstep sounds on any of my custom zombies. the script puts the footsteps as a child of hips intead of origin...but ive tried moving and and leaving it with same result....anyone have any idea? 

 

can upload xmls or whatever if anyone wants to look

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

  • 2 weeks later...
1 hour ago, Guppycur said:

Change the faction of the horse to one that the NPCs don't attack?

 

This is indeed the issue, but it is caused by NPC Core.

 

Telric's horses extend "animalTemplateHostile". In vanilla, that template uses the "animals" faction, which has a "neutral" relationship to everything (including the player). However, NPC Core changes the faction of "animalTemplateHostile" to the NPC Core faction "aggressiveanimalsmedium", and that has a "hate" relationship with all non-animals except traders (including the player).

 

When your NPCs are hired, they use your faction rather than their own. So they look at the horse's faction, see that it is hostile to their leader (you), and attack it. (They should attack if not hired as well, since all human factions have a "hate" relationship with "aggressiveanimalsmedium" too.)

 

If you want to make the horses once again use the vanilla "animals" faction, add this XML to the horse entity classes:

<property name="Faction" value="animals"/>

 

You could also use one of the NPC Core animal factions, probably "passiveanimalslarge".

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

Hi! First of all, thank you for this marvelous project!
Can you help me with a problem? I want to change the inventory capacity for the NCP hired. I modified the xml entity_classes adding the "BagSize" passive propriety, but nothing changed... What do you recommend me to do?
Thank you for your time ^^

Link to comment
Share on other sites

Hello i mixed many quest and trader mods together to overhaul the trader, missions etc. All of the mods im using currently seems stable and working well together but i have a small problem with npc mod. I dont like the new smx ''NPC Dialog Windows'' and its not compatible with trader mods i currently have. Once i remove ''XUi'' folder from the ''0_XNPCCore'' the broken trader dialogue window is working normally. But i cant hire friendly npcs anymore. The hire option dont pop up anymore since i removed the ''XUi''. 

For short im asking is it possible to remove the new dialog windows and use the vanilla ui, but also able to hire the npcs normally ?

 

I have many so many mods but only trader related are; Traders have More Quest aka ''AdventureQuest''.,SimulQuests, No Repeat Pois.

Those mods are imcompatible with npc mods new dialogue window. As i said removing the XUi fixes the trader menus but i cant hire the friendly npcs anymore.

Link to comment
Share on other sites

59 minutes ago, Paixetamour said:

Hopefully i will get an reply to my comment up there soon. I have been waiting to countine my playthrough.

 

You need to create a patch modlet to get all the mods to work together correctly (from what you described).  Removing the XUI folder from the mod broke the mod, which is why you can't hire friendly NPCs anymore.

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