Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

I'm back again :D with a new question :)

can you explain me the issue here?

 

<set xpath="/blocks/block[@name=terrDesertGround]/drop[@name=resourceClayLump]/@count">3,5</set>

 

Looks like the code dosen't accept digits with a comma between, but i though count="3,5" means i get a amount between 3 and 5

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

I'm back again :D with a new question :)

can you explain me the issue here?

 

<set xpath="/blocks/block[@name=terrDesertGround]/drop[@name=resourceClayLump]/@count">3,5</set>

 

Looks like the code dosen't accept digits with a comma between, but i though count="3,5" means i get a amount between 3 and 5

 

DesertGround doesn't have resourceClayLump yet. It has resourceCrushedSand.

 

This should add the new line:

<append xpath="/blocks/block[@name='terrDesertGround']">
    	<drop event="Fall" name="resourceClayLump" count="3,5" prob="0.5" stick_chance="0"/>

</append>

Link to comment
Share on other sites

I've tried every combination with the <remove xpath> that I can think of but still can't get it to work. Any help would be greatly appreciated. I would like to remove the highlighted section of the code below. Thanks in advance. :upset:

 

<block name="cntBusSchool">

<property name="DisplayType" value="blockHardenedMulti" />

<property name="Material" value="Mmetal_hard"/>

<property name="Class" value="CarExplodeLoot"/>

<property name="LootList" value="19"/>

<property name="Shape" value="ModelEntity"/>

<property name="Path" value="solid"/>

<property name="Model" value="Entities/Vehicles/busPrefab"/>

<property name="Place" value="TowardsPlacer"/>

<property name="MultiBlockDim" value="3,4,12"/>

<property name="ActivationDistance" value="15"/>

<property name="ImposterDontBlock" value="true"/>

<property name="BigDecorationRadius" value="5"/>

<property name="CanDecorateOnSlopes" value="false"/>

<property name="ShowModelOnFall" value="false"/>

<property name="RandomTintColor1" value="188,148,20" param1="bus"/>

<property name="Collide" value="sight,movement,melee,bullet,arrow,rocket"/>

<property class="Explosion">

<property name="ParticleIndex" value="4"/> <!-- which prefab/particle is used -->

<property name="RadiusBlocks" value="5"/> <!-- damage radius for blocks -->

<property name="BlockDamage" value="5000"/> <!-- damage for blocks in the center of the explosion -->

<property name="RadiusEntities" value="5"/> <!-- damage radius for entities -->

<property name="EntityDamage" value="70"/> <!-- damage for entities in the center of the explosion -->

</property>

<drop event="Harvest" name="resourceLeather" count="2,7" prob="0.5" tag="allHarvest"/>

<drop event="Harvest" name="resourceScrapIron" count="10,20" tag="allHarvest"/>

<drop event="Harvest" name="terrStone" count="0" tool_category="Disassemble"/>

<drop event="Harvest" name="resourceHeadlight" count="1" prob="0.2" tag="salvageHarvest"/>

<drop event="Destroy" count="0"/>

<drop event="Harvest" name="resourceMechanicalParts" count="0,3" prob="0.1" tag="salvageHarvest"/>

<drop event="Harvest" name="resourceElectricParts" count="0,2" prob="0.1" tag="salvageHarvest"/>

<drop event="Harvest" name="resourceElectricParts" count="0,2" prob="0.1" tag="salvageHarvest"/>

<drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>

<property name="FilterTags" value="floot"/>

</block>

Link to comment
Share on other sites

I'm trying to add skill point rewards to more quests. I tried using this in xpath

 

<insertAfter xpath="/quests/quest[@id=challenge_silenceofthelambs]" >

<reward type="SkillPoints" value="1" />

</insertAfter>

 

It throws an error when i load up a game though

 

ERR CML loader: Loading and parsing 'quests.xml' failed

Exception: Unrecognized xml element reward

Link to comment
Share on other sites

I'm trying to add a weapon in the game

ModLet and the correct one so

Is this sure icon like that?

 

Machete Of God\Config\items.xml
-------------------------------------------------------------------------------------------
<configs>
<!-- [color="#00FF00"]Machete Of God[/color] -->
<append xpath="/items">	

<item name="MacheteOfGod">	
<property name="Tags" value="knife,melee,light,weapon,meleeWeapon,perkDeepCuts,perkTheHuntsman"/>
<property name="DisplayType" value="melee"/>
<property name="CustomIcon" value="MacheteOfGod"/>
<property name="HoldType" value="47"/>
<property name="Meshfile" value="Items/Weapons/Melee/Knives/machetePrefab"/>
<property name="Material" value="Mmetal"/>
<property name="RepairTools" value="resourceForgedSteel"/>
<property name="DegradationBreaksAfter" value="false"/>
<property name="EconomicValue" value="600"/>
<property name="SoundJammed" value="ItemNeedsRepair"/>
<property name="SoundDestroy" value="wooddestroy1"/>
<property name="Weight" value="200"/>
<property name="Group" value="Ammo/Weapons"/>
<property name="ActionSkillGroup" value="Blade Weapons"/>
<property name="CraftingSkillGroup" value="craftSkillWeapons"/>
<property name="RepairExpMultiplier" value="5.5"/>

