Jump to content

I Need Help Making a Modlet


Recommended Posts

I have edited two of my game's xml files, specifically the entitygroups.xml and the gamestages.xml so that the bloodmoon hordes would be way bigger and harder with the spawns. The easy way to think about it is like how they were if you played Alpha 18 on insane difficulty as I have replaced the default 1.2x difficulty mulitplier with 2.5x. Also I pretty much just copy and pasted the zombie spawns from Alpha 18 and put them into the Alpha 20 entitygroups.xml EXCEPT I had to replace the cheerleader and the cowboy with the lumberjack and mutated zombie because the cheerleader and cowboy would throw me console errors since they are no longer in the game. What I need help with is turning this into an actual modlet. Like can I tell the game to use these modified xml's instead of the default ones or something like that? It's probably more involved than that I would think and I have watched some videos on xml mods however I haven't seen one trying to do something like this. 

 

I am pretty new to this kind of thing and I asked the modding Discord for help with not a lot of success but I figured since so many people have been able to help me with my problems here lately then I'd give posting here a go. 

 

I'd very much like for other people to be able to play with these settings because the hordes have just become so easy in Alpha 19/ 20 that the Horde is not really a threat anymore. Like you are 10x more likely to die while looting then on Horde Night so I wanted to change this. I know that it probably has to do with performance reasons that the hordes were nerfed but I don't see anything changing for the hordes or optimization in regards to Alpha 21 so I want to keep at this. 

 

Can anyone help me make this a mod? I can't attach my xmls here so I'll just paste bin them. Also the entitygroupsxml is too big to paste the entire thing so I just put the part that I modified. https://pastebin.com/rqDsf5Kk          https://pastebin.com/AyhK26yQ

Link to comment
Share on other sites

as my reference
en-zombie
It's a different way of doing things.

modified for myself
Only the ferrule hoard part
Copy

 

The GS numbers refer to the default ~,
GS23 and below are not made,
Created in the same way up to GS726

 

entitygroups.xml

 

<append xpath="/entitygroups/entitygroup[@name='feralHordeStageGS23']"><entity name="a-zombieyo" prob="1.5"/><entity name="a-zombieyo2" prob="1.5"/><entity name="a-zombieyo3" prob="1.5"/><entity name="a-s-Demolition" prob="1.5"/><entity name="a-ZombieVulture" prob="0.5"/><entity name="a-zombieBoe" prob="1.5"/><entity name="a-zombieBigArlene" prob="1.5"/><entity name="a-s-zombieBoe" prob="1.2"/><entity name="a-zombieArlene" prob="1.2"/></append>
<append xpath="/entitygroups/entitygroup[@name='feralHordeStageGS27']"><entity name="a-zombieyo" prob="1.5"/><entity name="a-zombieyo2" prob="1.5"/><entity name="a-zombieyo3" prob="1.5"/><entity name="a-s-Demolition" prob="1.5"/><entity name="a-ZombieVulture" prob="0.5"/><entity name="a-zombieBoe" prob="1.5"/><entity name="a-zombieBigArlene" prob="1.5"/><entity name="a-s-zombieBoe" prob="1.2"/><entity name="a-zombieArlene" prob="1.2"/></append>

 

Link to comment
Share on other sites

12 hours ago, a_jp said:

as my reference
en-zombie
It's a different way of doing things.

modified for myself
Only the ferrule hoard part
Copy

 

The GS numbers refer to the default ~,
GS23 and below are not made,
Created in the same way up to GS726

 

entitygroups.xml

 

<append xpath="/entitygroups/entitygroup[@name='feralHordeStageGS23']"><entity name="a-zombieyo" prob="1.5"/><entity name="a-zombieyo2" prob="1.5"/><entity name="a-zombieyo3" prob="1.5"/><entity name="a-s-Demolition" prob="1.5"/><entity name="a-ZombieVulture" prob="0.5"/><entity name="a-zombieBoe" prob="1.5"/><entity name="a-zombieBigArlene" prob="1.5"/><entity name="a-s-zombieBoe" prob="1.2"/><entity name="a-zombieArlene" prob="1.2"/></append>
<append xpath="/entitygroups/entitygroup[@name='feralHordeStageGS27']"><entity name="a-zombieyo" prob="1.5"/><entity name="a-zombieyo2" prob="1.5"/><entity name="a-zombieyo3" prob="1.5"/><entity name="a-s-Demolition" prob="1.5"/><entity name="a-ZombieVulture" prob="0.5"/><entity name="a-zombieBoe" prob="1.5"/><entity name="a-zombieBigArlene" prob="1.5"/><entity name="a-s-zombieBoe" prob="1.2"/><entity name="a-zombieArlene" prob="1.2"/></append>

 

