Jump to content

Mod help


Recommended Posts

Your mod would possibly work if the entityclasses.xml file you include was copied/overwrite the original file in the config folder. That's not a good way to create a mod, especially if you are just making some small changes. What you want to do is use xpath statements that modify the games config files at runtime. For example, I wrote a mod in the past that changed the time it takes for loot bags to despawn (this may not work anymore, just an example). My entire entityclasses.xml file contains

 

<config>
    <!-- Zombie Loot bag drops last 40 minutes (40*60seconds)-->
    <set xpath="/entity_classes/entity_class[starts-with(@name,'EntityLootContainer')]/property[@name='TimeStayAfterDeath']/@value">2400</set>
</config>

 

and that's it. That's saying to find specific entity_class items and change the value of the TimeStayAfterDeath property to 2400.

 

There is a topic on xpath explained in the tutorial section. I've also found this wiki page helpful https://7daystodie.fandom.com/wiki/XPath_Explained

 

I'd suggest reading through those and then downloading some more mods and seeing how things are done.

Link to comment
Share on other sites

Ooo dear. Got into a bit of a pickle.

 

Mods will add things or change things to those original in game Config folder xmls and they need to be written up in a different way. We can pinpoint the exact nodes we want to change or use broad sweeping rules to cover everything. In this case you are attempting to do 2 things:

 

1. Increase the loot drop bags to 50%.

2. Increase the stay time for loot drop bags to 99999.

 

Here are a couple of pointers.

 

ModInfo.xml

<?xml version="1.0" encoding="UTF-8" ?>
<xml>
    <Name value="ZbagDropIncrease" />
    <DisplayName value="Zbag Drop chance" />
    <Description value="Increases drop chance to around 50/50 chance, and extends duration of bag in the game world." />
    <Author value="Jeffreylane" />
    <Version value="1.1.0.0" />
    <Website value="https://www.nexusmods.com/7daystodie/mods/4982" />
</xml>

 

entityclasses.xml
 

<configs>

<set xpath="/entity_classes/entity_class[contains(@name, 'zombie')]/property[contains(@name, 'LootDropProb')]/@value">.5</set>

</configs>

 

As for the loot drop bags, 99999 has the potential to cause a heap of performance issues during a Horde Night. With 50% of eliminations converting to bags, there will be a loot mountain and player performance will degrade. A party on a server will come screaming... ^^

 

Default TimeStayAfterDeath for zombie bags remains at 1200 seconds for V1.0. That is already 20 minutes with a Horde Night event on a 60 minute day cycle being 15 minutes. Those loot bags will still remain and create a mountain. Good luck with finding the balance for that.

 

An example of how that is governed in Preppocalypse, but with 120 day cycles in mind, and with default loot drop percentages.

    <!-- Zombie Loot Bag Time Stay Extensions -->
    <set xpath="/entity_classes/entity_class[@name='EntityLootContainerRegular']/property[@name='TimeStayAfterDeath']/@value">2000</set> <!-- Default is 1200 secs (20 mins) and good for 60 min cycle at (15 min BM) but not 90 (22 min 30 sec BM) -->
    <set xpath="/entity_classes/entity_class[@name='EntityLootContainerStrong']/property[@name='TimeStayAfterDeath']/@value">2000</set> <!-- Provides a 3 min 20 sec buffer for 120 min cycle -->
    <set xpath="/entity_classes/entity_class[@name='EntityLootContainerBoss']/property[@name='TimeStayAfterDeath']/@value">2000</set>

 

Spherii, Xyth, and a number of other community members have shared guides and tutorials on how to get modding. It is how I learned, and continue to learn.

https://community.7daystodie.com/forum/39-tutorials-guides/

The ModInfo.xml and XpathModding Explanation Thread will assist.

Once you feel a little more familiar with modding, visit the thread for the Unnofficial Modding Discord and join the Guppy's Discord.

spacer.png

Link to comment
Share on other sites

Ah yes. The whole of A21 was a constant cycle of approval requirements, third party checks, and a bit of a delay process. My last few weeks have been instant and after a year or so, maybe I have been given a higher grade of approval based on frequency and content. I really don't know. I understand the reason for it as spam bots were a constant thorn in A20. The response was extreme but such is I suppose.

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