Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

So, I'm taking a shot in the dark, with a small flashlight having read all this business.

If I want to make all my traps invincible to damage from activation...

I create a blocks.xml in my mod folder and the following xpath looks right ?

It should check blocks/block/property and modify every one of them with a DamageRecieved value to 0 ?

 

<configs>
<set xpath="/blocks/block/property/@DamageReceived">0</set>
</configs>

 

If that's the gist of it, its deceptively simple and I have this...

I wouldn't mind a little clarification on the use of /*/ and /string[#] things though, I think I get it after looking at the vanilla files relating to the example but correct me if I'm wrong. /*/ will jump up a node without specifying a name and /string[#] will count repeated instances and hit on the one numbered ?

I took a boo at the Xpath wiki and they're not listed.

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

I wouldn't mind a little clarification on the use of /*/ and /string[#] things though, I think I get it after looking at the vanilla files relating to the example but correct me if I'm wrong. /*/ will jump up a node without specifying a name and /string[#] will count repeated instances and hit on the one numbered ?

I took a boo at the Xpath wiki and they're not listed.

 

/*/ are just a wildcard match. It can traverse all the nodes.

 

xpath="/*" will affect all blocks.xml.

 

The string[#] you see is the index reference.

 

<effect_group>
<triggered_effect trigger="onSelfPrimaryActionStart" action="LogMessage" message="fired: onSelfPrimaryActionStart"/>
<triggered_effect trigger="onSelfSecondaryActionStart" action="LogMessage" message="fired: onSelfSecondaryActionStart"/>
<triggered_effect trigger="onSelfPrimaryActionEnd" action="LogMessage" message="fired: onSelfPrimaryActionEnd"/>
<triggered_effect trigger="onSelfSecondaryActionEnd" action="LogMessage" message="fired: onSelfSecondaryActionEnd"/>
<passive_effect name="StaminaChangeOT" operation="perc_add" value="20"/>
</effect_group>

 

xpath="/*/effect_group/triggered_effect[2]", for example, would affect the second triggered_effect.

 

<effect_group>
<triggered_effect trigger="onSelfPrimaryActionStart" action="LogMessage" message="fired: onSelfPrimaryActionStart"/>
[color="#FFFF00"]        <triggered_effect trigger="onSelfSecondaryActionStart" action="LogMessage" message="fired: onSelfSecondaryActionStart"/>
[/color]	<triggered_effect trigger="onSelfPrimaryActionEnd" action="LogMessage" message="fired: onSelfPrimaryActionEnd"/>
<triggered_effect trigger="onSelfSecondaryActionEnd" action="LogMessage" message="fired: onSelfSecondaryActionEnd"/>
<passive_effect name="StaminaChangeOT" operation="perc_add" value="20"/>
</effect_group>

Link to comment
Share on other sites

/*/ are just a wildcard match. It can traverse all the nodes.

 

xpath="/*" will affect all blocks.xml.

 

The string[#] you see is the index reference.

 

<effect_group>
<triggered_effect trigger="onSelfPrimaryActionStart" action="LogMessage" message="fired: onSelfPrimaryActionStart"/>
<triggered_effect trigger="onSelfSecondaryActionStart" action="LogMessage" message="fired: onSelfSecondaryActionStart"/>
<triggered_effect trigger="onSelfPrimaryActionEnd" action="LogMessage" message="fired: onSelfPrimaryActionEnd"/>
<triggered_effect trigger="onSelfSecondaryActionEnd" action="LogMessage" message="fired: onSelfSecondaryActionEnd"/>
<passive_effect name="StaminaChangeOT" operation="perc_add" value="20"/>
</effect_group>

 

xpath="/*/effect_group/triggered_effect[2]", for example, would affect the second triggered_effect.

 

<effect_group>
<triggered_effect trigger="onSelfPrimaryActionStart" action="LogMessage" message="fired: onSelfPrimaryActionStart"/>
[color="#FFFF00"]        <triggered_effect trigger="onSelfSecondaryActionStart" action="LogMessage" message="fired: onSelfSecondaryActionStart"/>
[/color]	<triggered_effect trigger="onSelfPrimaryActionEnd" action="LogMessage" message="fired: onSelfPrimaryActionEnd"/>
<triggered_effect trigger="onSelfSecondaryActionEnd" action="LogMessage" message="fired: onSelfSecondaryActionEnd"/>
<passive_effect name="StaminaChangeOT" operation="perc_add" value="20"/>
</effect_group>

 

Beautiful, pretty much exactly what I was thinking. I have spent the last few hours coding all my old tweaks into a mod file, hopefully I won't be back for troubleshooting :D

Link to comment
Share on other sites

Hi everyone! I want to change the stone shovel, so that it can till soil like the hoe. I tested it by changing the items.xml manually and it works, but if i try it via mod it generates an error message, so obviously my mistake is in the modlet / syntax. Hope you can help me.

 

I simply want to replace the secondary action of the shovel (power attack by default) with the secondary action of the hoe. Here is my mod-code.

 

<!-- Deleting the secondary action and the power attack -->
<remove xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']">
<remove xpath="items/item[@item name='meleeToolShovelStone']/effect_group[@name='Power Attack']">

<!-- Adding the new secondary action -->
<append xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']">
	<property name="class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</append>

Link to comment
Share on other sites

Hi everyone! I want to change the stone shovel, so that it can till soil like the hoe. I tested it by changing the items.xml manually and it works, but if i try it via mod it generates an error message, so obviously my mistake is in the modlet / syntax. Hope you can help me.

 

I simply want to replace the secondary action of the shovel (power attack by default) with the secondary action of the hoe. Here is my mod-code.

 

<!-- Deleting the secondary action and the power attack -->
<remove xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']">
<remove xpath="items/item[@item name='meleeToolShovelStone']/effect_group[@name='Power Attack']">

<!-- Adding the new secondary action -->
<append xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']">
	<property name="class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</append>

 

In your first remove, you are removing the Action1. However, your append is looking for that action1 to add to it.

 

Consider removing the class as you are doing, and then appending the entire Action1

 

- - - Updated - - -

 

Is it possible to remove an entire perktree from progression.xml somehow?

 

<remove xpath="/progression/progression[@name=perkGreaseMonkey]"/>

does not work and gives error when starting up :/

 

perkGreaseMonkey is a perk, not a progression...

 

/progression/perks/perk[@name=perkGreaseMonkey] might work better for you.

Link to comment
Share on other sites

In your first remove, you are removing the Action1. However, your append is looking for that action1 to add to it.

 

Consider removing the class as you are doing, and then appending the entire Action1

 

I changed the second part to the following

<append xpath="items/item[@item name='meleeToolShovelStone']">
<property class="Action1">
	<property name="class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</append>

Now it shows me a NullReferenceError. Did i missunderstand the append command?

Link to comment
Share on other sites

I changed the second part to the following
<append xpath="items/item[@item name='meleeToolShovelStone']">
<property class="Action1">
	<property name="class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</append>

Now it shows me a NullReferenceError. Did i missunderstand the append command?

 

Your name="class" is lowercase. It should be: name="Class"

Link to comment
Share on other sites

In your first remove, you are removing the Action1. However, your append is looking for that action1 to add to it.

 

Consider removing the class as you are doing, and then appending the entire Action1

 

- - - Updated - - -

 

 

 

perkGreaseMonkey is a perk, not a progression...

 

/progression/perks/perk[@name=perkGreaseMonkey] might work better for you.

 

Oh!

Ah! I see! geez. gonna take a while for me to get used to the xpath system I feel, but now I think I can start to do some rework!

Many many thanks for the tip!

Link to comment
Share on other sites

Your name="class" is lowercase. It should be: name="Class"

 

Although that's right, it did not fix anything. I also tried

<append xpath="items/item[@name='meleeToolShovelStone']"

 

Just to be sure, i have a folder in my mods folder called "Erkus easy gardening", containing a ModInfo.xml which contains this

<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<ModInfo>
	<Name value="Easy Gardening" />
	<Description value="Lets yout till soil with the stone shovel" />
	<Author value="Erkusandor" />
	<Version value="1.0" />
	<Website value="" />
</ModInfo>
</xml>

and a folder called config with a items.xml which contains this

<!-- Die Sekundنraktion der Steinschaufel lِschen -->
<remove xpath="items/item[@name='meleeToolShovelStone']/property[@class='Action1']">
<remove xpath="items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']">

<!-- Die Sekundنraktion der Harke zur Steinschaufel hinzufügen -->
<append xpath="items/item[@name='meleeToolShovelStone']">
<property class="Action1">
	<property name="Class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</append>

It creates an error called "Unexpected end of file. Current depth is 2, line 15 position 10." and a second NullReferenceException error "Object reference not set to an instant of an object".

 

I am sry if that's an annoying request, but i'm not deep enough into coding to get whats wrong.

Link to comment
Share on other sites

Although that's right, it did not fix anything. I also tried
<append xpath="items/item[@name='meleeToolShovelStone']"

 

Just to be sure, i have a folder in my mods folder called "Erkus easy gardening", containing a ModInfo.xml which contains this

<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<ModInfo>
	<Name value="Easy Gardening" />
	<Description value="Lets yout till soil with the stone shovel" />
	<Author value="Erkusandor" />
	<Version value="1.0" />
	<Website value="" />
</ModInfo>
</xml>

and a folder called config with a items.xml which contains this

<!-- Die Sekundنraktion der Steinschaufel lِschen -->
<remove xpath="items/item[@name='meleeToolShovelStone']/property[@class='Action1']">
<remove xpath="items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']">

<!-- Die Sekundنraktion der Harke zur Steinschaufel hinzufügen -->
<append xpath="items/item[@name='meleeToolShovelStone']">
<property class="Action1">
	<property name="Class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</append>

It creates an error called "Unexpected end of file. Current depth is 2, line 15 position 10." and a second NullReferenceException error "Object reference not set to an instant of an object".

 

I am sry if that's an annoying request, but i'm not deep enough into coding to get whats wrong.

 

Your remove's are missing />

 

<remove xpath="items/item[@name='meleeToolShovelStone']/property[@class='Action1']" />
<remove xpath="items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']" />

 

And probably a good idea to add the / to the start of the xpath="/items/item...

Link to comment
Share on other sites

Your remove's are missing />

 

<remove xpath="items/item[@name='meleeToolShovelStone']/property[@class='Action1']" />
<remove xpath="items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']" />

 

And probably a good idea to add the / to the start of the xpath="/items/item...

 

Well that did help... a little. Also: facepalm -.-

 

Now it creates a new error: "Xml exception: Multiple document element was detectet. Line 3 position 2."

 

It seems there is a problem with a second time altering meleeToolShovelStone. I am sure of that, because i tested the following alternatives:

 

1.) Switching line 2 and 3. No difference.