So are you telling the game to use something different for each game stage interval by writing <append xpath at the start of each line? And wouldn't I have to type this for every single interval as well if I am to do it this way? I mean I guess I could but that's like a ton of work I think. Isn't there an easier way? Maybe remove the  lines that the game already has for the hordes then do append xpath and add your custom stuff? I could be talking out of my behind here so maybe it doesn't work quite like that. Also if I wanted to tell the game to add my stuff to the entitygroups.xml where would I tell it to add it too? This xml isn't set up like the items.xml or blocks.xmls where they have things that you can reference like append xpath="/items/item[@name='gunShotgunT0PipeShotgun']. Instead there's just the descriptions that they commented out unless I'm missing something

 

Link to comment
Share on other sites

On 4/3/2023 at 11:28 AM, BFT2020 said:

Here is an example of one I did that you can use as reference.

 

Also when you go to that link, you should be able to see others that I made in the past.

 

Well I wasn't quite able to use yours as a reference however that gave me the idea to use other mods that affect things similarly to mine and I found one of khaine's mods from alpha 19 that made the hordes bigger which I was able to reference to I think make mine work similarly. There was also this game stage mod for mulitplayer in Alpha 18 which I mirrored somewhat to get my gamestage multiplier working. The only thing I haven't been able to get to work is the different horde night spawns. It is still spawning the zombies for default bloodmoons so my thinking is that I use remove then append to tell the game to use mine instead of the vanilla spawns only I don't know how to tell the game to do that for the entire bloodmoon section of the xml since there's only the commented out stuff at the top like this: 

 

<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXX  start: auto generated feral / blood mood horde groups  XXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
    <entitygroup name="feralHordeStageGS1"><entity name="zombieJoe"/><entity name="zombieNurse"/><entity name="zombieUtilityWorker"/><entity name="zombieBoe"/><entity name="zombieMoe"/><entity name="zombieMarlene"/><entity name="zombieYo"/><entity name="zombieJanitor"/><entity name="zombieTomClark"/><entity name="zombieSteve"/><entity name="zombieDarlene"/><entity name="zombiePartyGirl"/></entitygroup>
    <entitygroup name="feralHordeStageGS2"><entity name="zombieTomClark"/><entity name="zombieBoe"/><entity name="zombieJanitor"/><entity name="zombieArlene"/><entity name="zombieNurse"/><entity name="zombieBusinessMan"/><entity name="zombieUtilityWorker"/><entity name="zombieYo"/><entity name="zombieSteve"/><entity name="zombieMoe"/><entity name="zombiePartyGirl"/><entity name="zombieJoe"/></entitygroup>

Link to comment
Share on other sites

On 4/4/2023 at 7:46 PM, ProlificPoultry said:

Well I wasn't quite able to use yours as a reference however that gave me the idea to use other mods that affect things similarly to mine and I found one of khaine's mods from alpha 19 that made the hordes bigger which I was able to reference to I think make mine work similarly. There was also this game stage mod for mulitplayer in Alpha 18 which I mirrored somewhat to get my gamestage multiplier working. The only thing I haven't been able to get to work is the different horde night spawns. It is still spawning the zombies for default bloodmoons so my thinking is that I use remove then append to tell the game to use mine instead of the vanilla spawns only I don't know how to tell the game to do that for the entire bloodmoon section of the xml since there's only the commented out stuff at the top like this: 

 

<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXX  start: auto generated feral / blood mood horde groups  XXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
    <entitygroup name="feralHordeStageGS1"><entity name="zombieJoe"/><entity name="zombieNurse"/><entity name="zombieUtilityWorker"/><entity name="zombieBoe"/><entity name="zombieMoe"/><entity name="zombieMarlene"/><entity name="zombieYo"/><entity name="zombieJanitor"/><entity name="zombieTomClark"/><entity name="zombieSteve"/><entity name="zombieDarlene"/><entity name="zombiePartyGirl"/></entitygroup>
    <entitygroup name="feralHordeStageGS2"><entity name="zombieTomClark"/><entity name="zombieBoe"/><entity name="zombieJanitor"/><entity name="zombieArlene"/><entity name="zombieNurse"/><entity name="zombieBusinessMan"/><entity name="zombieUtilityWorker"/><entity name="zombieYo"/><entity name="zombieSteve"/><entity name="zombieMoe"/><entity name="zombiePartyGirl"/><entity name="zombieJoe"/></entitygroup>

 

If you want to totally replace the entity groups used by blood moon hordes, you can use an XPath expression that targets those XML nodes, and remove them. They all start with "feralHordeStage" so you could do something like this:

 

<remove xpath="//entitygroup[starts-with(@name, 'feralHordeStage')]" />

 

