Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

16 minutes ago, Iceburg71 said:

Yeah, I get the naming in the "contains" part.  I just threw that together and see if it would even work.  My issue is how do i search for "animalDoe" in ALL of the groups?  I think the * is the invalid token error I am getting, thus not letting anything work.  Because it is an error and not a warning.

 

thanks

 

Sorry, I misunderstood. Try something like this:

 

It'll search the contents of the text(), then apply the information to the contains. Note in this case, we don't use the text() within the contains like we have with the other formats, but rather we can use a period.  

 

 <csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalDoe')]">
        animalIceburgBabyDeer"
    </csv>

 

Link to comment
Share on other sites

Sweet, that worked.  ha to add in the delim and op operators, but it worked.  

 

Final Code...

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalDoe, 15')]" delim="\n" op="add" >animalIceburgBabyDeer, 15</csv>>
 

Odd part is how it added it...  that section now looks like this in the configsdump.

  <!-- *** BIOME_ANIMAL_WILD_GAME_FOREST_NIGHT_GROUP -->
  <!-- NONE must not be the first entry since first name determines if enemy group -->
  <entitygroup name="WildGameForestNight">        animalDoe, 15
        none, 85
    
animalIceburgBabyDeer, 15<!--Content CSV manipulated by: "IceBurg_Animals_Overhaul"--></entitygroup>
 

 

Very odd, but no errors.  This thing is gonna look terrible when I am done!!   LOL

 

Next question is does the total of all of these have to add up to 100?  Or alternate question, do I have to mess with the "none,85" at all?  that may make a huge difference in how I do this....

 

 

Link to comment
Share on other sites

And so close...  tried more complex logic in it.

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalBoar') and text()[not contains(., 'animalboar,']]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>

 

Getting an invalid token..  I know it is just a formatting error, 

 

one of the other ones I tried gave me the error that the expression must evaluate to a node set.

    <csv xpath="/entitygroups/entitygroup/text()[[contains(., 'animalBoar')] and [not contains(., 'animalboar,']]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>
 

Link to comment
Share on other sites

14 minutes ago, Iceburg71 said:

And so close...  tried more complex logic in it.

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalBoar') and text()[not contains(., 'animalboar,']]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>

 

Getting an invalid token..  I know it is just a formatting error, 

 

one of the other ones I tried gave me the error that the expression must evaluate to a node set.

    <csv xpath="/entitygroups/entitygroup/text()[[contains(., 'animalBoar')] and [not contains(., 'animalboar,']]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>
 

 

15 minutes ago, Iceburg71 said:

And so close...  tried more complex logic in it.

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalBoar') and text()[not contains(., 'animalboar,']]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>

 

Getting an invalid token..  I know it is just a formatting error, 

 

one of the other ones I tried gave me the error that the expression must evaluate to a node set.

    <csv xpath="/entitygroups/entitygroup/text()[[contains(., 'animalBoar')] and [not contains(., 'animalboar,']]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>
 

 

What about something like this:

 

    <csv xpath="/entitygroups/entitygroup/text()[
    	            [	
                		contains(., 'animalBoar')
        		        and not (contains(., 'animalboar,'))
                	]
                ]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>

 

Note, not is a function, so you need to wrap its condition inside of  ( ) 

 

Link to comment
Share on other sites

Nope, that didn't work.  error I got from that command below....

 

2023-06-19T17:00:47 55.209 ERR XML loader: Patching 'entitygroups.xml' from mod 'IceBurg_Animals_Overhaul' failed:
2023-06-19T17:00:47 55.214 EXC XML.Patch (/Iceburg/csv, line 14 at pos 2): XPath evaluation failed: Expression must evaluate to a node-set.
 

 

 

Link to comment
Share on other sites

20 minutes ago, Iceburg71 said:

Nope, that didn't work.  error I got from that command below....

 

2023-06-19T17:00:47 55.209 ERR XML loader: Patching 'entitygroups.xml' from mod 'IceBurg_Animals_Overhaul' failed:
2023-06-19T17:00:47 55.214 EXC XML.Patch (/Iceburg/csv, line 14 at pos 2): XPath evaluation failed: Expression must evaluate to a node-set.
 

 

 

the second part is animalboar and not animalBoar like in the first part. 

 

I can look closer tomorrow morning

Link to comment
Share on other sites