2.) Making line 3 a comment. New errror: "Xml exception: Multiple document element was detectet. Line 6 position 2." Which is the append command where i add the new code to meleeToolShovelStone.

3.) Deleting everything except line 2. No errors occur, but it does not change anything ingame; the second Action is still the power attack. Same goes with everything deletet except line 3.

 

Here is the currently used code:

 

<!-- Die Sekundنraktion der Steinschaufel lِschen -->
<remove xpath="/items/item[@name='meleeToolShovelStone']/property[@class='Action1']"/>
<remove xpath="/items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']"/>

<!-- Die Sekundنraktion der Harke zur Steinschaufel hinzufügen -->
<append xpath="/items/item[@name='meleeToolShovelStone']">
<property class="Action1">
	<property name="Class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</append>

 

 

I am not NEW to coding, but again, i can't make head or tail of it. Following the guide on the first page this SHOULD work, shouldn't it?

Link to comment
Share on other sites

Well that did help... a little. Also: facepalm -.-

 

Now it creates a new error: "Xml exception: Multiple document element was detectet. Line 3 position 2."

 

It seems there is a problem with a second time altering meleeToolShovelStone. I am sure of that, because i tested the following alternatives:

 

1.) Switching line 2 and 3. No difference.

2.) Making line 3 a comment. New errror: "Xml exception: Multiple document element was detectet. Line 6 position 2." Which is the append command where i add the new code to meleeToolShovelStone.

