Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

I've never tried; have you tried <remove xpath="/recipes/recipe[@name=foodGrilledMeat]/@tags" /> ?
I did now, but it returns an error.

 

Here is another problem:

 

	<buff name="buffReloadMovementPenalty" name_key="Reloading" icon="ui_game_symbol_pack_mule" icon_color="255,128,0" hidden="true">>
	<stack_type value="ignore"/>
	<damage_type value="stun"/>
	<duration value="7"/>
	<effect_group>
		<triggered_effect trigger="onReloadStop" action="RemoveBuff" buff="buffReloadMovementPenalty"/>
	</effect_group>

	<effect_group>
		<requirement name="ProgressionLevel" progression_name="perkRunAndGun" operation="Equals" value="0"/>
			<passive_effect name="WalkSpeed" operation="perc_subtract" value=".5"/>
			<passive_effect name="RunSpeed" operation="perc_subtract" value=".5"/>
			<passive_effect name="JumpStrength" operation="perc_subtract" value=".5"/>
	</effect_group>
	<effect_group>
		<requirement name="ProgressionLevel" progression_name="perkRunAndGun" operation="Equals" value="1"/>
			<passive_effect name="WalkSpeed" operation="perc_subtract" value=".4"/>
			<passive_effect name="RunSpeed" operation="perc_subtract" value=".4"/>
			<passive_effect name="JumpStrength" operation="perc_subtract" value=".4"/>
	</effect_group>
	<effect_group>
		<requirement name="ProgressionLevel" progression_name="perkRunAndGun" operation="Equals" value="2"/>
			<passive_effect name="WalkSpeed" operation="perc_subtract" value=".3"/>
			<passive_effect name="RunSpeed" operation="perc_subtract" value=".3"/>
			<passive_effect name="JumpStrength" operation="perc_subtract" value=".3"/>
	</effect_group>
	<effect_group>
		<requirement name="ProgressionLevel" progression_name="perkRunAndGun" operation="Equals" value="3"/>
			<passive_effect name="WalkSpeed" operation="perc_subtract" value=".2"/>
			<passive_effect name="RunSpeed" operation="perc_subtract" value=".2"/>
			<passive_effect name="JumpStrength" operation="perc_subtract" value=".2"/>
	</effect_group>
	<effect_group>
		<requirement name="ProgressionLevel" progression_name="perkRunAndGun" operation="Equals" value="4"/>
			<passive_effect name="WalkSpeed" operation="perc_subtract" value=".1"/>
			<passive_effect name="RunSpeed" operation="perc_subtract" value=".1"/>
			<passive_effect name="JumpStrength" operation="perc_subtract" value=".1"/>
	</effect_group>
</buff>

I want to reduce the values for WalkSpeed and RunSpeed and JumpStrength. But it seems that I can't adress them because there are multiple effect_groups, these two don't work:

 

<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@value='0']/passive_effect[@value='.5']/@value">0.005</set>

<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@value='1']/passive_effect/@value">0.004</set>

(The values are that low to test if it certainly works.)

 

Is there a solution besides removing the complete buff and appending buffs with the modded one?

Link to comment
Share on other sites

I modified it slightly, but am at work so cant test to make sure it functions right

 

<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@name='ProgressionLevel' and @value='0']/passive_effect[@value='.5']/@value">0.005</set>
<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@name='ProgressionLevel' and @value='1']/passive_effect[@value='.4']/@value">0.004</set>
<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@name='ProgressionLevel' and @value='2']/passive_effect[@value='.3']/@value">0.003</set>
<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@name='ProgressionLevel' and @value='3']/passive_effect[@value='.2']/@value">0.002</set>
<set xpath="/buffs/buff[@name='buffReloadMovementPenalty']/effect_group/requirement[@name='ProgressionLevel' and @value='4']/passive_effect[@value='.1']/@value">0.001</set>

Link to comment
Share on other sites

Do servers send the modlets to clients that connect?

 

Modlets really seems to open the door for proper steam workshop support. Has there been any dev comments on this?

 

Devs have added all these hooks. And I believe it's being prepped for proper workshop support. However, they did say that workshop support would probably be post-gold.

 

Until then, we get to play with the hooks, and we'll design a gap-solution so we can easily find and install mods.

 

And yes, servers should be pushing all XML-based modlets. They still won't push icons though.

Link to comment
Share on other sites

Ok, trying to expand and adapt Guppy's BM mod for a17 since a lot of my players are complaining about running out of zeds.

 

Basically, I want to re-add that 4th line in that has been removed in a17, but I want to customize it for each gamestage.

 

Looking at the stock feed, stages 1, 2, 4, 7 only have one line. Stages 10, 13, 16, and 19 have two lines. The rest only have three lines.

 

So I wanted to start with stage 23, and add a 4th line to each of them.

 

Initially I'm thinking to add in groups like 23-153 will get <spawn group="ZombiesNight" num="10" maxAlive="8"/>, and step them up in groups like that.

 

Looking at the example, <set xpath="/gamestages/spawner[@name=BloodMoonHorde]/*/spawn[4]/@maxAlive">50</set>

I need to select gamestage lines specifically.

 

What I theorized would work is....

<append xpath="/gamestages/spawner[@name=BloodMoonHorde] and [@stage=23]/*/spawn[4]/"><spawn group="ZombiesNight" num="10" maxAlive="8"/></append>

 

I'll need to make a line for each one unless I can set a range to the stage, but I'm fine with that. :)

Link to comment
Share on other sites

Ok, trying to expand and adapt Guppy's BM mod for a17 since a lot of my players are complaining about running out of zeds.

 

Basically, I want to re-add that 4th line in that has been removed in a17, but I want to customize it for each gamestage.

 

Looking at the stock feed, stages 1, 2, 4, 7 only have one line. Stages 10, 13, 16, and 19 have two lines. The rest only have three lines.

 

So I wanted to start with stage 23, and add a 4th line to each of them.

 

Initially I'm thinking to add in groups like 23-153 will get <spawn group="ZombiesNight" num="10" maxAlive="8"/>, and step them up in groups like that.

 

Looking at the example, <set xpath="/gamestages/spawner[@name=BloodMoonHorde]/*/spawn[4]/@maxAlive">50</set>

I need to select gamestage lines specifically.

 

What I theorized would work is....

<append xpath="/gamestages/spawner[@name=BloodMoonHorde] and [@stage=23]/*/spawn[4]/"><spawn group="ZombiesNight" num="10" maxAlive="8"/></append>

 

I'll need to make a line for each one unless I can set a range to the stage, but I'm fine with that. :)

 

This is a completely theoretical few lines, but may get you on the right track:

 

<!-- Remove all 4th lines so start off fresh -->
<remove xpath="/gamestages/spawn[@name='BloodMoonHorde']/spawn[4]" />

<!-- Let's add a potential range for the stage variable. Since we aren't access the attribute itself, but the value, I think we can drop the @ -->
<append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage > 23 and stage < 153]" />
    <spawn group="ZombiesNight" num="10" maxAlive="8"/>
</append>

<append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage >  153]" />
    <spawn group="ZombiesNight" num="10" maxAlive="666"/>
</append>

Link to comment
Share on other sites

Can I append an attribute to element.

For example:

from this

<attribute name="attPerception" name_key="attPerceptionName" desc_key="attPerceptionDesc" icon="ui_game_symbol_stealth">

to this

<attribute name="attPerception" [b]max_level="1000"[/b] name_key="attPerceptionName" desc_key="attPerceptionDesc" icon="ui_game_symbol_stealth">

I want to do this with every <attribute>

Or I have to replace the whole line. (Can I? I have to replace the whole element with it's sub-elements, don't I?)

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

Can I append an attribute to element.

For example:

from this

<attribute name="attPerception" name_key="attPerceptionName" desc_key="attPerceptionDesc" icon="ui_game_symbol_stealth">

to this

<attribute name="attPerception" [b]max_level="1000"[/b] name_key="attPerceptionName" desc_key="attPerceptionDesc" icon="ui_game_symbol_stealth">

I want to do this with every <attribute>

Or I have to replace the whole line. (Can I? I have to replace the whole element with it's sub-elements, don't I?)

 

We've tried a few ways, and so far haven't figured out how to remove or add a new attribute yet. I think the intention is for us to do so, so it may just be an unimplemented feature so far.

 

Until we get that, we'll have to replace entire lines.

Link to comment
Share on other sites

This is a completely theoretical few lines, but may get you on the right track:

 

<!-- Remove all 4th lines so start off fresh -->
<remove xpath="/gamestages/spawn[@name='BloodMoonHorde']/spawn[4]" />

<!-- Let's add a potential range for the stage variable. Since we aren't access the attribute itself, but the value, I think we can drop the @ -->
<append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage > 23 and stage < 153]" />
    <spawn group="ZombiesNight" num="10" maxAlive="8"/>
</append>

<append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage >  153]" />
    <spawn group="ZombiesNight" num="10" maxAlive="666"/>
</append>

Yeah, that throws an error here....

<append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage > 23 and stage < 153]">

 

If I leave it at <append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage > 23]">, then it just errors out in a later line.

 

So looks like I'll need to just make one for each line. Which is fine. I can toss something together in Excel to do that.

Link to comment
Share on other sites

Also, any idea why a modlet would work on Windows SP/MP, and Windows Dedi, but NOT work on Linux dedi?

 

I have this one I've been working on for my servers. All local tests are working perfect. Toss it onto my Linux dedi, and it's like it's not there. Zero errors in the log. In fact, it's even listed as loading. Yet none of the blocks from the mod exist in game.

 

First I thought it might be order, or some other mod interfering because I didn't have everything on my test machine that I did on the live server. Can't find a single issue. No matter the load order, or what other mods are on, it works in Windows, and not on the Linux server.

 

I'm already going bald, so losing more hair over this silliness isn't great. :strawberry:

Link to comment
Share on other sites

Yeah, that throws an error here....

<append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage > 23 and stage < 153]">

 

If I leave it at <append xpath="/gamestages/spawn[@name='BloodMoonHorde' and stage > 23]">, then it just errors out in a later line.

 

So looks like I'll need to just make one for each line. Which is fine. I can toss something together in Excel to do that.

 

The angle brackets and syntax needed to be escaped; Sorry about that. You can just duplicate the appends and clip the conditions around until you get everything you want.

<configs>
<!-- Updates the Game stages, under the BloodMoonHorde, to change the maxAlive to 50 for all nodes -->
<!-- By default, it only looks at the the game stages that have a 4 element into it, so it doesn't kick in until gamestage 23 -->
<remove xpath="/gamestages/spawner[@name='BloodMoonHorde']/*/spawn[4]" />
<append xpath='/gamestages/spawner[@name="BloodMoonHorde"]/gamestage[ @stage >23 and @stage<153]' >
	<spawn group="ZombiesNight" num="10" maxAlive="8"/>
</append>
</configs>

 

 

Produces:

	<gamestage stage="23">
		<spawn group="feralHordeStageGS16" num="22" maxAlive="9" duration="1" interval="28" />
		<spawn group="feralHordeStageGS19" num="22" maxAlive="9" duration="1" interval="14" />
		<spawn group="feralHordeStageGS23" num="22" maxAlive="9" duration="1" />
	</gamestage>
	<gamestage stage="27">
		<spawn group="feralHordeStageGS19" num="23" maxAlive="11" duration="1" interval="21" />
		<spawn group="feralHordeStageGS23" num="23" maxAlive="11" duration="1" interval="30" />
		<spawn group="feralHordeStageGS27" num="23" maxAlive="11" duration="1" />
		<spawn group="ZombiesNight" num="10" maxAlive="8">
			<!--Element appended by: "Guppycur's BloodMoonTickle"-->
		</spawn>
	</gamestage>

Link to comment
Share on other sites

Also, any idea why a modlet would work on Windows SP/MP, and Windows Dedi, but NOT work on Linux dedi?

 

I have this one I've been working on for my servers. All local tests are working perfect. Toss it onto my Linux dedi, and it's like it's not there. Zero errors in the log. In fact, it's even listed as loading. Yet none of the blocks from the mod exist in game.

 

First I thought it might be order, or some other mod interfering because I didn't have everything on my test machine that I did on the live server. Can't find a single issue. No matter the load order, or what other mods are on, it works in Windows, and not on the Linux server.

 

I'm already going bald, so losing more hair over this silliness isn't great. :strawberry:

 

 

What about your case sensitive on your folder and files names? The Config folder structure needs to match the case exactly.

 

Do you see that the mod is loaded in your output?

Link to comment
Share on other sites

Hi Every one, I'm trying to add a chemist perk that will add 7 new skills and recipes at different levels

 

Perk= chemist

 

skills= Adrenaline_Syringe , ZombrexTablets , EnergyDrink , Health_Syringe , F15PurificationPill , SpeedCapsules , CalciumTablets

they can be moved around

and with the attribute attIntellect. any help would be great thanks

 

 

and the line to add a new item and recipes. thanks in advance.

Link to comment
Share on other sites

What about your case sensitive on your folder and files names? The Config folder structure needs to match the case exactly.

 

Do you see that the mod is loaded in your output?

Yes, it's listed as loaded in the server output log, and also in the client connecting to the server. Case hasn't changed between Windows and Linux as I just direct copied the folders over, and then corrected permissions for the server to use them.

 

I even though maybe it was because I had a couple of spaces in the folder name, but other mods with spaces in the folder are working without an issue.

 

It's got me completely baffled because based on all available data, the blocks should be in the game. Yet they aren't.

 

 

Update: Tested replacing the spaces in the folder names with _, and it's still an issue.

 

I'm sure eventually I'll figure it out and just facepalm.

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

Yes, it's listed as loaded in the server output log, and also in the client connecting to the server. Case hasn't changed between Windows and Linux as I just direct copied the folders over, and then corrected permissions for the server to use them.

 

I even though maybe it was because I had a couple of spaces in the folder name, but other mods with spaces in the folder are working without an issue.

 

It's got me completely baffled because based on all available data, the blocks should be in the game. Yet they aren't.

 

 

Update: Tested replacing the spaces in the folder names with _, and it's still an issue.

 

I'm sure eventually I'll figure it out and just facepalm.

 

Which modlet is it? maybe I can spot something.

Link to comment
Share on other sites

Hi Every one, I'm trying to add a chemist perk that will add 7 new skills and recipes at different levels

 

Perk= chemist

 

skills= Adrenaline_Syringe , ZombrexTablets , EnergyDrink , Health_Syringe , F15PurificationPill , SpeedCapsules , CalciumTablets

they can be moved around

and with the attribute attIntellect. any help would be great thanks

 

 

and the line to add a new item and recipes. thanks in advance.

 

Can you show us what XML code you want, and where you'd like to see it?

Link to comment
Share on other sites

Which modlet is it? maybe I can spot something.

It's a new admin block I'm making, which I may port into something else for the public. I figured it out, and it was just me missing a step. Didn't use recursive on changing permissions so the xml files were still owned by root. There wasn't any error for files it couldn't access, it just ignored them. So it was loading an empty mod.

Link to comment
Share on other sites

It's a new admin block I'm making, which I may port into something else for the public. I figured it out, and it was just me missing a step. Didn't use recursive on changing permissions so the xml files were still owned by root. There wasn't any error for files it couldn't access, it just ignored them. So it was loading an empty mod.

 

Great to hear you got sorted out. Good luck with your modlet.

Link to comment
Share on other sites

Thank you sphereii for this nice tutorial !

 

 

Can I append an attribute to element.

For example:

from this

<attribute name="attPerception" name_key="attPerceptionName" desc_key="attPerceptionDesc" icon="ui_game_symbol_stealth">

to this

<attribute name="attPerception" [b]max_level="1000"[/b] name_key="attPerceptionName" desc_key="attPerceptionDesc" icon="ui_game_symbol_stealth">

I want to do this with every <attribute>

Or I have to replace the whole line. (Can I? I have to replace the whole element with it's sub-elements, don't I?)

 

You can add/modify an attribute with the setattribute command:

<setattribute xpath="[color="#FF0000"]PATH[/color]" name="[color="#FF0000"]ATTRIBUTE_NAME[/color]">[color="#FF0000"]VALUE[/color]</setattribute>

 

Example:

<setattribute xpath="/progression/attributes/attribute[@name='attPerception']" name="max_level">1000</setattribute>

 

 

It might be possible to remove an attribute with the remove command, but so far I got only NullReferenceExceptions with my tests.

 

Edit: the nullref is unavoidable using the remove command with an attribute.

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

Thank you sphereii for this nice tutorial !

 

 

 

 

You can add/modify an attribute with the setattribute command:

<setattribute xpath="[color="#FF0000"]PATH[/color]" name="[color="#FF0000"]ATTRIBUTE_NAME[/color]">[color="#FF0000"]VALUE[/color]</setattribute>

 

Example:

<setattribute xpath="/progression/attributes/attribute[@name='attPerception']" name="max_level">1000</setattribute>

 

 

It might be possible to remove an attribute with the remove command, but so far I got only NullReferenceExceptions with my tests.

 

That's a new one for me! Thank you! I'll add it as an example.

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