I`m used some modlets and want to create my fixes for it. I know that I can determine the load order of the mods with the help of names. And created my name folder in the end list mods. But don't understand how is better overwrite recipes.xml or items.xml. 

Can I use <append> for edit existing recipes?

<append xpath="/recipes">
	<recipe name="drinkJarGrainAlcohol" time="120" area="stationChemistry">
		<ingredient name="foodCornMeal" count="10"/>
		<ingredient name="drinkJarRiverWater"/>
	</recipe>
</append>


Or should I remove the existing one first and add a replacement?

<remove xpath="/recipes/recipe[@name='drinkJarGrainAlcohol']"></remove>
<append xpath="/recipes">
	<recipe name="drinkJarGrainAlcohol" time="120" area="stationChemistry">
		<ingredient name="foodCornMeal" count="10"/>
		<ingredient name="drinkJarRiverWater"/>
	</recipe>
</append>


And same question for overwrite values for items.xml. If i need to change multiple exist properties in my <item>, can i use <append> for it?

	<append xpath="/items/item[@name='drinkJarGrainAlcohol']">
		<property name="Stacknumber" value="1000"/>
		<property name="EconomicValue" value="60"/>
		<property name="CarryWeight" value=".25"/>
	</append>


Or should use <set> with xpath? (But I don't like this method. Because I have to duplicate the properties that I do not need to change.)

<set xpath="/items/item[@name='drinkJarBeer']">
	<property name="Group" value="Resources,Items"/>
	<property name="Meshfile" value="#Other/Items?Food/bottled_waterPrefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab"/>
	<property name="Material" value="Mglass"/><property name="Weight" value="10"/>
	<property name="Stacknumber" value="1000"/>
	<property name="EconomicValue" value="60"/>
	<property name="CarryWeight" value=".25"/>
</set>


And same solution with <set> with full xpath for each property. Maybe it's right solution for overwrite properties. But it is not always possible to understand how to write xpath="..."

<set xpath="/items/item[@name='drinkJarGrainAlcohol']/property[@name='Stacknumber']/@value">1000</set>
<set xpath="/items/item[@name='drinkJarGrainAlcohol']/property[@name='EconomicValue']/@value">60</set>
<set xpath="/items/item[@name='drinkJarGrainAlcohol']/property[@name='CarryWeight']/@value">0.25</set>



What is the best method to use to avoid problems in the future? I don't fully understand how it works full xpath="..." with different search attributes.
What if I need overwrite more properties in 100 different items?  Will this cause performance issues?

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

OK i need help still new to this and doing my best to fix this mod for the server i admin.. old line of code was

<append xpath="/progression/perks/perk[@name='perkAdvancedEngineering']/effect_group/passive_effect[@name='RecipeTagUnlocked'][@level='5']/@tags">,DmAuger</append >

 

new line that i edited

 

<append xpath="/progression/perks/perk[@name='perkAdvancedEngineering']/effect_group/passive_effect[@name='CraftingTier'][@level='5']/@tags=DmAuger']"></append>

 

I can not get this recipe to unlock at all .. i can see it when i load the mod in, i got the item loading in and working pulling from Creative Menu

Link to comment
Share on other sites

On 6/20/2023 at 9:37 PM, jamie7399 said:

OK i need help still new to this and doing my best to fix this mod for the server i admin.. old line of code was

<append xpath="/progression/perks/perk[@name='perkAdvancedEngineering']/effect_group/passive_effect[@name='RecipeTagUnlocked'][@level='5']/@tags">,DmAuger</append >

 

new line that i edited

 

<append xpath="/progression/perks/perk[@name='perkAdvancedEngineering']/effect_group/passive_effect[@name='CraftingTier'][@level='5']/@tags=DmAuger']"></append>

 

I can not get this recipe to unlock at all .. i can see it when i load the mod in, i got the item loading in and working pulling from Creative Menu

Are you running A21?  If so, crafting tiers and recipe unlocks are not part of perks anymore but part of crafting skills

Link to comment
Share on other sites

Are there advanced ways to format the new CSV xpath to better construct lists like entitygroups? For example, I posted pictures of what I have in my mod and what the result in configs dump is. Why is it moving the first entity to the top and out of the group? And why is it moving what I've added to the bottom right corner, with no tabs and a skipped line. While entities seem to still spawn fine from this, I specifically want to use "none" to cut down on total sleepers spawning... which does not work unless it is formatted correctly and directly after the last entity in the list.

 

How can I fix the formatting and structure with a csv path, so i don't have to use set xpath and override every single sleeper group manually with the "none" positioned correctly?

csv 1.PNG

csv 2.PNG

Link to comment
Share on other sites

Hey, so I started fiddling with xml files recently and I'm trying to figure stuff out by looking at other files, and I currently have a problem.

 

So I see that TFP have this commented out on the Power Attack group for the steel knucklesimage.png.76e914d61becccae763aa908f504c19f.png

 

I want to be able to re-add that variable on my own xml, how would I be able to do that?

 

EDIT: Problem solved, just found it out.

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

I am still working on the search and add for the csv editing.  I have tried multiple ways with no success.  I posted earlier and we had a little discussion going on with it.  But no resolution.  I can post the specific info again if needed....

Link to comment
Share on other sites

On 6/28/2023 at 4:17 AM, Howlune said:

Are there advanced ways to format the new CSV xpath to better construct lists like entitygroups? For example, I posted pictures of what I have in my mod and what the result in configs dump is. Why is it moving the first entity to the top and out of the group? And why is it moving what I've added to the bottom right corner, with no tabs and a skipped line. While entities seem to still spawn fine from this, I specifically want to use "none" to cut down on total sleepers spawning... which does not work unless it is formatted correctly and directly after the last entity in the list.

 

How can I fix the formatting and structure with a csv path, so i don't have to use set xpath and override every single sleeper group manually with the "none" positioned correctly?

csv 1.PNG

csv 2.PNG

 

I don't think the ConfigDumps formatting really matters. The game reads the entitygroups line by line from memory. The configsDump is just a helper set of files so we can verify that we've added things correctly. However, it doesn't really do it cleanly anymore for entitygroups.

 

If your changes aren't working, I don't think its related to formatting of the file.

On 6/20/2023 at 4:33 PM, The_Dream said:

I`m used some modlets and want to create my fixes for it. I know that I can determine the load order of the mods with the help of names. And created my name folder in the end list mods. But don't understand how is better overwrite recipes.xml or items.xml. 

