Jump to content

XML: Is it possible to add attributes to a node?


Calico

Recommended Posts

My goal here is to add damage to tier progression in melee weapons.

e.g. A tier 1 stone spear would have 12 entity damage, and a tier 2 stone spear would have 13 entity damage.

	<effect_group name="meleeWpnSpearT0StoneSpear">
		<passive_effect name="EntityDamage" operation="base_set" value="10.3" tags="perkJavelinMaster"/> <!-- meleeWpnSpearT0StoneSpear -->
		<passive_effect name="ModSlots" operation="base_set" value="1,1,2,2,3,4" tier="1,2,3,4,5,6"/>
	</effect_group>

As you can see, ModSlots works much the same way I want damage to work, but EntityDamage does not have the "tier" attribute.

 

now I've been looking around at some posts for this for a while. Even studied basic XML (for not-video games). I can't find anything that will help me with what I currently know about modding 7 Days to Die. I know I use <set xpath>value</set>  or <setattribute> etc etc ..  for everything I've done so far. I don't edit the vanilla files because I want to share this mod with people.

Please help, and thank you!

Link to comment
Share on other sites

It's possible that I didn't understand, but your question seems simple:

 

<passive_effect name="EntityDamage" operation="base_set" value="12,17" tier="1,6"/>

you just need to choose what will depend on your damage - from tier or from perk

Link to comment
Share on other sites

This segues into another question I have about this board in general...  what would the xpath line look like? I see everyone throwing around code from the vanilla xml files, but nobody seems to be using <set or <setattribute or <append or anything. Is everyone editing their vanilla xml???

Link to comment
Share on other sites

5 hours ago, Calico said:

This segues into another question I have about this board in general...  what would the xpath line look like? I see everyone throwing around code from the vanilla xml files, but nobody seems to be using <set or <setattribute or <append or anything. Is everyone editing their vanilla xml???

Obviously not. People who want to share their mods with the others must use xpath to make sure their mods do not interfere with the vanilla files or with other mods. Well, at least to a certain point. Obviously two different mods that change your forge workstation in two different ways will not work together too well anyway...

 

If you want to learn xpath, the best start would be in XPath Modding Explanation Thread

 

Good luck!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...