<property class="Action0">
	<property name="Class" value="DynamicMelee"/>
	<property name="Damage_type" value="Slashing"/>
	<property name="Sphere" value="0.15"/>   
	<property name="Sound_start" value="swoosh"/>
	<property name="ToolCategory.Butcher" value="0" param1="4"/>
	<property name="ToolCategory.harvestingTools" value="40.0" param1="2"/>
	<property name="Sound_harvesting" value="open_animal" param1="organic"/>
</property>
<property class="Action1">
	<property name="Class" value="DynamicMelee"/>
	<property name="Damage_type" value="Slashing"/>
	<property name="Sphere" value="0.15"/>
	<property name="Sound_start" value="swoosh"/>
	<property name="ToolCategory.Butcher" value="0" param1="4"/>
	<property name="ToolCategory.harvestingTools" value="40.0" param1="2"/>		
	<property name="Sound_harvesting" value="open_animal" param1="organic"/>
	<property name="UsePowerAttackAnimation" value="true"/>
</property>

<effect_group name="Base Effects">
	<passive_effect name="MaxRange" operation="base_set" value="50.0"/>
	<passive_effect name="BlockRange" operation="base_set" value="50"/>
	<passive_effect name="EntityDamage" operation="base_set" value="2000"/> [color="#00FF00"]<!-- meleeToolMachete -->[/color]
	<passive_effect name="BlockDamage" operation="base_set" value="20000"/>
	<passive_effect name="AttacksPerMinute" operation="base_set" value="100"/> [color="#00FF00"]<!-- 100 2 por segundo ok -->[/color]
	<passive_effect name="HarvestCount" operation="base_set" value="10" tags="butcherHarvest"/>	[color="#00FF00"]<!-- 10=2000 2=500 de CARNE COURO -->[/color]	
	<passive_effect name="HarvestCount" operation="base_set" value="2" tags="oreWoodHarvest"/>	[color="#00FF00"]<!-- 10=2000 2=500 de cada minerio -->[/color]	
	<passive_effect name="StaminaLoss" operation="base_set" value="0" tags="primary"/>
	<passive_effect name="DegradationMax" operation="base_set" value="300,800" tier="1,6"/>
	<passive_effect name="DegradationPerUse" operation="base_set" value="0"/>	[color="#00FF00"]<!-- DegradationPerUse  e ZERO 0 -->[/color]		
	<passive_effect name="ModSlots" operation="base_set" value="0,5" tier="1,6"/>
	<passive_effect name="ModPowerBonus" operation="perc_add" value=".15" tags="EntityDamage,BlockDamage"/>
	<passive_effect name="ModPowerBonus" operation="base_add" value="200" tags="EconomicValue"/>
</effect_group>
<effect_group name="Power Attack">
	<passive_effect name="EntityDamage" operation="perc_add" value="100" tags="secondary"/>
	<passive_effect name="BlockDamage" operation="perc_add" value="1" tags="secondary"/>
	<passive_effect name="AttacksPerMinute" operation="perc_subtract" value="0" tags="secondary"/>
	<passive_effect name="StaminaLoss" operation="base_add" value="21" tags="secondary"/>

	<triggered_effect trigger="onSelfSecondaryActionStart" action="PlaySound" target="self" sound="player1painlg">
		<requirement name="RandomRoll" seed_type="Random" target="self" min_max="0,100" operation="LTE" value="70"/>
		<requirement name="IsMale" target="self"/>
	</triggered_effect>
	<triggered_effect trigger="onSelfSecondaryActionStart" action="PlaySound" target="self" sound="player2painlg">
		<requirement name="RandomRoll" seed_type="Random" target="self" min_max="0,100" operation="LTE" value="70"/>
		<requirement name="IsMale" target="self" invert="true"/>
	</triggered_effect>
</effect_group>
</item>

</append>
</configs>

-----------------------------------------------------------------------------------------------------

Machete Of God\Config\recipes.xml

<configs>
<append xpath="/recipes">

	<recipe name="MacheteOfGod" count="1">
	     <ingredient name="resourceForgedIron" count="1"/>
             <ingredient name="resourceWood" count="1"/>
             <ingredient name="resourceLeather" count="1"/>
	</recipe>

	<recipe name="gunPistolAdmin" count="1">
		<ingredient name="resourceForgedIron" count="1"/>
                <ingredient name="resourceWood" count="1"/>
                <ingredient name="resourceLeather" count="1"/>
	</recipe>

</append>
</configs>
----------------------------------------------------------------------------------------------

 

 

Someone to help me?

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

I'm trying to add skill point rewards to more quests. I tried using this in xpath

 

<insertAfter xpath="/quests/quest[@id=challenge_silenceofthelambs]" >

<reward type="SkillPoints" value="1" />

</insertAfter>

 

It throws an error when i load up a game though

 

ERR CML loader: Loading and parsing 'quests.xml' failed

Exception: Unrecognized xml element reward

 

insertAfter with that xpath is adding it before the node:

 

