Announcement

Collapse
No announcement yet.

XPath Modding Explanation Thread

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Now I'm back with even more weird problems -.-
    I'm trying to add a item that can be used to repair the different oven/stoves found to a working one based from Valmod.
    The repairitem is added in and can be found in lootlists, but when I try to update an oven it just shows the 'missing item' error (correct one though) even when I have the item on me.
    This is what I have appended in blocks.xml under <append xpath="/blocks">
    Code:
    <block name="workstationOven">
    		<property name="DescriptionKey" value="workstationOvenDesc"/>
    		<property name="Class" value="Campfire" />
    		<property name="CustomIcon" value="cntWallOven" />
    		<property name="Place" value="TowardsPlacerInverted" />
    		<property name="Stacknumber" value="1" />
    		<property name="Material" value="Mwood_weak" />
    		<property name="Texture" value="346,345,341,345,262,345" />
    		<property name="LootList" value="130" />
    		<drop event="Destroy" name="resourceScrapIron" count="5,10" />
    		<drop event="Fall" name="woodDebris" count="1" prob="1.0"  stick_chance=".75" />
    		<property name="HeatMapStrength" value="1"/>
    		<property name="HeatMapTime" value="1200"/>
    		<property name="HeatMapFrequency" value="25"/>
    		<property name="Group" value="Food/Cooking,Decor" />
    		<property name="ActiveRadiusEffects" value="+heatSource(3)"/>
    		<property class="Workstation">
    			<property name="Modules" value="tools,output,input"/>
    			<property name="CraftingAreaRecipes" value="campfire" />
    		</property>
    	</block>
    	</append>	
    	
    	<append xpath="blocks/block[@name='cntWallOven']">
    		<property class="UpgradeBlock">
    		<property name="ToBlock" value="workstationOven"/>
    		<property name="Item" value="ElectricalRepairKit"/>
    		<property name="ItemCount" value="1"/>
    		<property name="UpgradeHitCount" value="5"/>
    	</property>
    	<property name="CustomUpgradeSound" value="place_block_metal" />
    	</append>
    	
    	<append xpath="blocks/block[@name='cntStoveOldVer1Closed']">
    		<property class="UpgradeBlock">
    		<property name="ToBlock" value="workstationOven"/>
    		<property name="Item" value="ElectricalRepairKit"/>
    		<property name="ItemCount" value="1"/>
    		<property name="UpgradeHitCount" value="5"/>
    	</property>
    	<property name="CustomUpgradeSound" value="place_block_metal" />
    	</append>
    And this is the item appended in items.xml
    Code:
    <append xpath="/items">
    	<item name="ElectricalRepairKit">
    	<property name="HoldType" value="45" />
    	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab" />
    	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab" />
    	<property name="Material" value="MresourceScrapIron" />
    	<property name="Weight" value="1" />
    	<property name="Stacknumber" value="25" /> <!-- STK resource -->
    	<property name="EconomicValue" value="10" />
    	<property name="EconomicBundleSize" value="10" />
    	<property name="Group" value="Resources" />
    	<property name="RepairTime" value=".5" />
    	<property name="RepairAmount" value="20" />
    	<property name="CraftingIngredientTime" value=".2" />
    	<property name="CustomIcon" value="resourceRepairKit" />
    	</item>
    </append>
    I tried to change the item to just need resourceScrapIron, and then it worked flawlessly and used one scrapiron, but not with the ElectricalRepairKit. All the items are loaded and looks correct in the configdump xmls

    Comment


      Originally posted by -Holo- View Post
      Now I'm back with even more weird problems -.-
      I'm trying to add a item that can be used to repair the different oven/stoves found to a working one based from Valmod.
      The repairitem is added in and can be found in lootlists, but when I try to update an oven it just shows the 'missing item' error (correct one though) even when I have the item on me.
      This is what I have appended in blocks.xml under <append xpath="/blocks">
      Code:
      <block name="workstationOven">
      		<property name="DescriptionKey" value="workstationOvenDesc"/>
      		<property name="Class" value="Campfire" />
      		<property name="CustomIcon" value="cntWallOven" />
      		<property name="Place" value="TowardsPlacerInverted" />
      		<property name="Stacknumber" value="1" />
      		<property name="Material" value="Mwood_weak" />
      		<property name="Texture" value="346,345,341,345,262,345" />
      		<property name="LootList" value="130" />
      		<drop event="Destroy" name="resourceScrapIron" count="5,10" />
      		<drop event="Fall" name="woodDebris" count="1" prob="1.0"  stick_chance=".75" />
      		<property name="HeatMapStrength" value="1"/>
      		<property name="HeatMapTime" value="1200"/>
      		<property name="HeatMapFrequency" value="25"/>
      		<property name="Group" value="Food/Cooking,Decor" />
      		<property name="ActiveRadiusEffects" value="+heatSource(3)"/>
      		<property class="Workstation">
      			<property name="Modules" value="tools,output,input"/>
      			<property name="CraftingAreaRecipes" value="campfire" />
      		</property>
      	</block>
      	</append>	
      	
      	<append xpath="blocks/block[@name='cntWallOven']">
      		<property class="UpgradeBlock">
      		<property name="ToBlock" value="workstationOven"/>
      		<property name="Item" value="ElectricalRepairKit"/>
      		<property name="ItemCount" value="1"/>
      		<property name="UpgradeHitCount" value="5"/>
      	</property>
      	<property name="CustomUpgradeSound" value="place_block_metal" />
      	</append>
      	
      	<append xpath="blocks/block[@name='cntStoveOldVer1Closed']">
      		<property class="UpgradeBlock">
      		<property name="ToBlock" value="workstationOven"/>
      		<property name="Item" value="ElectricalRepairKit"/>
      		<property name="ItemCount" value="1"/>
      		<property name="UpgradeHitCount" value="5"/>
      	</property>
      	<property name="CustomUpgradeSound" value="place_block_metal" />
      	</append>
      And this is the item appended in items.xml
      Code:
      <append xpath="/items">
      	<item name="ElectricalRepairKit">
      	<property name="HoldType" value="45" />
      	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab" />
      	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab" />
      	<property name="Material" value="MresourceScrapIron" />
      	<property name="Weight" value="1" />
      	<property name="Stacknumber" value="25" /> <!-- STK resource -->
      	<property name="EconomicValue" value="10" />
      	<property name="EconomicBundleSize" value="10" />
      	<property name="Group" value="Resources" />
      	<property name="RepairTime" value=".5" />
      	<property name="RepairAmount" value="20" />
      	<property name="CraftingIngredientTime" value=".2" />
      	<property name="CustomIcon" value="resourceRepairKit" />
      	</item>
      </append>
      I tried to change the item to just need resourceScrapIron, and then it worked flawlessly and used one scrapiron, but not with the ElectricalRepairKit. All the items are loaded and looks correct in the configdump xmls
      I'm not much of an expert on this, but how are you applying the upgrade? via a hammer? Did you also update the hammer's Allowed_upgrade_items to include your new item?

      Comment


        Originally posted by sphereii View Post
        I'm not much of an expert on this, but how are you applying the upgrade? via a hammer? Did you also update the hammer's Allowed_upgrade_items to include your new item?
        I tried with nailgun and stoneaxe, but I was unaware of that allowed_upgrade_item. That's probably it! Gonna apply that example code from page one to change all of those when I get back home
        Many many thanks for helping with my numerous mishaps. I just can't seem to get the hang of xpath's logic

        Comment


          Is it possible to set multiple sources for the DowngradeBlock function? would be handy for a little pet project

          Comment


            Hi, how do I enter here with xpath:

            "<effect_group name="gunJunkTurret">
            <passive_effect name="MaxRange" operation="base_set" value="15"/>
            <passive_effect name="DamageFalloffRange" operation="base_set" value="10"/>
            <passive_effect name="DamageFalloffRange" operation="perc_add" value="-.2,.2"/> <!-- random effective rng -->
            <passive_effect name="BlockRange" operation="base_set" value="3"/>

            <passive_effect name="EntityDamage" operation="base_set" value="11.8"/>
            <passive_effect name="EntityDamage" operation="perc_add" value="-.15,.15"/> <!-- random EntityDmg -->
            <passive_effect name="EntityDamage" operation="perc_add" value=".1,.5" tier="2,6"/> <!-- tier bonus -->

            <passive_effect name="DegradationMax" operation="perc_add" value="-.2,.2" tags="perkTurrets"/> <!-- random DegMax -->
            <passive_effect name="WeaponHandling" operation="perc_add" value="-.08,.08"/> <!-- random WeaponHandling -->

            <passive_effect name="RoundsPerMinute" operation="perc_add" value="-.1,.1"/> <!-- random APM -->
            <passive_effect name="MagazineSize" operation="perc_add" value="-.122,.122"/> <!-- random MagazineSize -->
            <passive_effect name="WeaponHandling" operation="perc_add" value="-.08,.08"/> <!-- random WeaponHandling -->

            <passive_effect name="BlockDamage" operation="base_set" value="1"/>

            <passive_effect name="RoundsPerMinute" operation="base_set" value="105.6"/>
            <passive_effect name="BurstRoundCount" operation="base_set" value="1"/>


            <!-- was
            <passive_effect name="MagazineSize" operation="base_set" value="50"/>
            <passive_effect name="MagazineSize" operation="base_add" value="2,10" tier="2,6"/>
            -->

            <passive_effect name="MagazineSize" operation="base_set" value="62"/>
            <passive_effect name="MagazineSize" operation="base_add" value="6,30" tier="2,6"/>
            <passive_effect name="ReloadSpeedMultiplier" operation="base_set" value="1"/>

            <passive_effect name="SpreadDegreesVertical" operation="base_set" value="5"/>
            <passive_effect name="SpreadDegreesHorizontal" operation="base_set" value="5"/>
            <passive_effect name="SpreadMultiplierAiming" operation="perc_add" value="-.13"/>
            <passive_effect name="SpreadMultiplierCrouching" operation="perc_add" value="-.05"/>
            <passive_effect name="SpreadMultiplierWalking" operation="perc_add" value=".15"/>
            <passive_effect name="SpreadMultiplierRunning" operation="perc_add" value=".3"/>

            <passive_effect name="KickDegreesVerticalMin" operation="base_set" value="3"/>
            <passive_effect name="KickDegreesVerticalMax" operation="base_set" value="3"/>

            <passive_effect name="KickDegreesHorizontalMin" operation="base_set" value="-2"/>
            <passive_effect name="KickDegreesHorizontalMax" operation="base_set" value="2"/>

            <passive_effect name="IncrementalSpreadMultiplier" operation="base_set" value="0"/>
            <passive_effect name="WeaponHandling" operation="base_set" value="1"/>

            <passive_effect name="JunkTurretActiveRange" operation="base_set" value="30"/>

            <passive_effect name="DegradationMax" operation="base_set" value="250,600" tier="1,6" tags="perkTurrets"/>
            <passive_effect name="DegradationPerUse" operation="base_set" value="0.35" tags="perkTurrets"/>
            <passive_effect name="ModSlots" operation="base_set" value="1,1,2,2,3,4" tier="1,2,3,4,5,6"/>
            <passive_effect name="ModPowerBonus" operation="perc_add" value=".10" tags="EntityDamage"/>
            <passive_effect name="ModPowerBonus" operation="base_add" value="300" tags="EconomicValue"/>
            </effect_group>
            "

            Comment


              How can i remove dynamite completly from the game?
              So you cant craft or loot it.

              Thanks in advance

              Orakel

              Comment


                Originally posted by Orake3l View Post
                How can i remove dynamite completly from the game?
                So you cant craft or loot it.

                Thanks in advance

                Orakel
                My quick anser is to set damage to 0 if the griefing is what worries you, that's easy. But if you want to achieve what you said, redo the nodes of loot groups where it appears, and for the crafting, you can alter the recipe, either set the ammount result to 0, or add an unobtainable resource to it.

                Comment

                Working...
                X