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

A19 NPCs DMT Mod

Status
Not open for further replies.
you need to edit them to read this:

<property name="AITarget-1" value="SetAsTargetNearestEnemySDX, Mods" data="class=EntityAlive,80"/>  
            <property name="AITarget-2" value="SetAsTargetIfLeaderAttackedSDX, Mods" data="class=EntityAlive"/> 
            <property name="AITarget-3" value="SetAsTargetNearestEnemySDX, Mods" data="class=EntityAlive,80"/> 
            <property name="AITarget-4" value="SetAsTargetIfHurtSDX, Mods" data="class=EntityAlive"/>


Interesting. I'll have to dig deeper to figure out why that works.

I spent my entire day neck-deep in the C# code, figuring out exactly how this all worked. And from what I can tell, the number ("N") in "AITarget-N" (and also "AITask-N") is the priority. Higher priorities will take precedence over lower priorities.

From comments in the code, the blank task is there to ensure that the unspecified "AITarget-N" properties aren't inherited from the parent XML class.

So, your change is to make the "SetAsTargetIfHurtSDX" task take precedence over the "SetAsTargetNearestEnemySDX" and "SetAsTargetIfLeaderAttackedSDX" tasks. (You also inherited all the "AITarget-N" properties where "N" was higher than 4, but I don't think there are any in the base class, so I don't think that makes a difference.)

At least that's what I think, from looking at the decompiled C# code, but it's not exactly clear. I still have a whole lot to learn about TFP AI, and none of it is exactly straightforward.

 
Sphereii and I both are occupied with other things but plan to get back to working on the NPCs.  If there is a better xml order, please let me know and I will push that change.

 
Sure,head on into the NPC PACK HUMANS folderopen up entity classes.XML with Notepad++

There will be a few instances of the following lines:

<property name="AITarget-1" value=
            <property name="AITarget-2" value=
            <property name="AITarget-3" value=
            <property name="AITarget-4" value=

you need to edit them to read this:

<property name="AITarget-1" value="SetAsTargetNearestEnemySDX, Mods" data="class=EntityAlive,80"/>  
            <property name="AITarget-2" value="SetAsTargetIfLeaderAttackedSDX, Mods" data="class=EntityAlive"/> 
            <property name="AITarget-3" value="SetAsTargetNearestEnemySDX, Mods" data="class=EntityAlive,80"/> 
            <property name="AITarget-4" value="SetAsTargetIfHurtSDX, Mods" data="class=EntityAlive"/>

This essentially makes NPC prioritize setting a nearest target first and attacking,instead of its default behavior which used to read <property name="AITarget-1" value="SetAsTargetIfHurtSDX, Mods" data="class=EntityAlive"/>

Which caused them to need to be attacked first in order to aggro.Problem with this was that NPC aggro was cooling down after a while and they needed top be attacked again in order to become aggro.

Value 3 and 1 are the same and probably do not need to both be there but i find it ensures NPCs will carry out the attack. Xyth can clean it up and tell you how better to impliment it but for now this works


I just tried this again tonight, and unfortunately, it seems to cause an even worse bug. This code breaks commands for hired NPCs, such as the "Follow" command - they simply won't do them after these changes.

At least, that's what I found. Are you still able to hire NPCs and get them to follow you?

 
I just tried this again tonight, and unfortunately, it seems to cause an even worse bug. This code breaks commands for hired NPCs, such as the "Follow" command - they simply won't do them after these changes.