Can I use <append> for edit existing recipes?

<append xpath="/recipes">
	<recipe name="drinkJarGrainAlcohol" time="120" area="stationChemistry">
		<ingredient name="foodCornMeal" count="10"/>
		<ingredient name="drinkJarRiverWater"/>
	</recipe>
</append>


Or should I remove the existing one first and add a replacement?

<remove xpath="/recipes/recipe[@name='drinkJarGrainAlcohol']"></remove>
<append xpath="/recipes">
	<recipe name="drinkJarGrainAlcohol" time="120" area="stationChemistry">
		<ingredient name="foodCornMeal" count="10"/>
		<ingredient name="drinkJarRiverWater"/>
	</recipe>
</append>


And same question for overwrite values for items.xml. If i need to change multiple exist properties in my <item>, can i use <append> for it?

	<append xpath="/items/item[@name='drinkJarGrainAlcohol']">
		<property name="Stacknumber" value="1000"/>
		<property name="EconomicValue" value="60"/>
		<property name="CarryWeight" value=".25"/>
	</append>


Or should use <set> with xpath? (But I don't like this method. Because I have to duplicate the properties that I do not need to change.)

<set xpath="/items/item[@name='drinkJarBeer']">
	<property name="Group" value="Resources,Items"/>
	<property name="Meshfile" value="#Other/Items?Food/bottled_waterPrefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab"/>
	<property name="Material" value="Mglass"/><property name="Weight" value="10"/>
	<property name="Stacknumber" value="1000"/>
	<property name="EconomicValue" value="60"/>
	<property name="CarryWeight" value=".25"/>
</set>


And same solution with <set> with full xpath for each property. Maybe it's right solution for overwrite properties. But it is not always possible to understand how to write xpath="..."

<set xpath="/items/item[@name='drinkJarGrainAlcohol']/property[@name='Stacknumber']/@value">1000</set>
<set xpath="/items/item[@name='drinkJarGrainAlcohol']/property[@name='EconomicValue']/@value">60</set>
<set xpath="/items/item[@name='drinkJarGrainAlcohol']/property[@name='CarryWeight']/@value">0.25</set>



What is the best method to use to avoid problems in the future? I don't fully understand how it works full xpath="..." with different search attributes.
What if I need overwrite more properties in 100 different items?  Will this cause performance issues?

 

Sorry for the delay.

 

Yes, you'd append new recipes and properties to recipes, items, blocks, etc. 

 

If you needed to add new lines and change existing settings, you would use a combination of append to add the new properties, and then use set to change the value attribute on the ones you have.  If there's a lot of edits to a single recipe, I often times feel that doing a remove and then append a whole new recipe.

On 7/4/2023 at 3:18 PM, Iceburg71 said:

I am still working on the search and add for the csv editing.  I have tried multiple ways with no success.  I posted earlier and we had a little discussion going on with it.  But no resolution.  I can post the specific info again if needed....

What do you have now with your csv editing?

Link to comment
Share on other sites

Here are the last 2 entries I have tried :

 

<!-- <csv xpath="/entitygroups/entitygroup/text()[[contains(., 'animalBoar')] and [not (contains(., 'animalBoar,'))]]" delim="\n" op="add" >animalIceburgBabyBoar</csv>> -->
<csv xpath="/entitygroups/entitygroup/text()[[contains(., 'animalBoar')] and not (contains(., 'animalBoar,'))]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>

 

I have tried many others, but I kept just changing the line.  now I am keeping a list of what I have tried and didn't work.  Error I get is the same.

 

2023-06-19T17:00:47 55.209 ERR XML loader: Patching 'entitygroups.xml' from mod 'IceBurg_Animals_Overhaul' failed:
2023-06-19T17:00:47 55.214 EXC XML.Patch (/Iceburg/csv, line 14 at pos 2): XPath evaluation failed: Expression must evaluate to a node-set.

Link to comment
Share on other sites

And this line does not give me an error, but just a warning saying it didn't apply.

<csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalBoar')] and not(contains(., 'animalBoar,'))" delim="\n" op="add" >animalIceburgBabyBoar</csv>>
 

 

Link to comment
Share on other sites

OMG!!!!  After I don't know how many tries, I got it to work!!!!!  

 

And the winner is.....

 

<csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalBoar') and not(contains(., 'animalBoar,'))]" delim="\n" op="add" >animalIceburgBabyBoar</csv>>
 

 

Thank you for any and all help that was provided!!!!!!!

Link to comment
Share on other sites

8 hours ago, sphereii said:

 

I don't think the ConfigDumps formatting really matters. The game reads the entitygroups line by line from memory. The configsDump is just a helper set of files so we can verify that we've added things correctly. However, it doesn't really do it cleanly anymore for entitygroups.

 

If your changes aren't working, I don't think its related to formatting of the file.

I ran into the same problem and I do believe it has something to do with the formatting. More specifically it is caused by the last entity being on the same line as the closing entitygroup tag. That makes it ignore it and causes the mod fail. I ran into the same problem while trying to edit certain entitygroups to only contain one entity. The error I got said the groups were empty whereas the dump showed it had one entity in it, on the same line as the closing tag. You can also try this with just editing an existing group. As an example, group
 

<entitygroup name="scoutHordeStageGS1">
		zombieDarlene</entitygroup>

gives an error for being an empty group. This is also the way csv seems to edit these groups, without a line break at the end of the last line.

Link to comment
Share on other sites

Ok, just ran into another issue.  

Here is the command I am Running:

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'animalZombieDog') and not(contains(., 'animalZombieDog,'))]" delim="\n" op="add" >animalIceburgBabyZombieDog</csv>>

 

