Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

I'm trying to increase the probability of commonBooks spawning in certain containers. My xpath:

 

<loot>

 

<set xpath="/lootcontainers/lootcontainer[@id=14]/item[@group=books]/@prob=">0.4</set>

 

</loot>

 

I keep getting errors on trying to load the game. Before I grab my output log and all that, can someone just check I haven't made any silly errors? It looks like it should work but isn't.

 

 

Remove the = after @prob and you should be good =)

[color=#DCDCD2]<set xpath="/lootcontainers/lootcontainer[@id='14']/item[@group='books']/@prob">0.4</set>[/color]

Link to comment
Share on other sites

Well seems like if I try and do any kind of append to entityclasses.xml as in adding in a new entity_class I get this error.

 

WRN XML patch for "entityclasses.xml" from mod "FastBurst Mod" did not apply: <append xpath="/entityclasses"

 

Example I tried to add this just to see:

<append xpath="entityclasses">
<entity_class name="zombieStripperRadiated" extends="zombieStripper">
	<property name="Tags" value="zombie,walker,feral"/>
	<property name="Mesh" value="Zombies/zombieStandardStripperRagdoll"/>
	<property name="ReplaceMaterial1" value="entities/zombies/materials/feral_eye"/>

	<!-- Gameplay -->
	<property name="MoveSpeedAggro" value=".5, 1.35"/>

	<property name="HandItem" value="meleeHandZombieStripperFeral"/>

	<property name="ExperienceGain" value="700"/> <!-- XP grunt feral -->
	<property name="LootDropProb" value=".03"/> <!-- Feral -->
	<effect_group name="Base Effects">
		<passive_effect name="HealthMax" operation="base_set" value="237"/>
		<passive_effect name="HealthMax" operation="perc_set" value="1"/> <!-- Zombie HP scale -->
		<passive_effect name="EntityDamage" operation="perc_add" value="0"/> <!-- Feral damage -->
	</effect_group>
</entity_class>
</append>	

 

and I get that error immediately. I can do other appends that change values no problem. BUT, if I try and add any new entity_class it gives that error and doesn't apply them? Anyone know why or a work around for this or is this just not possible with the new Mod System?

Link to comment
Share on other sites

Hi guys :) i'm hitting a wall after trying over hours to make my progressions.xml , Spawning.xml changes and loot.xml working with the xpath.... Hope someone could help me to make them working right...

 

Progression.xml

https://pastebin.com/2Q7Wbc8q

would to add my new Attribute, Skills and Perks, also want to edit 2 Values like Exp_to_level and experience_multiplier

 

Loot.xml

https://pastebin.com/ifcbK9gi

 

Looks like the line in loot like "<append xpath="loot/lootcontainers/lootcontainer" aren't right but its loot.xml to <lootcontainers> node and to another <lootcontainer name="AnyContainerName">

 

at spawning.xml:

<configs>

<set xpath="/spawning/biome[@name=city]/spawn[@name=maxcount]/@value">6</set>

</configs>

don't work^^ .....

 

Error Screen:

1302250722_Error3.jpg.569c60b53e56eb4a1f0f0803b8d15a65.jpg

Imgur Screenshot

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

Hi guys :) i'm hitting a wall after trying over hours to make my progressions.xml , Spawning.xml changes and loot.xml working with the xpath.... Hope someone could help me to make them working right...

 

Progression.xml

https://pastebin.com/2Q7Wbc8q

would to add my new Attribute, Skills and Perks, also want to edit 2 Values like Exp_to_level and experience_multiplier

 

Loot.xml

https://pastebin.com/ifcbK9gi

 

Looks like the line in loot like "<append xpath="loot/lootcontainers/lootcontainer" aren't right but its loot.xml to <lootcontainers> node and to another <lootcontainer name="AnyContainerName">

 

at spawning.xml:

<configs>

<set xpath="/spawning/biome[@name=city]/spawn[@name=maxcount]/@value">6</set>

</configs>

don't work^^ .....

 

Error Screen:

[ATTACH=CONFIG]26385[/ATTACH]

Imgur Screenshot

 

loot.xml:

 