3.) Deleting everything except line 2. No errors occur, but it does not change anything ingame; the second Action is still the power attack. Same goes with everything deletet except line 3.

 

Here is the currently used code:

 

<!-- Die Sekundنraktion der Steinschaufel lِschen -->
<remove xpath="/items/item[@name='meleeToolShovelStone']/property[@class='Action1']"/>
<remove xpath="/items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']"/>

<!-- Die Sekundنraktion der Harke zur Steinschaufel hinzufügen -->
<append xpath="/items/item[@name='meleeToolShovelStone']">
<property class="Action1">
	<property name="Class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</append>

 

 

I am not NEW to coding, but again, i can't make head or tail of it. Following the guide on the first page this SHOULD work, shouldn't it?

 

Is what you are posting the full file of your changes? If so, you are missing a root node. This can be anything.

 

Example:

 

Mods/MyMod/Config/items.xml:

<configs>
     <!-- Die Sekundنraktion der Steinschaufel lِschen -->
     <remove xpath="/items/item[@name='meleeToolShovelStone']/property[@class='Action1']"/>
     <remove xpath="/items/item[@name='meleeToolShovelStone']/effect_group[@name='Power Attack']"/>

     <!-- Die Sekundنraktion der Harke zur Steinschaufel hinzufügen -->
     <append xpath="/items/item[@name='meleeToolShovelStone']">
    <property class="Action1">
	  <property name="Class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
   </append>
</configs>

Link to comment
Share on other sites

Hello, i'm new with modlet and xpath, i am trying to do soem changes for my own use and i keep getting erros when load the mod, i am getting "yyExeption irrecoverable syntax error" when i load my world editor with those changes

 


<rwgmixer>
         <!-- Biome Range -->
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap0.Range']/@value">,0,5</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap1.Range']/@value">,5,7</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap2.Range']/@value">,7,7.3</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap3.Range']/@value">,7.3,8</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap4.Range']/@value">,8,9</set>

        <!-- Prefab Spawn Chance -->
        <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_med_01']/@value">0.5</set>
	 <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='utility_celltower_02']/@value">0.3</set>
        <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_lg_01]/@value=">0.10</set>

</rwgmixer>

 

 

What im doing wrong?

Link to comment
Share on other sites

Hello, i'm new with modlet and xpath, i am trying to do soem changes for my own use and i keep getting erros when load the mod, i am getting "yyExeption irrecoverable syntax error" when i load my world editor with those changes

 


<rwgmixer>
         <!-- Biome Range -->
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap0.Range']/@value">,0,5</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap1.Range']/@value">,5,7</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap2.Range']/@value">,7,7.3</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap3.Range']/@value">,7.3,8</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap4.Range']/@value">,8,9</set>

        <!-- Prefab Spawn Chance -->
        <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_med_01']/@value">0.5</set>
	 <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='utility_celltower_02']/@value">0.3</set>
        <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_lg_01]/@value=">0.10</set>

</rwgmixer>

 

 

What im doing wrong?

 