At least, that's what I found. Are you still able to hire NPCs and get them to follow you?
are you up to date with all required mods? mine is working fine.They follow. only issue(not really a bug) is that they dont follow upon reloading a game,u must tell them again to follow.

 
Redarmy45 said:
are you up to date with all required mods? mine is working fine.They follow. only issue(not really a bug) is that they dont follow upon reloading a game,u must tell them again to follow.
I got another bug maybe,when I reload the game my npc act like a zombie. why(´;︵;`)

 
I got another bug maybe,when I reload the game my npc act like a zombie. why(´;︵;`)
He likely got infected and is turning into a zombie.  There is a cure for that which is a rare drop.  That is in the effectspack if you loaded that.

 
I have a quick question. On my single player world the NPCs do fine when I hire them, but on my server they don't stay hired. We have to rehire them every time we log back in. Anyone have any suggestions for a fix? Thanks!

 
I have a quick question. On my single player world the NPCs do fine when I hire them, but on my server they don't stay hired. We have to rehire them every time we log back in. Anyone have any suggestions for a fix? Thanks!
That bug has been reported but seem intermittent.  Its a code issue we have to resolve apparently.

 
That bug has been reported but seem intermittent.  Its a code issue we have to resolve apparently.
I had a very interesting bug. Delta soldier AK ,when teleporting to me when i entered my house,teleported into the basement and transformed into a wolf.

I had him following me,and noticed he didnt follow me into the house,i went to my basement and there was a wolf.Killed it and never saw Delta soldier again. No entry points that a wolf could have come through so it hit me that delta must have turned into the wolf. Hilarious lol

I then remembered you saying NPCs are spawning via animal spawns so kinda makes sense.Something got broke in the matrix

 
Also found another potential bug.Hiting follower NPCs is yielding +2 bluberries after unlocking "living off the land" perk,and then harvesting bluberries(or whatever fruit).

 
Greetings to all. I have a problem installing the mod, I hope some of you know about some solution. Maybe it's some stupid mistake that I didn't notice. In general, I installed everything I need, but an error appears in the launcher. Literally: "The process cannot access the file ........... since this file is being used by another process." Error code "1". And I don't know what to do about it. When you start a normal game after compilation, when loading, the console opens itself, showing all the processes with possible errors

mcvKo2KnLdc.jpg


 
Greetings to all. I have a problem installing the mod, I hope some of you know about some solution. Maybe it's some stupid mistake that I didn't notice. In general, I installed everything I need, but an error appears in the launcher. Literally: "The process cannot access the file ........... since this file is being used by another process." Error code "1". And I don't know what to do about it. When you start a normal game after compilation, when loading, the console opens itself, showing all the processes with possible errors

You are loading the animal and mech NPC packs without also loading the creaturepack animals and mechs.

 
I'm so glad I finally got this working! I've wanted NPCs in 7 days forever. I had a few questions though.

1. Can you equip NPCs with weapons/armor?

2. I am hosting a co op with a friend using the mod launcher. Does my friend need to start with the mod launcher as well, or is having the files and starting vanilla good enough?

3. Is there a way I can change NPCs threat detection? I'd like to try to make them shoot a zombie if it gets close, as of now they only fight back after being hit.

Thanks for all the work on this mod, being able to have them stay at our base or patrol is really cool.

 
Okay, I was happy early. Only the DMT compilation worked. When trying to create a game, there is such an endless download from the console. Any idea why things are breaking down like this?

xccSyLFJc7w.jpg


 
Okay, I was happy early. Only the DMT compilation worked. When trying to create a game, there is such an endless download from the console. Any idea why things are breaking down like this?

Just to report that I'm having the exact same issue.

Up until today, I was using the animals-humans-zombies-effects combo just fine (all installed manually). Then I decided to add the NPC features on top of those. I installed Mod Launcher just for this and used it to get NPC animals/humans, factions and the dependencies.

And yet, when I launch the game using mod launcher, I'm getting a series of red errors.

 
Okay, I got it right. I installed only these mods. But now debugmenu and creative menu are not available to me. Is it treated somehow? And can I somehow spawn the NPC?

3BirlkvZyRE.jpg


 
The mods do not change any rights, so Im not sure what going on.

Just to report that I'm having the exact same issue.

Up until today, I was using the animals-humans-zombies-effects combo just fine (all installed manually). Then I decided to add the NPC features on top of those. I installed Mod Launcher just for this and used it to get NPC animals/humans, factions and the dependencies.

And yet, when I launch the game using mod launcher, I'm getting a series of red errors.
Without a link yo your log files its impossible to know what went wrong.

 
Status
Not open for further replies.
Back
Top