Your append for it should be <append xpath="/lootcontainers/lootcontainer[@id=19]". The first part of the xpath is the root node of the XML, not the file name.

 

Pogression.xml:

 

You are trying to adjust the level using the @name='exp_to_leve']. However, the line is:

 

<level max_level="300" exp_to_level="9545" experience_multiplier="1.0149" skill_points_per_level="1">

 

Your xpath would be: <set xpath="/progression/level/@max_level">9500</set>

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

I fixed loot by my self xD but tyvm...

got another decent issue with loot.xml.

 

would to add the (count="XYZ") tag to some items and change the value too. but i dont know how this works^^

ERROR TEXT LINK

 

I Trying this one:

 

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkJarEmpty]/@count">1.5</set>

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkJarBoiledWater]/@count">1</set>

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkJarBeer]/@count">0.75</set>

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkCanMegaCrush]/@count">0.2</set>

 

but its not the right one :x

Link to comment
Share on other sites

I fixed loot by my self xD but tyvm...

got another decent issue with loot.xml.

 

would to add the (count="XYZ") tag to some items and change the value too. but i dont know how this works^^

ERROR TEXT LINK

 

I Trying this one:

 

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkJarEmpty]/@count">1.5</set>

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkJarBoiledWater]/@count">1</set>

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkJarBeer]/@count">0.75</set>

<set xpath="/lootcontainers/lootgroup[@name=beverages]/item[@name=drinkCanMegaCrush]/@count">0.2</set>

 

but its not the right one :x

 

There's no existing count value on that for you to change. You'd need to use setattribute to create a new one:

 

<setattribute xpath="/lootcontainers/lootgroup[@name='beverages']/item[@name='drinkJarEmpty']/@count">1.5</setattribute >
<setattribute xpath="/lootcontainers/lootgroup[@name='beverages']/item[@name='drinkJarBoiledWater']/@count">1</setattribute >
<setattribute xpath="/lootcontainers/lootgroup[@name='beverages']/item[@name='drinkJarBeer']/@count">0.75</setattribute >
<setattribute xpath="/lootcontainers/lootgroup[@name='beverages']/item[@name='drinkCanMegaCrush']/@count">0.2</setattribute >

Link to comment
Share on other sites

Ty mate :)

 

only 2 things left now . ..

 

1. need to add my own progression Attribute (luck), Skills and Perks of it.

Progression Attribute+Skills+Perks

 

2. Modifing spawnings

Original:

<biome name="city">

<spawn maxcount="3" respawndelay="1" time="Day" entitygroup="ZombiesAll" />

<spawn maxcount="5" respawndelay="1" time="Night" entitygroup="ZombiesNight" />

<spawn maxcount="1" respawndelay="1" time="Any" entitygroup="ZombieDogGroup" />

</biome>

 

WHAT I DID:

<configs>

<set xpath="/spawning/biome[@name=city]/spawn[@name=maxcount]/@value">6</set>

</configs>

 

WHAT I WANT

<biome name="city">

<spawn maxcount="from 3 to 6" respawndelay="1" time="Day" entitygroup="ZombiesAll" />

</biome>

Link to comment
Share on other sites

Ty mate :)

 

only 2 things left now . ..

 

1. need to add my own progression Attribute (luck), Skills and Perks of it.

Progression Attribute+Skills+Perks

 

2. Modifing spawnings

Original:

<biome name="city">

<spawn maxcount="3" respawndelay="1" time="Day" entitygroup="ZombiesAll" />

<spawn maxcount="5" respawndelay="1" time="Night" entitygroup="ZombiesNight" />

<spawn maxcount="1" respawndelay="1" time="Any" entitygroup="ZombieDogGroup" />

</biome>

 

WHAT I DID:

<configs>

<set xpath="/spawning/biome[@name=city]/spawn[@name=maxcount]/@value">6</set>

</configs>

 

WHAT I WANT

<biome name="city">

<spawn maxcount="from 3 to 6" respawndelay="1" time="Day" entitygroup="ZombiesAll" />

</biome>

 

I've noticed this in a few of your xpath, so I just want to clarify the @value meaning.

 

