Jump to content

khzmusik

Members
  • Posts

    1,247
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by khzmusik

  1. I meant to reply to your original topic, but by the time I double-checked my answers, it was days later. I thought it was probably moot at that point but I was obviously wrong.

     

    The short answer is that it can't be done.

     

    Here's the long answer. The textures that you can paint onto blocks (including terrain blocks) are not individual textures. They are part of a single texture array. (Think "CSS sprites" in web design.) The block only stores the index in the texture array. The texture array can't be made any larger, because the block's data bits are already full, and TFP can't spare another bit for a larger array index.

     

    Additionally, the way terrain works, it wouldn't be possible for the game to tell when one block "blends" with another. (At least not from what I've been able to dig up in the code, which is admittedly very little.)

     

    Also, the paint brush (even in dev mode) doesn't allow all textures to be painted, and in particular, the terrain block textures are not allowed. I'm not sure why. I suspect it's related to an issue that is notorious among POI builders: if you paint a block with a texture that is the "native" texture of a craft-able block (say, painting a wood block the same texture as concrete), then performance drops dramatically.

     

    If you were allowed to use terrain textures, then I'd recommend just using a regular trim block with the asphalt texture, but unfortunately that's not an option.

     

    There is another option, which is to use a single non-square block (like a ramp) on the boundary of the terrain, and maxing out its density by selecting it and hitting <shift>-<up arrow>. The block itself couldn't have a terrain texture, but you can put it next to any terrain block you want, including an asphalt terrain block. TFP have used this technique to make things like sidewalks that blend into the streets.

  2. 20 hours ago, Iceburg71 said:

    that may need to be local.  I am not sure...  But that doesn't make sense.  I will test it and see what I can see...

     

     

    I just checked. The case of your localization filename does not match the game's case. It should be "Localization.txt", and yours is "localization.txt".

     

    This will work OK on Windows (since file and folder names are not case sensitive on Windows), but not on any other operating system. So if the dedicated server is Linux, it won't pick up that file. (Nor will it work on Mac, but I don't know how many Mac players there are.)

  3. I am glad you got it to work. But, from your screenshots, you are using one or more mods.

     

    Vanilla (non-modded) 7D2D is different from that mod:

    • Players can not loot the bodies of zombies. (Zombies drop loot bags, players can only loot those.)
    • There is no loot container with the ID of 281.
    • There are no pistol barrels, grips, parts, or receivers.

    Since you didn't tell us you are using a mod, none of us had any way to know about those differences.

     

    In the future, you need to tell people those details when you ask for help. Otherwise you will only confuse people, and get advice that won't help you.

  4. 13 hours ago, LastTugBoat243 said:

    I tried the code but its saying that the xml patch did not applyimage.thumb.png.e60af82089c2ac86ee10b45be1d72770.png

     

    In the vanilla game, there is no loot group called "zombieSoldier".

     

    In vanilla, the entity that is dropped when a zombie dies, is determined by its "LootDropEntityClass" property in its entity class (in entityclasses.xml). That is in the "zombieTemplateMale" entity and is inherited by other zombies. Unless the individual zombie entity class overrides it, it will be the "EntityLootContainerRegular" entity.

     

    That is the case for most soldier zombies. The exception is radiated soldier zombies, and that is overridden so they drop "EntityLootContainerStrong" loot bag entities.

     

    Those loot container entities, in turn, use different loot containers, as determined by their "LootListOnDeath" values. "EntityLootContainerRegular" uses the "zPackReg" loot container. "EntityLootContainerStrong" uses the "zPackStrong" loot container.

     

    The "zPackReg" loot container uses the "groupZpackReg" loot group, and the "zPackStrong" loot container uses the "groupZpackStrong" loot group.

     

    So if you want to make soldier zombies - and only soldier zombies - drop gun parts, you will need to do this:

    1. In loot.xml, create a new loot group for soldier zombies (or loot groups plural, if you want to follow the vanilla game and have radiated zombies drop better loot)
    2. In loot.xml, create new loot container(s) that uses the new loot group(s)
    3. In entityclasses.xml, create a new loot container entity (or entities) that uses that new loot container
    4. In entityclasses.xml, make the soldiers drop the entity container(s) by overriding or replacing the value of the soldier zombies' "LootDropEntityClass" properties

    Good luck!

  5. 13 hours ago, t1slam said:

    That seems to be straightforward. Can i change what type of zombie spawns as that sleeper? I mean it's strength relative to current game stage? To make essentially a miniboss.

     

    Sorry! I forgot to answer this.

     

    In the prefab editor, you can choose the spawn group for each sleeper volume. There are a couple that could be used for boss volumes, such as "Group Zom Badass Only"; and there are also spawn groups that only spawn one specific zombie, like "zombie Biker Radiated".

     

    If those aren't good enough for you, it's possible to create your own - I did this for the NPC Core sleeper volumes that spawn NPCs. But it's complicated, and the vanilla spawn groups are probably good enough, so I won't go into details.

     

    (There is also a setting called "Boss Volume" but as far as anyone can determine, it does nothing. It's probably either left over from a previous alpha, or supports some planned feature in a future alpha.)

  6. 11 hours ago, BFT2020 said:

     

    No, I think what khzmusik meant was that if you set only one sleep volume in the POI as the quest objective, the yellow dot will only show up for them (and probably would show up right away).  All of the other zombies in the POI would be treated the same way as a wandering hoard that showed up - you might have to kill them just to get around them, but they wouldn't affect when the quest dot appears.  So basically, the second part of your question (icon appear immediately).

     

    Yes, that's what I meant. It would behave as if you had already cleared all the sleepers from the other sleeper volumes (even though you didn't). As far as the "clear" quest objective is concerned, those other sleeper volumes don't exist.

     

    Keep in mind I haven't tested this myself. I have done POIs where one or two sleeper volumes are excluded, and that's how those POIs behave. I have not tried it where all sleeper volumes except one are excluded.

     

    57 minutes ago, a_jp said:

    (translation)
    I am very interested in this proposal.
    If this works server side
    looks like a lot of fun

    khzmusik,
    "Possible with control at the POI level"
    I think that's the answer.
    And it is possible.
    It just changes the sleeper spawn of existing POIs.

    However, in this method, when a trader proposes
    I don't understand the change.

    I thought about writing this far.

    name the POI
    "Company 01. Defeat only the boss."
    and in the POI details
    ・Excludes quests other than bosses
    ShowQuestClearCount" value set to 1

    if,
    "Destroy only specific zombies"
    I think it will be a quest.

     

    This will not work server-side, because it requires replacing all the POIs. Custom POIs require both client and server installation.

     

    Please keep in mind that my proposal changes the POIs themselves, not the quests. It would be exactly the same "clear" quest as usual.

     

    Unfortunately, it is impossible to create a new kind of quest. For quests that target POIs, they map to the values that you can put into the POI's "QuestTags" property in the XML. The only working values are "clear", "fetch", "restore_power", and "trader" (which is used with the "white river citizen" and "opening trade routes" quests). Those values are hard-coded by TFP.

     

    So it's impossible to have one kind of "clear" quest that only targets POIs with one non-excluded sleeper volume, and another kind of "clear" quest that only targets POIs with multiple non-excluded sleeper volumes. The quest objective will choose POIs that have a "QuestTag" value of "clear" and that is all it will do.

     

    There is another way to target POIs, but it requires a custom quest objective that I wrote which is in SCore. It's called "RandomTaggedPOIGotoSDX", and it can allow you to target POIs with certain values in its "Tags" property (which is not the same as the "QuestTags" property, and can accept custom values).

     

    I mainly wrote it for going to POIs containing human NPCs, but you could use it to include POIs with any tag you want.

     

    If you want to do this, then you should make a modlet. Here are the steps you need to take:

     

    1. Create one or more POIs, or modify vanilla POIs, as I suggested in my first post (only one sleeper volume that isn't excluded, spawns only one entity). These would be put in your modlet's "Prefabs\POIs" directory.

     

    2. Choose a custom tag name for those POIs, like "clearboss" or whatever.

     

    3. Add that tag name to the "Tags" property (not the "QuestTags" property!) in the XML files for those POIs.

     

    4. Create a new quest type that will target only those POIs. It is probably easiest to copy and modify the vanilla "clear" quest.

     

    5. I the new quest type, use the "RandomTaggedPOIGotoSDX" objective as a replacement for the vanilla "RandomPOIGoto" objective, and add the "include_tags" property like so:

    <objective type="RandomTaggedPOIGotoSDX, SCore">
        <property name="phase" value="1" />
        <property name="nav_object" value="quest" />
        <!-- Only include POIs with these tags -->
        <property name="include_tags" value="clearboss" />
    </objective>

     

    6. To make sure the vanilla quests don't go to these POIs, replace the vanilla "clear" quest's "RandomPOIGoto" objective, and add the "exclude_tags" property. This is the XPath to add to your modlet:
     

    <append xpath="//objective[@type='RandomPOIGoto']">
        <property name="exclude_tags" value="clearboss" />
    </append>
    <set xpath="//objective[@type='RandomPOIGoto']/@type">RandomTaggedPOIGotoSDX, SCore</set>

     

    7. When distributing your modlet, make sure your users know it is dependent upon SCore, and that they will need to download and install it separately. Also make sure users know that SCore and your modlet will need to be installed on both clients and servers.

     

    It seems like a lot of work, and it is. I'll leave you to decide if it's worth it.

     

  7. 1 hour ago, Xanderoth said:

    Figured out why my logs werent working - the data folder decides its read only sometimes. changed the log to another file and grabbed one for you to review. I also removed tons of the NPEs as the file was too big for pastebin. 

    https://pastebin.com/BF0D8WXL

     

    @bdubyah is correct. The first error in the log is saying it can't find the SCore ClockDMT class. That was added in version 20.6.259.937, and you're still running version 20.6.229.1021. Because of that, it can't load in blocks.xml. Then it can't load any of the other XML files that reference blocks in blocks.xml, like items.xml, recipes.xml...

  8. On 11/13/2022 at 2:28 PM, t1slam said:

    I think most people would agree with me that "Clear" missions and their variations are low key annoying - mostly because there is a way better mission type - "Fetch" - that allows player to decide the level of engagement with location on their own.

     

    I'm not sure most people would agree. What you call "deciding the level of engagement," other players might call "cheesing the POI."

     

    But regardless - there isn't a way to mod in exactly what you want, but I think you can come close. Unfortunately it involves modifying all the POIs that support clear quests.

     

    If you open a POI in the prefab editor, you can select each of the sleeper volumes. There will be a "Quest Exclude" option for each. If that sleeper volume shouldn't be part of a clear quest, then select "Yes".

     

    You could use this feature to exclude all sleeper volumes, except one. You then set the non-excluded sleeper volume to spawn one zombie, and that zombie becomes the one that you have to kill.

     

    You will probably need to set the "ShowQuestClearCount" value to 1 in the prefab's XML file (if it's not already set to 1).

     

    You would have to do this by hand for all POIs too, 7D2D doesn't support XPath for prefab XML files like it does for Config files.

     

    I believe the game will still have the same user experience as a normal clear quest - so that zombie (and only that zombie) will show up as a yellow icon until you activate the sleeper volume, then it will turn to a red dot.

  9. 12 hours ago, Zockaholic said:

    <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Material']" name="value">Mbook</setattribute>
    <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Weight']" name="value">100</setattribute>

     

    These XPath commands are probably not applying.

     

    The "setattribute" command is to add a new attribute to an XML tag, when that attribute isn't already there. The "value" attribute already exists on those property tags.

     

    You should be using the "set" command to change the value of the "value" attribute:

    <set xpath="/items/item[@name='schematicMaster']/property[@name='Material']/@value">Mbook</set>
    <set xpath="/items/item[@name='schematicMaster']/property[@name='Weight']/@value">100</set>

     

  10. 20 hours ago, paul cornwall said:

    im pretty sure there was a mod with a girl scout zombie a few years ago and im pretty sure valmod had a character like michael myers in aplha 15 i think

     

    For some reason when you said "kids" I was thinking "infants." I think teenagers, or nearly-teenagers, are OK.

     

    I do remember seeing a girl scout zombie. It's still around in the Joke Mod. I think it was originally part of Guppy's zombie pack? Or maybe it's a Unity character that they both bought? Not sure. But he does have a zombie teenage girl character (Alma I think?) with black hair, similar to but legally distinct from the Ring girl.

     

     

  11. The brief answer is no, and the reason why is that they would be unlawful.

     

    I highly doubt that the IP holders of Halloween or Friday the 13th sell models of their characters, which would mean any character models would be unlawful rips from other games. Even if the mod authors got the models from someone else, distributing those models would also be unlawful, so the mod authors could also be sued. (This almost happened - a 7D2D mod author got what they believed was a character "inspired by" a Dead By Daylight character, and in fact it was just a rip from the game. They received a notice from the DBD developers and had to remove it from their mod.)

     

    As for zombie kids, TFP themselves have said they can't put child zombies in the game because that could get them in legal trouble in certain jurisdictions (mainly Europe I think). That means in general there aren't any zombie child models out there, even original models. I also think mod authors believe it isn't worth the legal risk. (Teenagers might be an option, don't know.) I personally would like to see them too (loved the first episode of Z Nation) but I don't think it will happen.

  12. On 11/6/2022 at 2:09 PM, RAGE PVE said:

    Atm I have ammo all working nicely, the test weapons I place inside the same ammo file work in game perfectly but when I delete the test weapons and apply the buffammo to the items that are already in their own mods they don't pick the ammo up, does the ammo mod need to load before the weapons one or is there some pointing from the weapons mod to the ammo mod required or suchlike?

     

    I'm not sure I understand what you're asking. Are you saying that you have a mod that has the test weapons and your ammo; but it doesn't work with a different mod that adds new weapons?

     

    If that's the case, then you should keep some things in mind:

     

    1. All mods/modlets load alphabetically according to folder name. So a mod in a folder named "MyMod" will load after "AMod" but before "SomeMod".
    2. There is no way for one mod to tell if another is loaded.

    If you want your ammo to work with another mod's weapons, then you'll need to decide if you want the weapon mod to be a requirement for your ammo mod.

     

    If so, the convention is to name your mod the same as the other, but add a descriptive suffix. So if the other mod is name "AwesomeWeapons" then you could name your mod 'AwesomeWeapons_AwesomeAmmo". You should also make it very, very clear to your users that the weapon mod is required. (There will be a good chance that they will ignore you, install it anyway without the other mod, then complain in these forums. :) )

     

    If not, then you'll have no way to know if users have installed the weapon mod. Either you'll have to target the other mod's weapons anyway - which, if the user has not installed the other mod, will fail with console warnings about XPath not applying. Or you won't target the other mod's weapons, in which case either the other mod author or users themselves will have to make the other mod work with yours.

     

    Make sense?

  13. 7 hours ago, RAGE PVE said:

    Originally I added that code into the item file of the mod and renamed the buff name so that we had a new buff (perhaps should have been in buffs file) then I could edit the duration but I found the buff wouldn't fire so I scrapped that idea.  With it being a different name I assumed it would just add to the buffs file and use the same cvar but then I could change the duration and there would be no issues. 

     

    I think there is some knowledge that you're missing about how XML and XPath work in the game. Maybe you know this and I misread what you wrote, but just to make sure, here's how it works.

     

    The game scans the "Mods/[mod name]/Config" directories for XML files with names that exactly match the game's XML file names (the ones in the game's "Data/Config" directory). Most operating systems (basically everything other than Windows) are case sensitive with folder and file names, so it's best to match the game's case.

     

    If such a file is found, the game reads that XML file for XPath operations. The initial "/" in XPath translates to "the root node of the game's matching XML file." So you can't put "/buffs" in your modlet's items.xml file and expect it to work; the game's items.xml file doesn't have a "buffs" tag, so that XPath won't match anything. You won't mess up anything, the game simply won't perform that XPath command, and you'll get a yellow warning in the console.

     

    Also, I hope you already know this, but you can't put XPath commands in the game's XML files (the ones in "Data/Config"). XPath is only supported in the "Mods/[mod name]/Config" directories. Trying to put XPath in the game's XML files will mess things up; you'll almost certainly get red errors in the console, and it's possible the game won't even start.

     

    7 hours ago, RAGE PVE said:

    One of the reasons to reduce was the user would get hit also if he missed a shot.  In the end however I managed to use onSelfAttackedOther in triggered effect which  stopped the user setting on fire on a miss; I am still curious on how to go about it but at least can move forward without for now. 

    Also someone mentioned !entitytagcompare would also stop it hitting other players (if it does so already haven't tested that)

     

    You probably want to use "onSelfDamagedOther" rather than "onSelfAttackedOther".

     

    Since that should only be triggered when you damage another entity, you probably won't need to compare tags. If other players are immune from damage, then the effect shouldn't trigger; but if they're not immune from damage (if the server allows friendly fire, for example), then you probably want the effect to trigger.

     

    7 hours ago, RAGE PVE said:

    Next questions are:

    How to make this craftable in a workstation
    Can sound effects be added when buff ammo is used?

    And lastly, I would really like to make a sniper ammo, basically it has 3 rounds, the first one is normal, second one is shock/stun (if there is a good stun buff?) ammo, third one is another normal round but this time it carries a x5 multiplier if a player scores a headshot whilst it hits an entity that has been hit with the shock buff, is that possible?

     

    To make it craftable at all, you'll need to create a recipe for it, and put that recipe into recipes.xml. To make it require the workbench, add craft_area="workbench" and tags="workbenchCrafting" to the recipe tag's attributes.

     

    If you want the player to not know the recipe immediately, you'll need to add "learnable" to the tags. You'll then have to figure out how you want them to learn it. If you want them to learn it through a schematic, then you'll need to add that schematic as an item in items.xml, and you'll need to add that item to loot groups in loot.xml. If you want the recipe to be unlocked by a perk, then you'll need to add or modify that perk's "RecipeTagUnlocked" property; perks are in progression.xml.

     

    For the sound effects, I assume you mean a different sound when the gun is fired with this ammo? If so, I don't know of any way to do that. I'm pretty sure the sounds are tied to the weapon, not the ammo. (You can, of course, trigger sounds when the buff fires, but if you're using vanilla fire/shock buffs then they probably are doing that already.)

     

    For the last question, you could use a cvar that increments every time the gun is fired, and if it's greater than 2 it resets to 0 (so the values are 0, 1, and 2). The ammo buff would have three different triggered effects, each with a requirement that the cvar matches (so it triggers the shock buff if the cvar is 1 and a "headshot" buff if the cvar is 2; it wouldn't trigger anything if the cvar is 0). Make sure you also remove the previous buff each time you fire.

     

    For a headshot buff, use the "DamageModifier" value of "head". See the comments in buffs.xml for details.

     

    To make sure only the sniper rifle can use it, add the ammo to only the sniper rifle's "Magazine_items" property it items.xml.

     

    EDIT: I forgot to add - if there is anything that is displayed to the user (like a recipe name or description) then you should add the text to the Localization.txt file. There is a thread in the tutorials section about how to do that.

  14. 7 hours ago, RAGE PVE said:

    Thanks @khzmusik for directing me here.

    If I want to have a buff but want to specify the duration is the best way to do something like this below?  I want it specific to particular weapons basically.  Not sure if that append code there is correct

    Would I need to type something like:
    <append xpath="/buffs">
    <buff name="buffBurningZombie" hidden="true">
            <damage_type value="heat"/>
            <stack_type value="ignore"/><duration value="0.1"/>
            <effect_group>
                <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="10"/>
                <triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBurningElement"/>
            </effect_group>
        </buff>
     

     

    I'm assuming you're not putting that, verbatim, into your own modlet's buffs.xml file, and that this is an example to get the general idea of what you want to do.

     

    In your example, the buffBurningElement's duration is set by the buffBurningElementDuration cvar. That cvar is set to 10 before the buff is applied.

     

    In general, if you are using a buff to add another buff, you should be able to first set whatever cvar that it uses for its duration (or any other effect that is determined by a cvar). But, make sure you look at the other buff, because it almost certainly modifies that cvar itself, and it might change that cvar to something you don't want after it starts.

     

    In this example, the buffBurningElement buff automatically sets the buffBurningElementDuration to 10 when it starts, if it's below that value. So you couldn't make it a shorter duration than 10. It also will set the cvar to 10 (not add 10) when the buff stacks.

     

    Also, that is not the only way (and probably not even the most common way) that buff durations are set. It's often a combination of stack_type and duration values. Using a cvar does allow for more control, which is probably why TFP use it here. For details on that, the comments at the end of buffs.xml are your friends.

     

    EDIT: Here's a helpful hint. You can use the "</>" button to add code to posts. It makes the code much easier to read. Here's your code formatted as XML by the forums:

    <append xpath="/buffs">
    <buff name="buffBurningZombie" hidden="true">
            <damage_type value="heat"/>
            <stack_type value="ignore"/><duration value="0.1"/>
            <effect_group>
                <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="10"/>
                <triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBurningElement"/>
            </effect_group>
        </buff>

     

  15. 1 hour ago, faatal said:

     

    Basically 0% chance at this point. I'm putting my efforts towards must-fixes, before we even start the MF list. Also various features that are not quite done, and code changes to support balancing changes as people who are play testing discover issues.

     

    That's a pity. I know lots of people are looking forward to NPCs being in the game.

     

    Out of curiosity, is the in-progress bandit code going to be shipped with the alpha, just disabled/unused? Or is all the work in a feature branch that won't even get merged into the A21 branch?

     

    I'm asking on behalf of modders who may or may not be myself. :) 

  16. 2 hours ago, AssasinMartin said:

    Hello, I wanted to notify that the /0-SCore link appears to be down

     

    The link itself works for me, but the DownGit website wouldn't actually download the files. It looks like GitHub has some kind of rate limiting and is returning an HTTP 403 to the DownGit website.

     

    As a workaround, you can download SphereII's entire repository as a .zip file:
    https://github.com/SphereII/SphereII.Mods/archive/refs/heads/master.zip

     

    You will need to extract it, and move only the "0-SCore" folder to your "Mods" folder.

  17. First, this should be moved to "Discussions and Requests." (See the big red "Posting in the Mod Forum" banner at the top of the page.)

     

    Second, "I ran into some problems and the game wouldn't load in" is incredibly vague. Is there a log file you can show us? Red errors in the console?

     

    Because there are a huge number of moving parts (buffs, ammo items, recipes) it will probably take quite a lot of effort for others on the forums to figure out what is even intended, much less what is going wrong.

  18. On 10/29/2022 at 1:45 AM, magejosh said:

    One thing i noticed was I had too many npc's of different factions spawning in the POI i was testing. I'm assuming i'd need to alter the sleeper groups used in the POI to pick one faction for the POI to get that problem resolved right?

     

    Glad you like it. I didn't even think about the fantasy enemies (like goblins), though thinking about it, it's no surprise they use the same "blood moon" NPC templates.

     

    For the different factions spawning into the POI, there are actually two things to consider: 1) what sleeper volumes the POI designer used, and 2) which NPCs are set to spawn into them in the various NPC Packs.

     

    Here's what I suspect is happening. In NPC Core, there are a couple "generic" enemy gamestage groups (they're called "Group NPC Enemy" in the UI). They're meant to spawn any NPC that is an enemy of the player, so if the NPC pack contains non-friendly NPCs, it will (correctly) add the NPCs to those groups.

     

    However, just because the NPCs are enemies of the player, does not mean they are friendly to each other. Bandits, Whisperers, fantasy, and mechs all hate anyone in a different faction and will attack the others.

     

    If I'm right, then my advice is to make the POI specific to just one faction, just as you suggested. If it's not your POI, and you're just testing it, then maybe that's not possible.

     

    There are other options. You can modify which entities spawn into the relevant entity groups (in entitygroups.xml). Or, if you want all enemies to be enemies only of the player and not each other, you could modify the faction relationships so they are "neutral" to each other (in npc.xml). Or, you could just make them all the same faction, like "bandits" or something (in the various NPC packs' entityclasses.xml files).

     

    On 10/30/2022 at 5:30 AM, Ganeshakw said:

    Now since you have made so many changes to these entities, what is the actual in game behaviour changes these characters show ? I am not talking about hiring the NPCs.

     

    I assume you are asking about the recent changes I contributed to SCore? Those relate to the SCore "EntityEnemySDX" C# class.

     

    For a bit of explanation, most NPCs use the SCore "EntityAliveSDX" C# class. That class is actually a subclass of the vanilla trader C# class - the code to talk to NPCs is in the trader, as is code to give quests, and a few other features needed by NPCs.

     

    That class is well-developed, well-tested, and kind of the "official" class to use. Most NPC packs use that class even for their "basic" characters, ones you can't talk to.

     

    But, entities of that class can't be spawned into hordes - neither wandering hordes nor blood moon hordes. Anything spawned by the vanilla game's horde spawner system must use a C# class that descends from the vanilla "EntityEnemy" class, which (unsurprisingly) traders do not. (You also can't spawn vanilla non-enemy animals for the same reason.)

     

    That's what "EntityEnemySDX" is for - specifically to spawn into hordes. But since it's designed for entities that only do that, it has far fewer features, and it's far less tested.

     

    I started using that class for my "basic" Whisperers, since I specifically wanted them to show up in wandering hordes. It worked OK so I also used that class for my "basic" Rogues and Psychos bandits.

     

    It's only when I started spawning them into sleeper volumes that I saw problems.

     

    First, they didn't have the code to obey the different rules about waking them up in different sleeper volumes. Those are the rules that I modify in my "Variable NPC Sleepers" modlet so that NPCs don't always wake up fully aware as soon as they're spawned into a sleeper volume. (The different behavior is in SCore, I basically just change a couple of feature flags in XML.)

     

    Next, they didn't have the code to obey commands (which makes sense because they can't be talked with, so players can't give them commands). POI designers often use SCore "PathingCube" blocks to give commands to NPCs, mainly to make sentries stay in place.

     

    SphereII was kind enough to let me submit code that fixes these issues. Those are the changes I did recently.

     

    Unless you're asking, just in general, about how NPC AI works in A20 vs. how it worked in A19?

     

    If so that's a huge topic. For starters, A20 NPCs use Utility AI (UAI), but in A19, they used the same Entity AI (EAI) used in vanilla. The limitations of EAI are what prompted Xyth and SphereII to switch to UAI, which was already in the game but in an unfinished state.

     

    If you want to read about UAI, then I took notes as I learned about it:

    https://gitlab.com/karlgiesing/7d2d-a20-modlets/-/blob/main/Notes/UtilityAINotes.md

     

    I also contributed "Filters" which can filter out which entities are considered for packages or actions, and make UAI much more efficient (otherwise your average computer would struggle with more than a couple NPCs at a time).

     

    Once you understand all that, then you can look at the XML in then NPC Core utilityai.xml file, and you should be able to understand how it all works.

     

    Hope that's helpful.

  19. Apologies, I meant to talk about this days ago, but I got distracted by other things.

     

    For any of my NPC Pack enemies (Whisperers, Rogues, or Psychos) I supplied "basic" and "advanced" versions. The "advanced" versions can be interacted with, hired if your standing with their faction is good enough, etc. The "basic" versions don't have those options, but can be spawned into hordes (blood moon hordes or wandering hordes).

     

    Both versions can be spawned into sleeper volumes without errors, but since I assumed most people wanted basic versions, the "basic" versions are the ones that spawned. But POI designers don't just use sleeper volumes, they also use SCore "PathingCube" blocks that can make the NPCs stay at their position (for e.g. ranged NPCs acting as sentries).

     

    The "basic" NPCs did not obey those blocks... until now. I contributed changes to SCore so that even the "basic" NPCs can obey orders given by the SCore "PathingCube" blocks.

     

    If you are a POI designer, or even someone who downloaded NPC POIs,  and want all NPCs to obey those blocks, you will need a recent version of SCore, There should be no issues with upgrading, other than the changes I mentioned SCore should have the same behavior it always had.

     

    I know this is kind of a niche interest at this stage, but I wanted to let everyone know. Thanks for listening. 

  20. 18 hours ago, Riamus said:

    I just wanted to be sure if there was anything needed when manually adding it to a map.

     

    This is just FYI. I thought maybe there was an issue with prefabs that are placed into the map by hand, rather than placed during RWG. But I looked in the code, and as long as you placed it using the standard "place" button in the world editor, then there should be no issue.

     

    Also: This should really be moved to the "Discussions and Requests" forum.

  21. EDIT: If you are happy to just kill them, there's a much easier way. Just go into god mode and spawn in enough zombies to kill the NPCs. Afterwards just issue a "killall" command to kill the zombies.

     

    My original response:

     

    I don't know much about servers. Can you safely change "PlayerKillingMode" in serverconfig.xml once a game has started? I imagine you'd need to restart the server, but I don't know how it would affect the game save, if at all.

     

    If so, you could set it to "kill everyone" (value 3), then kill their NPCs, then set it back to what it was.

     

    Obviously you want to do this when nobody else is on the server, and you'll want to enter god mode to kill the NPCs without dying from their attacks.

×
×
  • Create New...