<!-- CHALLENGES -->
<reward type="SkillPoints" value="1" />

<quest id="challenge_silenceofthelambs">
	<property name="name_key" value="challenge_silenceofthelambs" />
	<property name="subtitle_key" value="challenge_silenceofthelambs_subtitle" />

 

what you probably want to do is append it. So try updating your insertAfter's with append

Link to comment
Share on other sites

I'm trying to add a weapon in the game

ModLet and the correct one so

Is this Serto icon like that?

 

-- snip --

----------------------------------------------------------------------------------------------

 

This looks okay at a glance. Are you having an issue with it?

Link to comment
Share on other sites

Does this work for you?

 

<remove xpath="/blocks/block[@name='cntBusSchool']/property[@class='Explosion']" />

 

I tried that one first cause it made sense to me too and it didn't but I will try again right now to see if I messed it up somehow

 

***EDIT:

 

So I just tried it again this way with no luck it still blows up. I even tried it this way too.

 

<remove xpath="/blocks/block[@name=cntBusSchool]" />

<property class="Explosion">

<property name="ParticleIndex" value="4"/> <!-- which prefab/particle is used -->

<property name="RadiusBlocks" value="5"/> <!-- damage radius for blocks -->

<property name="BlockDamage" value="500"/> <!-- damage for blocks in the center of the explosion -->

<property name="RadiusEntities" value="5"/> <!-- damage radius for entities -->

<property name="EntityDamage" value="70"/> <!-- damage for entities in the center of the explosion -->

</property>

</remove>

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

I tried that one first cause it made sense to me too and it didn't but I will try again right now to see if I messed it up somehow

 

***EDIT:

 

So I just tried it again this way with no luck it still blows up. I even tried it this way too.

 

<remove xpath="/blocks/block[@name=cntBusSchool]" />

<property class="Explosion">

<property name="ParticleIndex" value="4"/> <!-- which prefab/particle is used -->

<property name="RadiusBlocks" value="5"/> <!-- damage radius for blocks -->

<property name="BlockDamage" value="500"/> <!-- damage for blocks in the center of the explosion -->

<property name="RadiusEntities" value="5"/> <!-- damage radius for entities -->

<property name="EntityDamage" value="70"/> <!-- damage for entities in the center of the explosion -->

</property>

</remove>

 

I copy and pasted the line I wrote, and it works as expected. Can you post your output_log.txt? Maybe there's another issue we aren't seeing.

Link to comment
Share on other sites

You know what I had a complete brain fart dude...Lol. I tested the code using the 'cntBusSchool' block but when I got in game I tested it with the full car...Haven't been getting much sleep lately and it is showing. Thank you for your help...Lol. If I would have paid attention to what I was doing I would have had it on my very first try...duh

Link to comment
Share on other sites

You know what I had a complete brain fart dude...Lol. I tested the code using the 'cntBusSchool' block but when I got in game I tested it with the full car...Haven't been getting much sleep lately and it is showing. Thank you for your help...Lol. If I would have paid attention to what I was doing I would have had it on my very first try...duh

 

No worries; I'm just glad you got it sorted.

Link to comment
Share on other sites

insertAfter with that xpath is adding it before the node:

 

<!-- CHALLENGES -->
<reward type="SkillPoints" value="1" />

<quest id="challenge_silenceofthelambs">
	<property name="name_key" value="challenge_silenceofthelambs" />
	<property name="subtitle_key" value="challenge_silenceofthelambs_subtitle" />

 

what you probably want to do is append it. So try updating your insertAfter's with append

 

Ok, i actually just got it to work by adding /objective to the insert after. However now it is rewarding to many skill points, it gives 4. Even the starter quest is rewarding 4 even with a value of 10. I changed the value to .25 but it throws an error and you lose the quest. Is this reward a fixed value that I can't adjust?

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

Ok, i actually just got it to work by adding /objective to the insert after. However now it is rewarding to many skill points, it gives 4. Even the starter quest is rewarding 4 even with a value of 10. I changed the value to .25 but it throws an error and you lose the quest. Is this reward a fixed value that I can't adjust?

 

in Game, can you type in exportcurrentconfigs and look at the quests.xml in your save game folder. Then you can see if it did what you expected.

Link to comment
Share on other sites

Hmmm. First time modding and this doesn't work.

 

<set xpath="/items/item[@name='meleeToolChainsaw' and @name='meleeToolAuger']/property[@name='MagazineSize']/@value">5000</set>

 

this is what it shows on my F1 console. The guy in page 4 with the jar works fine. :/

 

22.thumb.jpg.4e40dbb4eec3a6efdd2aabbb3ea1140d.jpg

Link to comment
Share on other sites

Your path is wrong and as far as I know your use of "and" is incorrect. "and" would need to include both chainsaw and auger, "or" might work but I have never tried anything with it though I am just learning myself.

 

 

In any case this works on b238

<set xpath="/items/item[@name='meleeToolChainsaw']/effect_group/passive_effect[@name='MagazineSize']/@value">5000</set>
<set xpath="/items/item[@name='meleeToolAuger']/effect_group/passive_effect[@name='MagazineSize']/@value">5000</set>

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...