the result output I am getting with an Error is:

  <entitygroup name="ZombieDogGroup">animalZombieDog
animalIceburgBabyZombieDog<!--Content CSV manipulated by: "IceBurg_Animals_Overhaul"--></entitygroup>

 

Error I am getting is:
2023-07-09T14:26:31 57.267 ERR XML loader: Loading and parsing 'spawning.xml' failed
2023-07-09T14:26:31 57.267 EXC Entity spawner 'Dog_Sm_Territorial' contains invalid group ZombieDogGroup
  at EntitySpawnerClass.Init () [0x00099] in <0266d593c0f442fa83ca9e728741ee90>:0 
  at EntitySpawnerClassesFromXml.LoadEntitySpawnerClasses (System.Xml.Linq.XDocument _spawnXml) [0x00214] in <0266d593c0f442fa83ca9e728741ee90>:0 
  at WorldStaticData+<LoadSpawning>d__37.MoveNext () [0x00017] in <0266d593c0f442fa83ca9e728741ee90>:0 
  at ThreadManager+<CoroutineWrapperWithExceptionCallback>d__51.MoveNext () [0x00044] in <0266d593c0f442fa83ca9e728741ee90>:0 
 

Question is why????  I have the same type of entries in many other animals and I am not getting this error

 

I don't get this error  on the Dog_Med_Territorial Group.  Did i get this error because it tried to spawn in a small zombie dog group and it couldn't for some reason becasue of my mod???

 

