Bladestorm Games
Refugee
Hey, been a while since I messed with 7D2D modding, and I've ran into a roadblock and tried a lot of tests to make this work.
I am trying to make it so when mining Iron, Lead, Nitrate, Coal, and Oil, the player has a chance to get a custom item "itemResourceTest".
I specifically want this item to be gained from non-motor tools, so Stone Axe, Iron Pickaxe, Steel Pickaxe.
But also allowing motor tools (Auger) to have a small chance to get the custom item.
So I've made the tag "itemFromPickaxe" and "itemFromAuger"
My items.xml code looks like this:
And my blocks.xml looks like this:
I can somewhat confirm blocks.xml isnt the main issue because these work:
I've also tried a few different methods for adding and testing the custom tag:
So im thinking 2 issues:
ONE: The tag is not being properly added.
TWO: The game does NOT read from the weapon's tags you're holding while mining? Instead looks at character's tags / stats (When looking at vanila blocks.xml the tag "artOfMiningLuckyStrikeHarvest" works for harvesting silver, gold, diamonds. if applying that tag to custom item, it works)
I am trying to make it so when mining Iron, Lead, Nitrate, Coal, and Oil, the player has a chance to get a custom item "itemResourceTest".
I specifically want this item to be gained from non-motor tools, so Stone Axe, Iron Pickaxe, Steel Pickaxe.
But also allowing motor tools (Auger) to have a small chance to get the custom item.
So I've made the tag "itemFromPickaxe" and "itemFromAuger"
My items.xml code looks like this:
XML:
<Configs>
<!-- Add Custom Tag -->
<append xpath="/items/item[@name='meleeToolRepairT0StoneAxe']/property[@name='Tags']" value=",itemFromPickaxe"/>
<append xpath="/items/item[@name='meleeToolPickT1IronPickaxe']/property[@name='Tags']" value=",itemFromPickaxe"/>
<append xpath="/items/item[@name='meleeToolPickT2SteelPickaxe']/property[@name='Tags']" value=",itemFromPickaxe"/>
<!-- Custom Item -->
<append xpath="/items">
<item name="itemResourceTest">
<property name="Extends" value="noteTestersDelightAdmin"/>
<property name="CreativeMode" value="Player"/>
<property name="CustomIcon" value="itemResourceTest"/>
<property name="ItemTypeIcon" value="bundle"/>
<property name="DescriptionKey" value="itemResourceTest_Desc"/>
<property class="Action0">
<property name="Random_item" value="resourceSilverNugget,resourceGoldNugget,resourceRawDiamond/>
<property name="Random_item_count" value="1"/>
<property name="Random_count" value="1"/>
<property name="Unique_random_only" value="true"/>
</property>
</item>
</append>
</Configs>
And my blocks.xml looks like this:
XML:
<Configs>
<!-- Gained from Pickaxe -->
<append xpath="blocks/block[@name='terrOreIron' or @name='terrOreLead' or @name='terrOreCoal' or @name='terrOrePotassiumNitrate' or @name='terrOreOilDeposit']">
<drop event="Harvest" name="itemResourceTest" count="1" tag="itemFromPickaxe"/>
</append>
</Configs>
I can somewhat confirm blocks.xml isnt the main issue because these work:
XML:
<Configs>
<!-- Working -->
<append xpath="blocks/block[@name='terrOreIron' or @name='terrOreLead' or @name='terrOreCoal' or @name='terrOrePotassiumNitrate' or @name='terrOreOilDeposit']">
<drop event="Harvest" name="itemResourceTest" count="1" tag="oreWoodHarvest" />
</append>
<!-- Working -->
<append xpath="blocks/block[@name='terrOreIron' or @name='terrOreLead' or @name='terrOreCoal' or @name='terrOrePotassiumNitrate' or @name='terrOreOilDeposit']">
<drop event="Harvest" name="itemResourceTest" count="1" />
</append>
</Configs>
I've also tried a few different methods for adding and testing the custom tag:
XML:
<Configs>
<!-- Add tags to Minning Tools -->
<!-- Doesnt work or doesnt work with Blocks.xml -->
<!-- Attempt to add a tag to existing tags -->
<!--
<append xpath="/items/item[@name='meleeToolRepairT0StoneAxe']/property[@name='Tags']" value=",itemFromPickaxe"/>
<append xpath="/items/item[@name='meleeToolPickT1IronPickaxe']/property[@name='Tags']" value=",itemFromPickaxe"/>
<append xpath="/items/item[@name='meleeToolPickT2SteelPickaxe']/property[@name='Tags']" value=",itemFromPickaxe"/>
-->
<!-- Doesnt work or doesnt work with Blocks.xml -->
<!-- Alternate Attempt to add a tag to existing tags -->
<!--
<append xpath="/items/item[@name='meleeToolRepairT0StoneAxe']/property[@name='Tags']/@value">
,itemFromPickaxe
</append>
<append xpath="/items/item[@name='meleeToolPickT1IronPickaxe']/property[@name='Tags']/@value">
,itemFromPickaxe
</append>
<append xpath="/items/item[@name='meleeToolPickT2SteelPickaxe']/property[@name='Tags']/@value">
,itemFromPickaxe
</append>
-->
<!-- Doesnt work or doesnt work with Blocks.xml -->
<!-- Recreate tags with custom tag included -->
<!--
<set xpath="/items/item[@name='meleeToolRepairT0StoneAxe']/property[@name='Tags']/@value">
melee,grunting,medium,tool,longShaft,attStrength,perkMiner69r,perkMotherLode,miningTool,canHaveCosmetic,harvestingSkill,itemFromPickaxe
</set>
<set xpath="/items/item[@name='meleeToolPickT1IronPickaxe']/property[@name='Tags']/@value">
melee,grunting,medium,tool,longShaft,attStrength,perkMiner69r,perkMotherLode,miningTool,canHaveCosmetic,harvestingSkill,itemFromPickaxe
</set>
<set xpath="/items/item[@name='meleeToolPickT2SteelPickaxe']/property[@name='Tags']/@value">
melee,grunting,medium,tool,longShaft,attStrength,perkMiner69r,perkMotherLode,miningTool,canHaveCosmetic,harvestingSkill,itemFromPickaxe
</set>
-->
</Configs>
So im thinking 2 issues:
ONE: The tag is not being properly added.
TWO: The game does NOT read from the weapon's tags you're holding while mining? Instead looks at character's tags / stats (When looking at vanila blocks.xml the tag "artOfMiningLuckyStrikeHarvest" works for harvesting silver, gold, diamonds. if applying that tag to custom item, it works)