In your Prefab spawn chance, you have /prefab_rule/[@name='... you probably don't want the / in the middle. /prefab_rule[@name='.

 

Also, your last three lines try to change the @value. But that's not a valid attribute for that line. Do you mean @count?

Link to comment
Share on other sites

Hello, i'm new with modlet and xpath, i am trying to do soem changes for my own use and i keep getting erros when load the mod, i am getting "yyExeption irrecoverable syntax error" when i load my world editor with those changes

 


<rwgmixer>
         <!-- Biome Range -->
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap0.Range']/@value">,0,5</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap1.Range']/@value">,5,7</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap2.Range']/@value">,7,7.3</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap3.Range']/@value">,7.3,8</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap4.Range']/@value">,8,9</set>

        <!-- Prefab Spawn Chance -->
        <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_med_01']/@value">0.5</set>
	 <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='utility_celltower_02']/@value">0.3</set>
        <set xpath="/rwgmixer/prefab_rules/prefab_rule/[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_lg_01]/@value=">0.10</set>

</rwgmixer>

 

 

What im doing wrong?

There are a couple of odd set commands there that I imagine are causing the issue.

Here is one of the properties you are trying to set.

				<property name="biomemap0.Range" value="0.2,0.5"/>

After the set command above it will look like this:

				<property name="biomemap0.Range" value=",0,5"/>

Link to comment
Share on other sites

In your Prefab spawn chance, you have /prefab_rule/[@name='... you probably don't want the / in the middle. /prefab_rule[@name='.

 

Also, your last three lines try to change the @value. But that's not a valid attribute for that line. Do you mean @count?

 

Thanks for the fast reply, and i thought all the last attributes needed to be value to be changed, but its equal written in the xml? i didnot noticed the junkyard_med_01 had only 1 count, thank you so much again. i need to keep learning from this post tultorial.

Link to comment
Share on other sites

There are a couple of odd set commands there that I imagine are causing the issue.

Here is one of the properties you are trying to set.

				<property name="biomemap0.Range" value="0.2,0.5"/>

After the set command above it will look like this:

				<property name="biomemap0.Range" value=",0,5"/>

 

You are right, all the numbers are wrong and the game can't load with those changes, thanks for show me what's wrong, i was breaking my head with this LOL, after the prob and value or count i need to put @value=">0< or @value">0<

Link to comment
Share on other sites

Thanks for the fast reply, and i thought all the last attributes needed to be value to be changed, but its equal written in the xml? i didnot noticed the junkyard_med_01 had only 1 count, thank you so much again. i need to keep learning from this post tultorial.

 

It's a common misconception that everything is @value, but that's just because a lot of the things we are changing is actually value. In reality, the @value is the attribute called 'value' on the line.

 

<drop event="Harvest" name="resourceRockSmall" count="50" tag="oreWoodHarvest"/>

 

@event, @name, @count, and @tag are all changeable

 

<set xpath="/blocks/block[@name='terrStone']/drop/@event">NewEvent</set>
<set xpath="/blocks/block[@name='terrStone']/drop/@name">newName</set>
<set xpath="/blocks/block[@name='terrStone']/drop/@count">33</set>

<set xpath="/blocks/block[@name=terrStone]/drop/@tag">all, my,new,tags</set>

Link to comment
Share on other sites

It's a common misconception that everything is @value, but that's just because a lot of the things we are changing is actually value. In reality, the @value is the attribute called 'value' on the line.

 

<drop event="Harvest" name="resourceRockSmall" count="50" tag="oreWoodHarvest"/>

 

@event, @name, @count, and @tag are all changeable

 

<set xpath="/blocks/block[@name='terrStone']/drop/@event">NewEvent</set>
<set xpath="/blocks/block[@name='terrStone']/drop/@name">newName</set>
<set xpath="/blocks/block[@name='terrStone']/drop/@count">33</set>

<set xpath="/blocks/block[@name=terrStone]/drop/@tag">all, my,new,tags</set>

 

Now i understand what "value" really means, instead of this i was writing all in value instead of the real tag, Thanks, My changes are working now, i was doing everything wrong :smile-new:

 

Now the code is like

 

<rwgmixer>
         <!-- Biome Range -->
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap0.Range']/@value">0,0.5</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap1.Range']/@value">0.5,0.7</set>
        <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap2.Range']/@value">0,7.3</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap3.Range']/@value">7.3,0.8</set>
	 <set xpath="/rwgmixer/biome_generators/biome_generator/module[@name='biomeOutput']/property[@name='biomemap4.Range']/@value">0.8,1.1</set>

        <!-- Prefab Spawn Chance -->
	 <set xpath="/rwgmixer/prefab_rules/prefab_rule[@name='industrial_JunkyardsLots']/prefab[@name='utility_celltower_02']/@prob">0.3</set>
        <set xpath="/rwgmixer/prefab_rules/prefab_rule[@name='industrial_JunkyardsLots']/prefab[@name='junkyard_lg_01']/@prob">0.10</set>
