I'm familiar with tweaking the contents of XML files from various games, however, I want to take my changes and package them as a mod. To my understanding, this requires some "set xpath="..." method or I have to remove the nodes I want to modify and use a node like "<insertAfter/> with all of my modified changes.
So far, neither has worked without complications; and I don't like to remove existing nodes because there could compatibility problems with mods. The syntax for the XPath method evades me and with so many tiny changes it is extremely tedious and inefficient.
Here's what I'm doing to the loot.xml:
1. Adding a chance for items to have certain mods.
2. Adding chances for containers to contain higher amounts of loot.
3. Adding chances for containers to have more loot in their inventory slots than they might otherwise
For example:
1. Making the Beretta have a 15% chance to have a mod. (Also, this is just an example, but I want to do this for every item that can have mods)
<item name="gunHandgunT1Pistol" mods="barrelAttachments,sideAttachments,smallTopAttachments,scope,trigger" mod_chance=".15"/>
2. In this example, just making the book piles that normally have 1-5 paper instead have 1 to 50, but at a reduced chance for the higher amounts.
<lootgroup name="groupBookPile01">
<item name="resourcePaper" count="1,5" loot_prob_template="high"/>
<item name="resourcePaper" count="5,15" loot_prob_template="medHigh"/>
<item name="resourcePaper" count="15,25" loot_prob_template="med"/>
<item name="resourcePaper" count="25,50" loot_prob_template="medLow"/>
</lootgroup>
3. In this example, I just want more books/schematics of various types, but at a lower probability for each additional book. The thing is, I want to modify almost every loot group to allow containers to have more loot in each slot, including more varied loot at a reduced chance for each additional slot having loot.
So far, neither has worked without complications; and I don't like to remove existing nodes because there could compatibility problems with mods. The syntax for the XPath method evades me and with so many tiny changes it is extremely tedious and inefficient.
Here's what I'm doing to the loot.xml:
1. Adding a chance for items to have certain mods.
2. Adding chances for containers to contain higher amounts of loot.
3. Adding chances for containers to have more loot in their inventory slots than they might otherwise
For example:
1. Making the Beretta have a 15% chance to have a mod. (Also, this is just an example, but I want to do this for every item that can have mods)
<item name="gunHandgunT1Pistol" mods="barrelAttachments,sideAttachments,smallTopAttachments,scope,trigger" mod_chance=".15"/>
2. In this example, just making the book piles that normally have 1-5 paper instead have 1 to 50, but at a reduced chance for the higher amounts.
<lootgroup name="groupBookPile01">
<item name="resourcePaper" count="1,5" loot_prob_template="high"/>
<item name="resourcePaper" count="5,15" loot_prob_template="medHigh"/>
<item name="resourcePaper" count="15,25" loot_prob_template="med"/>
<item name="resourcePaper" count="25,50" loot_prob_template="medLow"/>
</lootgroup>
3. In this example, I just want more books/schematics of various types, but at a lower probability for each additional book. The thing is, I want to modify almost every loot group to allow containers to have more loot in each slot, including more varied loot at a reduced chance for each additional slot having loot.
Code:
<lootgroup name="groupBookPile02">
<item group="booksAllScaled"/>
</lootgroup>
<lootgroup name="groupBookPile" count="all">
<item group="groupBookPile01" count="1"/>
<item group="groupBookPile02" loot_prob_template="high" force_prob="true"/>
<item group="groupBookPile02" loot_prob_template="medHigh" force_prob="true"/>
<item group="groupBookPile02" loot_prob_template="med" force_prob="true"/>
<item group="groupBookPile02" loot_prob_template="medLow" force_prob="true"/>
<item group="groupBookPile02" loot_prob_template="low" force_prob="true"/>
<item group="groupBookPile02" loot_prob_template="veryLow" force_prob="true"/>
</lootgroup>
Last edited by a moderator: