Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

right. is it because they are 2 different item rather than 2 of the item in 1 group?

 

It's just the condition you set up. You want to change any item with this name, or this other name.

 

Other conditions would be I want to change an item with a property called extends and a value called meleeShiv, for example.

Link to comment
Share on other sites

Is it possible to add something to localization.txt? maybe like

 

<append xpath="">
NEWITEMDesc,items,Tool,KgNone,random description.,,,,,
</append>

 

Ive another doubt although it's not a xpath one, but which property I add to give my new item a nickname? property DescriptionKey is the description tab text, which works when I manually edit localization. But I cant figure it out how to change the name, it shows the raw name in-game.

 

Thanks

Link to comment
Share on other sites

I want to change the value in this and having issues I am just trying to change only the reset_interval value

 

<trader_info id="1" min_inventory="40" max_inventory="120" min_items_swapped="20" 
	max_items_swapped="20" reset_interval="1" open_time="6:05" close_time="21:50">

I know I am missing something or it's not correct.

<configs>
<set xpath="traders/trader_item_groups/trader_info[@id='1']/@reset_interval">1</set>
</configs>

 

------- Figured it out ---------

<set xpath="traders/trader_info[@id='1']/@reset_interval">1</set>

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

Hey everyone :)

 

i used my new attribute to increased EXP Gain Rate

<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"/>

 

now i want, thats the Bonus XP only applied on Killing Enemys would it be enough to add just behind the level="XY"

 tag="zombie,walker,feral,radiated,hostile,animal"

 

and would looks like:

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.35" level="1,9" tag="zombie,walker,feral,radiated,hostile,animal"/>
		<passive_effect name="PlayerExpGain" operation="perc_add" value="1.5" level="10"tag="zombie,walker,feral,radiated,hostile,animal"/>

 

works this xD ?

 

- - - Updated - - -

 

Hey everyone :)

 

i used my new attribute to increased EXP Gain Rate

<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"/>

 

now i want, thats the Bonus XP only applied on Killing Enemys would it be enough to add just behind the level="XY"

 tag="zombie,walker,feral,radiated,hostile,animal"

 

and would looks like:

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.35" level="1,9" tag="zombie,walker,feral,radiated,hostile,animal"/>
<passive_effect name="PlayerExpGain" operation="perc_add" value="1.5" level="10"tag="zombie,walker,feral,radiated,hostile,animal"/>

 

works this xD ?

Link to comment
Share on other sites

So another question with how do I skip to white river citizen 1 after crafting bedrolls? I guess I really don't understand how it should work :upset:

 

<set xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@type='Quest']/@value">quest_whiteRiverCitizen1</set>

 

 

I tried using remove earlier and it just doesn't load the mod.

<remove xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@type='Quest']/@id="quest_whiteRiverCitizen1" /> 

Link to comment
Share on other sites

So another question with how do I skip to white river citizen 1 after crafting bedrolls? I guess I really don't understand how it should work :upset:

 

<set xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@type='Quest']/@value">quest_whiteRiverCitizen1</set>

 

 

I tried using remove earlier and it just doesn't load the mod.

<remove xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@type='Quest']/@id="quest_whiteRiverCitizen1" /> 

 

Take a look at Red Eagle LXIX's work: https://7daystodie.com/forums/showthread.php?94219-Red-Eagle-LXIX-s-A17-Modlet-Collection-(UI-Blocks-Quests)

 

- - - Updated - - -

 

Hey everyone :)

 

i used my new attribute to increased EXP Gain Rate

<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"/>

 

now i want, thats the Bonus XP only applied on Killing Enemys would it be enough to add just behind the level="XY"

 tag="zombie,walker,feral,radiated,hostile,animal"

 

and would looks like:

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.35" level="1,9" tag="zombie,walker,feral,radiated,hostile,animal"/>
		<passive_effect name="PlayerExpGain" operation="perc_add" value="1.5" level="10"tag="zombie,walker,feral,radiated,hostile,animal"/>

 

works this xD ?

 

- - - Updated - - -

 

Hey everyone :)

 

i used my new attribute to increased EXP Gain Rate

<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"/>

 

now i want, thats the Bonus XP only applied on Killing Enemys would it be enough to add just behind the level="XY"

 tag="zombie,walker,feral,radiated,hostile,animal"

 

and would looks like:

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.35" level="1,9" tag="zombie,walker,feral,radiated,hostile,animal"/>
<passive_effect name="PlayerExpGain" operation="perc_add" value="1.5" level="10"tag="zombie,walker,feral,radiated,hostile,animal"/>

 

works this xD ?

 

I'm sorry, I'm not clear on what you are looking for.

 

Is this the new code you want to add?

 

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.35" level="1,9" tag="zombie,walker,feral,radiated,hostile,animal"/>
<passive_effect name="PlayerExpGain" operation="perc_add" value="1.5" level="10"tag="zombie,walker,feral,radiated,hostile,animal"/>

 

If so, which file and location did you want to add it?

Link to comment
Share on other sites

Happy Xmas Sphereii.

 

ok lets focus on the line:

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.5" level="1,10"

This is the Passive effect of my "Attribute".

 

The Issue here is:

PlayerExpGain applied on every EXP Source, like Chopping trees, Digging holes in dirt and Stone, Selling items and using console command for exp...

At the Point where i sold large amount of Stuff to traders, ridiculous amount of EXP appears and even if the worth of exp grows over 65k its goes into an infinite amount of EXP which skipped the char to th LV Cap.

 

What i want to do is. Set the Passive_effect to only trigger when the player kills Animals and Zombies. No more Exp Bonus for Console commands, Chopping trees or other works, or for Trading - and so on... only Exp bonus for Killing Animals and Zombies.

 

I Also tryied things like: -spoiler- DONT WORKS

<effect_group>
<requirement name="onSelfAttackedOther" target="other" target_tags="zombie,animal"/>
<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.5" level="1,10" target="self"/>
</effect_group>

 

would be grateful for any solution.

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

Happy Xmas Sphereii.

 

ok lets focus on the line:

<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.5" level="1,10"

This is the Passive effect of my "Attribute".

 

The Issue here is:

PlayerExpGain applied on every EXP Source, like Chopping trees, Digging holes in dirt and Stone, Selling items and using console command for exp...

At the Point where i sold large amount of Stuff to traders, ridiculous amount of EXP appears and even if the worth of exp grows over 65k its goes into an infinite amount of EXP which skipped the char to th LV Cap.

 

What i want to do is. Set the Passive_effect to only trigger when the player kills Animals and Zombies. No more Exp Bonus for Console commands, Chopping trees or other works, or for Trading - and so on... only Exp bonus for Killing Animals and Zombies.

 

I Also tryied things like: -spoiler- DONT WORKS

<effect_group>
<requirement name="onSelfAttackedOther" target="other" target_tags="zombie,animal"/>
<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.5" level="1,10" target="self"/>
</effect_group>

 

would be grateful for any solution.

 

I think we can come up with a solution. When you say passive effect on your attribute, which file is your attribute at, what what's it called?

Link to comment
Share on other sites

<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="reqPlayerAndPoint1"/></level_requirements>
	<level_requirements level="2"><requirement name="PlayerLevel" target="self" operation="GTE" value="3" desc_key="reqPlayerAndPoint2"/></level_requirements>
	<level_requirements level="3"><requirement name="PlayerLevel" target="self" operation="GTE" value="5" desc_key="reqPlayerAndPoint3"/></level_requirements>
	<level_requirements level="4"><requirement name="PlayerLevel" target="self" operation="GTE" value="10" desc_key="reqPlayerAndPoint4"/></level_requirements>
	<level_requirements level="5"><requirement name="PlayerLevel" target="self" operation="GTE" value="15" desc_key="reqPlayerAndPoint5"/></level_requirements>
	<level_requirements level="6"><requirement name="PlayerLevel" target="self" operation="GTE" value="20" desc_key="reqPlayerAndPoint6"/></level_requirements>
	<level_requirements level="7"><requirement name="PlayerLevel" target="self" operation="GTE" value="25" desc_key="reqPlayerAndPoint7"/></level_requirements>
	<level_requirements level="8"><requirement name="PlayerLevel" target="self" operation="GTE" value="30" desc_key="reqPlayerAndPoint8"/></level_requirements>
	<level_requirements level="9"><requirement name="PlayerLevel" target="self" operation="GTE" value="40" desc_key="reqPlayerAndPoint9"/></level_requirements>
	<level_requirements level="10"><requirement name="PlayerLevel" target="self" operation="GTE" value="50" desc_key="reqPlayerAndPoint10"/></level_requirements>
		<effect_group>
		<passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.5" level="1,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_description level="6" desc_key="attLuckRank6Desc"/>
		<effect_description level="7" desc_key="attLuckRank7Desc"/>
		<effect_description level="8" desc_key="attLuckRank8Desc"/>
		<effect_description level="9" desc_key="attLuckRank9Desc"/>
		<effect_description level="10" desc_key="attLuckRank10Desc"/>

		</effect_group>
</attribute>

 

Its a part of my "Progression.xml"

Link to comment
Share on other sites

Try something like this. It'll add your new passive_effect to the effect_group of the attribute attLuck

 

<append xpath="/progression/attributes/attribute[@name='attLuck']/effect_group" >
         <passive_effect name="PlayerExpGain" operation="perc_add" value="0.15,1.5" level="1,10"
</append>

Link to comment
Share on other sites

The passive it selfs works fine, and don't need to be add to luck, cuz its already a part of the attribute Luck....

 

but again :)

The passive works with the effect of giving Percentage Bonus XP. My Main Issue there is, thats these Percentage Bonus XP apllied on each kind of EXP i gained. I would reduced this to the Source of Killing Enemys(Zombies,Animals). I dont want gain Percentage more XP by Working, Upgrading or Trading. I need to reduce the PlayerGainExp effect only on Killing Zombies, Animals....

Link to comment
Share on other sites

Ok here's a doosy for you all..

 

Changing a value that has two seperate values, such as

 

<Temperature min="-60" max="-30" prob="1"/>

 

to change both the min and the max .. I cannot for the life of me figure the correct syntax for the <set>.. I've tried using <append>, nothing happened. Tried the contains, still no go.

 

Any ideas?

Link to comment
Share on other sites

Ok here's a doosy for you all..

 

Changing a value that has two seperate values, such as

 

<Temperature min="-60" max="-30" prob="1"/>

 

to change both the min and the max .. I cannot for the life of me figure the correct syntax for the <set>.. I've tried using <append>, nothing happened. Tried the contains, still no go.

 

Any ideas?

 

you are overthinking it :)

 

 <!-- Set all global temperatures to be the same range-->
 <set xpath="/worldgeneration/biomes/biome/weather/Temperature/@min">-60</set>
 <set xpath="/worldgeneration/biomes/biome/weather/Temperature/@max">-30</set>

Link to comment
Share on other sites

The passive it selfs works fine, and don't need to be add to luck, cuz its already a part of the attribute Luck....

 

but again :)

The passive works with the effect of giving Percentage Bonus XP. My Main Issue there is, thats these Percentage Bonus XP apllied on each kind of EXP i gained. I would reduced this to the Source of Killing Enemys(Zombies,Animals). I dont want gain Percentage more XP by Working, Upgrading or Trading. I need to reduce the PlayerGainExp effect only on Killing Zombies, Animals....

 

Still no solution for it^^ ?.... can't fix it by my self

Link to comment
Share on other sites

Still no solution for it^^ ?.... can't fix it by my self

 

This thread is about helping people resolve their xpath issues. Perhaps a new thread is more appropriate to get the help you are looking for, which seems to be what needs to be changed to get your desired effect, rather than how to make that change.

Link to comment
Share on other sites

Trying to change Action0 to Action1 and append new Action0 (drinkJar

 

Trying to make the default drink be Right Click, and append the basic punch (unarmed left click) to drinks (currently proof of concept, tweaks to come later)

 

I've tried 2 ways so far (about to head to dinner so I figured I'd bounce it off a few of you)

 

<set xpath="/items/item[starts-with(@name, 'drinkJar') and not(contains(@name, 'Empty'))]/property[@Class='Action0']">Action1</set>

 

 

<set xpath="/items/item[starts-with(@name, 'drinkJar') and not(contains(@name, 'Empty'))]/property[@Class='Action0']/@value">Action1</set>

 

I get a WRN in console but the rest of the mod loads fine.

 

Can I rename the Action0 to Action1 this way and something is wrong in my Syntax or do I have to remove Action0 and then append it with the Action0 from the player hand and Action1 as the normal drink code?

Link to comment
Share on other sites

Trying to make the default drink be Right Click, and append the basic punch (unarmed left click) to drinks (currently proof of concept, tweaks to come later)

 

I've tried 2 ways so far (about to head to dinner so I figured I'd bounce it off a few of you)

 

<set xpath="/items/item[starts-with(@name, 'drinkJar') and not(contains(@name, 'Empty'))]/property[@Class='Action0']">Action1</set>

 

 

<set xpath="/items/item[starts-with(@name, 'drinkJar') and not(contains(@name, 'Empty'))]/property[@Class='Action0']/@value">Action1</set>

 

I get a WRN in console but the rest of the mod loads fine.

 

Can I rename the Action0 to Action1 this way and something is wrong in my Syntax or do I have to remove Action0 and then append it with the Action0 from the player hand and Action1 as the normal drink code?

 

You are using @Class, when it should be @class.

 

Also, @value isn't special; it's just the attribute you want to change. In this case, it's probably: /property[@class=Action0]/@class">Action1</set>

Link to comment
Share on other sites

You are using @Class, when it should be @class.

 

Also, @value isn't special; it's just the attribute you want to change. In this case, it's probably: /property[@class=Action0]/@class">Action1</set>

 

Thanks, I've got it ALMOST working for the drink part using this:

 

<set xpath="/items/item[@name='drinkJarBeer']/property[@class]/@class">Action1</set>
<set xpath="/items/item[@name='drinkJarBeer']/effect_group[@tiered='false']/triggered_effect[@trigger='onSelfPrimaryActionEnd']/@trigger">onSelfSecondaryActionEnd</set>

 

Right Click now drinks, but for some reason, the screen does not give the drunken blur even though I get the Buzzed buff. I can't find anything in the item or buff code tying it specifically to the Primary Action.

 

Thanks again sphereii, and Merry Christmas to you and yours :)

 

EDIT: Apparently Grandpa's Moonshine blurs, but beer buzzed does not. Possibly something that was tweaked in B240?

Edited by METALmurderer (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...