EDIT: Here's a detailed explanation of what that does.

 

  • "remove" is an XPath command. In this case the command is "remove any XML nodes that match this XPath expression."
  • The "//" in XPath means "any descendant, not just a direct descendant." Since it's the first thing in the XPath expression, it means "any descendant of the root node in the XML document."
  • "[" and "]" define a predicate - only nodes that match that predicate are selected. Predicates usually (but not always) target XML attributes.
  • "starts-with" is an XPath method that selects any node whose text starts with a particular string.
  • "@" means "select an attribute". In this case it selects the "name" attribute of any entitygroup tags in the document.

 

You would then add back all of the entity groups you just deleted, with your own version:

 

<append xpath="/entitygroups">
  <!-- ...whatever entity groups you copied over and modified -->
</append>

 

Incidentally, if you haven't done this already, then you should bookmark this forum post and refer to it whenever you're doing XPath modifications:

 

 

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

  • 1 month later...
On 4/5/2023 at 8:59 PM, khzmusik said:

 

If you want to totally replace the entity groups used by blood moon hordes, you can use an XPath expression that targets those XML nodes, and remove them. They all start with "feralHordeStage" so you could do something like this:

 

<remove xpath="//entitygroup[starts-with(@name, 'feralHordeStage')]" />

 

EDIT: Here's a detailed explanation of what that does.

 

  • "remove" is an XPath command. In this case the command is "remove any XML nodes that match this XPath expression."
  • The "//" in XPath means "any descendant, not just a direct descendant." Since it's the first thing in the XPath expression, it means "any descendant of the root node in the XML document."
  • "[" and "]" define a predicate - only nodes that match that predicate are selected. Predicates usually (but not always) target XML attributes.
  • "starts-with" is an XPath method that selects any node whose text starts with a particular string.
  • "@" means "select an attribute". In this case it selects the "name" attribute of any entitygroup tags in the document.

 

You would then add back all of the entity groups you just deleted, with your own version:

 

<append xpath="/entitygroups">
  <!-- ...whatever entity groups you copied over and modified -->
</append>

 

Incidentally, if you haven't done this already, then you should bookmark this forum post and refer to it whenever you're doing XPath modifications:

 

 

Oh gosh I know it's been like 2 months now, I apologize that I am now just replying to this, I got busy with my finals among other things... But anyways so it kind of worked! Kind of. I know that it removed the original zombie spawns from the entitygroups.xml, however it's just not spawning any more zombies on horde nights. I tested this a while ago now and just recently remembered that I wanted to make this mod so I went back in and yeah, still no zombie spawns. I can't figure out why but this is what I have in the xml: 

<config>
    <!-- Changes the zombie spawns on horde night-->

 

<remove xpath="//entitygroup[starts-with(@name, 'feralHordeStage')]" />
    
        <append xpath="/entitygroups">