Any thoughts appreciated.

 

Edit:  I see that Gako posted while I was writing this up.  seems I am hitting the same issue as him, maybe, probably.  With his work, I am guessing this may be a bug with mods applying to this type on entry?????

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

My personal experience with that dog territory group usually led to something not being edited correctly in one or more of the group files. Because I to had never touched the spawning.xml either. So double check all the animal stuff you edited so far and make sure there isn't an extra comma or bracket anywhere. Double check quotes and caps etc.

Link to comment
Share on other sites

I'm trying to replace Spiders with Dogs. I have used the example a bit higher up using csv add/remove commands to replace entire lines, where spiders are mentioned, and it mostly does what i want, i think.
 

Edit: so i realized several misconceptions i had in my initial approach.

 

The main question remains how to get the config dumps people have mentioned, so i can actually see the effect of the mod, rather than trying to infer it from gameplay testing.
Sorry, i'm sure it's common knowledge for the more experienced modders, but i'm new to this and google has failed me.

 

The original question - now cleaned up of some of my initial misconceptions...

 

I did this:

 

	<csv xpath="/entitygroups/entitygroup[contains(@name, '')]/text()" delim="\n" op="remove">zombieSpider*</csv>
	<csv xpath="/entitygroups/entitygroup[contains(@name, '')]/text()" delim="\n" op="add">animalZombieDog</csv>

 

and it seemed to work superficially.

 

However, i am now realizing, that while it does probably remove all the spiders just as i wanted, the second part does not at all work as i intially thought. It's not conditioned on the first line triggering, so it will just add a dog to every entitygroup. (I also realized, that there are no feral or radiated dogs i think? So i'd probably want another stand in, but let's ignore that for now)

 

So what would be the best way of something like this (while catching all the possible combinations of potentially different probability weights)

		zombieSpider
		zombieSpiderFeral, .25

into ideally something like

		animalZombieDog


My main concern are entity groups that only have a single entry - just removing the Spider from there without replacement would leave the group empty.

	<entitygroup name="zombieSpider">zombieSpider</entitygroup>

 

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

Ok, had a thought and did some testing.  I added this code to the beginning of my entitygroups.xml mod file and by doing this, I got NO errors with anything in the log files...

 

<!-- Correct Bug???  with individual entity group ZombieDogGroup -->
    <remove xpath="/entitygroups/entitygroup[@name='ZombieDogGroup']" />
    <append xpath="/entitygroups">
        <entitygroup name="ZombieDogGroup">
        animalZombieDog
        </entitygroup>
    </append>

 

This is the output i got in the dump file....

 

  <entitygroup name="animalZombieDog">animalZombieDog
animalIceburgBabyZombieDog
animalIceburgTeenZombieDog<!--Content CSV manipulated by: "IceBurg_Animals_Overhaul"--><!--Content CSV manipulated by: "IceBurg_Animals_Overhaul"--></entitygroup>
 

Going to call this a functional workaround?????   LOL

Edited by Iceburg71
more info (see edit history)
Link to comment
Share on other sites

1 hour ago, Chevayo said:

I'm trying to replace Spiders with Dogs. I have used the example a bit higher up using csv add/remove commands to replace entire lines, where spiders are mentioned, and it mostly does what i want, i think.
 

Edit: so i realized several misconceptions i had in my initial approach.

 

The main question remains how to get the config dumps people have mentioned, so i can actually see the effect of the mod, rather than trying to infer it from gameplay testing.
Sorry, i'm sure it's common knowledge for the more experienced modders, but i'm new to this and google has failed me.

 

The original question - now cleaned up of some of my initial misconceptions...

 

I did this:

 

	<csv xpath="/entitygroups/entitygroup[contains(@name, '')]/text()" delim="\n" op="remove">zombieSpider*</csv>
	<csv xpath="/entitygroups/entitygroup[contains(@name, '')]/text()" delim="\n" op="add">animalZombieDog</csv>

 

and it seemed to work superficially.

 

However, i am now realizing, that while it does probably remove all the spiders just as i wanted, the second part does not at all work as i intially thought. It's not conditioned on the first line triggering, so it will just add a dog to every entitygroup. (I also realized, that there are no feral or radiated dogs i think? So i'd probably want another stand in, but let's ignore that for now)

 

So what would be the best way of something like this (while catching all the possible combinations of potentially different probability weights)

		zombieSpider
		zombieSpiderFeral, .25

into ideally something like

		animalZombieDog


My main concern are entity groups that only have a single entry - just removing the Spider from there without replacement would leave the group empty.

	<entitygroup name="zombieSpider">zombieSpider</entitygroup>

 

 

You would first want to remove the zombiespider group since it will no longer exist and there is already a zombie dog group

<remove xpath="/entitygroups/entitygroup[@name='ZombieSpiderGroup']" />

and probably (didn't look to see if it exists)

<remove xpath="/entitygroups/entitygroup[@name='ZombieSpiderFeralGroup']" />

 

Second, you will want to add in the zombie dog wherever there is a zombie spider entry, but just zombie spider, not feral ones, or ones with a probability

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'zombieSpider') and not(contains(., 'zombieSpider,')) and not(contains(., 'zombieSpiderFeral'))]" delim="\n" op="add" >animalZombieDog</csv>>

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'zombieSpiderFeral') and not(contains(., 'zombieSpiderFeral,'))]" delim="\n" op="add" >animalZombieDog</csv>>

 

The first contains evaluates to true if zombieSpider is found.

The second contains evaluates to true if zombieSpider, is NOT found.  Note the "," at the end.  VERY IMPORTANT because with a "," there is a probability

The Third contains evaluates to true if zombieSpiderFeral Is NOT found.  

Note the differnce between the feral and non feral versions of the code.

 

Now for the third step.  Adding in the spiders that DO have a probability.

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'zombieSpider, 10')]" delim="\n" op="add" >animalZombieDog, 10</csv>>

 

this just looks for an entry of zombieSpider, 10 and changes it to animalZombieDog, 10. 

doing it this way will maintain your spider probability with the dog replacing it.  and I just use "10" as an example, it could be any probabliity.  And you will have one entry for each probability that currently exists in the game.  Just search the Vanilla entityGroups.xml file for "zombieSpider," and write down all the numbers.  then you will have one line for each number you write down with that number probability instead of 10.  Again, note the "," after zombieSpider.  will narrow your search a little.

Change zombieSpider, to ZombieSpiderFeral to to the same to those.

 

Now to delete the  zombieSpider and zombieSpiderFeral from everywhere..

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'zombieSpider')]" delim="\n" op="remove" >zombieSpider</csv>>

    <csv xpath="/entitygroups/entitygroup/text()[contains(., 'zombieSpiderFeral')]" delim="\n" op="remove" >zombieSpiderFeral</csv>>

 

Doing it this way will make sure you don't ever end up with an empty group, which will throw a fatal error and prevent the mod from running correctly.

You will also maintain the probabilities of the zombie spiders carried into the dogs.  probably a good thing.

 

Also, I am pretty sure that last step will remove all entries for zombieSpider even if it contains a probability.  Never tried it, so don't know for sure.

 

Also also, I don't know if ZombieSpiderGroup is used in spawning.xml or not.  So you may have to make some adjustments and not remove them.  If you don't remove them, then just skip the step where they are removed.  The rest of the code will catch them and populate them correctly.

 

You just have to add before you remove.

 

 

 

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

Thank you Iceburg! Some excellent advice - i did not even realize, that the order i would do things matters, but indeed it does solve some issues.

 

One more thing - i sorta burrowed the question in my original post:

How do i get/see those dump files you mentioned, to see how the config files look after the mod is applied? It would really help as compared to just trying it in game. I tried searching it on google, but apparently the terms are too ambiguous.

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

1 hour ago, Chevayo said:

One more thing - i sorta burrowed the question in my original post:

How do i get/see those dump files you mentioned, to see how the config files look after the mod is applied? It would really help as compared to just trying it in game. I tried searching it on google, but apparently the terms are too ambiguous.

Those are created in the userdata folder, inside the save folder for the world you are playing in. So

Saves/WorldName/Savename/ConfigsDump


As an additional note on my last post, even something like

<csv xpath="//entitygroup/text()" delim="\n" op="add" >
	I Don't Know You And I Don't Care To Know You.
</csv>

causes no errors. It just gets completely ignored. The change is visible in the configs dump on every 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...