</rwgmixer>

Link to comment
Share on other sites

I've used the following xpath to move the buffs popup text away from the main screen:

 

<set xpath="/windows/window[@name=popupMenu]/@pos">200,-400</set>

 

This seems to work, as I can drink a beer and no text comes up to say I have a buzz. However when I open my backpack the text pops up in the normal position on the screen, and seems to refresh when I leave my backpack so the text lingers a few seconds on the main screen... anyone know why?

Link to comment
Share on other sites

Hmm. I think I have another probably stupid question, is it possible to remove the eh... tag "tag"

For example, remove the entire "tags="learnable"" part of a recipie like <recipe name="gunRocketLauncher" craft_area="workbench" count="1" tags="learnable">

Link to comment
Share on other sites

Hmm. I think I have another probably stupid question, is it possible to remove the eh... tag "tag"

For example, remove the entire "tags="learnable"" part of a recipie like <recipe name="gunRocketLauncher" craft_area="workbench" count="1" tags="learnable">

 

It's not a stupid question, and sadly, no. There's no <remoteattribute>. We can however, set it to blank, and see if that helps.

Link to comment
Share on other sites

Hi everyone! I want to change the stone shovel, so that it can till soil like the hoe. I tested it by changing the items.xml manually and it works, but if i try it via mod it generates an error message, so obviously my mistake is in the modlet / syntax. Hope you can help me.

 

I simply want to replace the secondary action of the shovel (power attack by default) with the secondary action of the hoe. Here is my mod-code.

 

<!-- Deleting the secondary action and the power attack -->
<remove xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']">
<remove xpath="items/item[@item name='meleeToolShovelStone']/effect_group[@name='Power Attack']">

<!-- Adding the new secondary action -->
<append xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']">
	<property name="class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</append>

 

you could try InsertAfter which will drop it right after action0 instead of at the end of the node, and I also noticed your remove lines don't have a closing slash (..."/>) which would have left them in and functioning even if your append did the trick. ALSO, the remove removes the entire node, you have to construct a new action1 node to wrap your new properties in, you missed that in your append. I missed it too on first go :p

The code below should do the trick, otherwise, your work looks like it was spot on...

<!-- Deleting the secondary action and the power attack -->
<remove xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action1']"/>
<remove xpath="items/item[@item name='meleeToolShovelStone']/effect_group[@name='Power Attack']"/>

<!-- Adding the new secondary action -->
<insertAfter xpath="items/item[@item name='meleeToolShovelStone']/property[@class='Action0']">
<property class="Action1">
	<property name="class" value="Repair"/>
	<property name="Repair_amount" value="30"/>
	<property name="Upgrade_hit_offset" value="-4"/>
	<property name="Delay" value="1.3"/>
	<property name="Upgrade_action_sound" value="ImpactSurface/metalhitearth"/>
	<property name="Allowed_upgrade_items" value="meleeToolHoeIron,resourceClayLump"/>
</property>
</insertAfter>

Edited by Atrophied (see edit history)
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...