That @value means "attribute called value", and @name means "attribute called name". In your spawnings, you are using @name='city' correctly, as name="city" is valid in the XML node. However, you go on to use spawn[@name=maxcount]. There's no attribute call name in the spawn line.

 

The conditions in the [ ] are there to help you isolate which line you want to change, and can be any attribute on the line that is somewhat unique.

 

The following lines would work, and both will adjust the ZombiesAll line.

<set xpath="/spawning/biome[@name='city']/spawn[@entitygroup='ZombiesAll']/@maxcount">6</set>
<set xpath="/spawning/biome[@name='city']/spawn[@time='Day']/@maxcount">6</set>

Link to comment
Share on other sites

Ty for the Explanation.

its absolutely new to me, an crushing my head ... Did my best to learning by doing. but i had to understandt the logic behind the commandlines :)

 

and both commands of you make sense on hiw own way....

 

than are just the Progression left :)

 

Can you explain what you expect the progression to do? I had mentioned the last few lines are correct in my first reply.

Link to comment
Share on other sites

Works fine :) tyvm for spent so much time just to help me.

 

did you have any solution for my Progression ^^ ?

 

I'm not an expert on the progression, but try these small tweaks...

 

1) you are adding an <attribute to the progression node. It probably should be under the <attributes> tag

 

<configs>
<append xpath="/progression/attributes">
        	<attribute name="attLuck"
               <!-- snip -->
      </append>

      <append xpath="/progression/skills" >
            <!-- all your skills -->
       </append>
      <append xpath="/progression/perks">
          <!-- all your perk name lines -->
      </append>
</configs>

Link to comment
Share on other sites

At my Progression Attribute Luck:

<attribute name="attLuck" name_key="attLuckName" desc_key="attLuckDesc" icon="ui_game_symbol_skull_crusher">

<level_requirements level="1"><requirement name="PlayerLevel" target="self" operation="GTE" value="1" desc_key="reqGenericLevel01"/></level_requirements>

<level_requirements level="2"><requirement name="PlayerLevel" target="self" operation="GTE" value="5" desc_key="reqGenericLevel02"/></level_requirements>

<level_requirements level="3"><requirement name="PlayerLevel" target="self" operation="GTE" value="10" desc_key="reqGenericLevel03"/></level_requirements>

<level_requirements level="4"><requirement name="PlayerLevel" target="self" operation="GTE" value="15" desc_key="reqGenericLevel04"/></level_requirements>

<level_requirements level="5"><requirement name="PlayerLevel" target="self" operation="GTE" value="20" desc_key="reqGenericLevel05"/></level_requirements>

<level_requirements level="6"><requirement name="PlayerLevel" target="self" operation="GTE" value="30" desc_key="reqGenericLevel06"/></level_requirements>

<level_requirements level="7"><requirement name="PlayerLevel" target="self" operation="GTE" value="45" desc_key="reqGenericLevel07"/></level_requirements>

<level_requirements level="8"><requirement name="PlayerLevel" target="self" operation="GTE" value="60" desc_key="reqGenericLevel08"/></level_requirements>

<level_requirements level="9"><requirement name="PlayerLevel" target="self" operation="GTE" value="80" desc_key="reqGenericLevel09"/></level_requirements>

<level_requirements level="10"><requirement name="PlayerLevel" target="self" operation="GTE" value="100" desc_key="reqGenericLevel10"/></level_requirements>

<effect_group>

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.35" level="1,9"/>

<passive_effect name="PlayerExpGain" operation="perc_add" value="1.5" level="10"/>

 

<passive_effect name="BlockDamage" operation="perc_add" value="0.025,0.225" level="1,9"/>

<passive_effect name="BlockDamage" operation="perc_add" value="0.25" level="10"/>

 

<effect_description level="1" desc_key="attLuckRank1Desc"/>

<effect_description level="2" desc_key="attLuckRank2Desc"/>

<effect_description level="3" desc_key="attLuckRank3Desc"/>

<effect_description level="4" desc_key="attLuckRank4Desc"/>

<effect_description level="5" desc_key="attLuckRank5Desc"/>

 

</effect_group>

</attribute>

 

as you see, the attribute self gives small benefits to EXP and BlockDmg. which i need to implement too anywise

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