(i'll just put this little bit as an example) 

<entitygroup name="feralHordeStageGS1"><entity name="zombieJoe"/><entity name="zombieNurse"/><entity name="zombieUtilityWorker"/><entity name="zombieBoe"/><entity name="zombieMoe"/><entity name="zombieMarlene"/><entity name="zombieYo"/><entity name="zombieJanitor"/><entity name="zombieTomClark"/><entity name="zombieSteve"/><entity name="zombieDarlene"/><entity name="zombiePartyGirl"/></entitygroup>
    <entitygroup name="feralHordeStageGS2"><entity name="zombieTomClark"/><entity name="zombieBoe"/><entity name="zombieJanitor"/><entity name="zombieArlene"/><entity name="zombieNurse"/><entity name="zombieBusinessMan"/><entity name="zombieUtilityWorker"/><entity name="zombieYo"/><entity name="zombieSteve"/><entity name="zombieMoe"/><entity name="zombiePartyGirl"/><entity name="zombieJoe"/></entitygroup>

         </append>
</config>

 

Also thanks for your help! I really appreciate it! : D

 

 

Link to comment
Share on other sites

On 5/29/2023 at 9:38 AM, ProlificPoultry said:

I know that it removed the original zombie spawns from the entitygroups.xml, however it's just not spawning any more zombies on horde nights.

 

What you posted looks reasonable. You didn't say if there are any errors or warnings, so I can't tell for certain what is going on.

 

But, one thing I would double-check is that all of your entity groups match up with the entity groups listed in gamestages.xml. The blood moon zombies are taken from the "BloodMoonHorde" spawner in that file. If there is any mismatch, then I'm guessing that entire spawner won't be read properly.

 

That's about all I can think of.

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

1 hour ago, khzmusik said:

 

What you posted looks reasonable. You didn't say if there are any errors or warnings, so I can't tell for certain what is going on.

 

But, one thing I would double-check is that all of your entity groups match up with the entity groups listed in gamestages.xml. The blood moon zombies are taken from the "BloodMoonHorde" spawner in that file. If there is any mismatch, then I'm guessing that entire spawner won't be read properly.

 

That's about all I can think of.

So there’s no errors in the console when the blood moon starts. I think it just says blood moon starting and then nothing spawns. Also if the spawns need to match then I don’t think there’s any way my mod is going to work.

Link to comment
Share on other sites

On 6/2/2023 at 10:19 PM, khzmusik said:

 

What you posted looks reasonable. You didn't say if there are any errors or warnings, so I can't tell for certain what is going on.

 

But, one thing I would double-check is that all of your entity groups match up with the entity groups listed in gamestages.xml. The blood moon zombies are taken from the "BloodMoonHorde" spawner in that file. If there is any mismatch, then I'm guessing that entire spawner won't be read properly.

 

That's about all I can think of.

Well I couldn’t think of anything either. And now I’m out of time, though I highly doubt the blood moon hordes are going to change at all for A21 considering the trend they have been on with regards to nerfing the hordes. I just really wanted to have this functioning before A21 just in case. :’( 

 

I wonder how darkness falls and overhaul mods do it where they have completely different blood moon spawns?

 

Link to comment
Share on other sites

16 hours ago, ProlificPoultry said:

Well I couldn’t think of anything either. And now I’m out of time, though I highly doubt the blood moon hordes are going to change at all for A21 considering the trend they have been on with regards to nerfing the hordes. I just really wanted to have this functioning before A21 just in case. :’( 

 

I wonder how darkness falls and overhaul mods do it where they have completely different blood moon spawns?

 

 

I probably wasn't clear. The entity groups in entitygroups.xml don't have to exactly match the vanilla entity group names listed in gamestages.xml. They have to match each other.

 

So if you want to make completely different entity groups for horde nights (say, "myGroupGS1" through "myGroupGS800") then they should match the entity group names in the "BloodMoonHorde" spawner. Like so:

 

<spawner name="BloodMoonHorde">
    <gamestage stage="1">
        <spawn group="myGroupGS1" num="2" maxAlive="3" duration="1" />
    </gamestage>
    <!-- ...snip... -->
    <gamestage stage="800">
        <spawn group="myGroupGS798" num="500" maxAlive="256" duration="2" interval="23" />
        <spawn group="myGroupGS799" num="500" maxAlive="256" duration="2" interval="30" />
        <spawn group="myGroupGS800" num="500" maxAlive="256" duration="7" />
    </gamestage>
</spawner>

 

You can go up to whatever game stage you want; the game goes up to game stage 4086, but they apparently have some kind of script that automatically generates them.

Link to comment
Share on other sites

Well as far as I can tell they do match up unless I am missing something which is entirely possible

 

(from gamestage.xml) 

 

<set xpath="/gamestages/spawner[@name='BloodMoonHorde']">
    <gamestage stage="1">
            <spawn group="feralHordeStageGS1" num="2" maxAlive="6" duration="1"/>
        </gamestage>
        <gamestage stage="2">
            <spawn group="feralHordeStageGS2" num="3" maxAlive="6" duration="1"/>
        </gamestage>
        <gamestage stage="4">
            <spawn group="feralHordeStageGS4" num="6" maxAlive="8" duration="1"/>
        </gamestage>
        <gamestage stage="7">
            <spawn group="feralHordeStageGS7" num="10" maxAlive="10" duration="1"/>

 

(from entitygroups.xml)

 

<remove xpath="//entitygroup[starts-with(@name, 'feralHordeStage')]" />
    
        <append xpath="/entitygroups">
    <entitygroup name="feralHordeStageGS1"><entity name="zombieJoe"/><entity name="zombieNurse"/><entity name="zombieUtilityWorker"/><entity name="zombieBoe"/><entity name="zombieMoe"/><entity name="zombieMarlene"/><entity name="zombieYo"/><entity name="zombieJanitor"/><entity name="zombieTomClark"/><entity name="zombieSteve"/><entity name="zombieDarlene"/><entity name="zombiePartyGirl"/></entitygroup>
    <entitygroup name="feralHordeStageGS2"><entity name="zombieTomClark"/><entity name="zombieBoe"/><entity name="zombieJanitor"/><entity name="zombieArlene"/><entity name="zombieNurse"/><entity name="zombieBusinessMan"/><entity name="zombieUtilityWorker"/><entity name="zombieYo"/><entity name="zombieSteve"/><entity name="zombieMoe"/><entity name="zombiePartyGirl"/><entity name="zombieJoe"/></entitygroup>
    <entitygroup name="feralHordeStageGS4"><entity name="zombieJanitor"/><entity name="zombieBusinessMan"/><entity name="zombieMoe"/><entity name="zombieDarlene"/><entity name="zombieBoe"/><entity name="zombieNurse"/><entity name="zombieMarlene"/><entity name="zombieTomClark"/><entity name="zombieYo"/><entity name="zombieUtilityWorker"/><entity name="zombieJoe"/><entity name="zombieSteve"/></entitygroup>

 

 

 

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