Page 39 of 40 FirstFirst ... 2937383940 LastLast
Results 571 to 585 of 591

Thread: XPath Modding Explanation Thread

  1. #571
    Ranger -Holo-'s Avatar
    Join Date
    May 2016
    Location
    In a nice POI
    Posts
    268
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    You are close. The chemistryline is part of the passive_effect line, not the effectgroup itself. Once you target the passive_effect line, you can add the name attribute as an additional condition, or continue just to target the @tags='chemistryStation'.
    Code:
    <remove xpath="/progression/perks/perk[@name='perkYeahScience']/effect_group/passive_effect[@name='RecipeTagUnlocked' and @tags='chemistryStation']" />
    
    <remove xpath="/progression/perks/perk[@name='perkYeahScience']/effect_group/passive_effect[@tags='chemistryStation']" />
    Ahh Thanks! I was not aware one could have longer then a single 'item' here "effect_group/passive_effect"
    But I'm running into brickwall again with other ideas :/
    trying to revert there weird choice to increase material amount as one get better at making things, and been trying everything I can think of.
    Currently ended up with this code, with the thrownspeariron as a test to see if even the syntax was correct, but it was not applied

    <set xpath="/recipies/recipe[@name='meleeThrownSpearIron']/effect_group/passive_effect[@name='CraftingIngredientCount' and @value='.5,2.5']/@value">2.5,.5</set>

    hoping to replace the meleeThrownSpearIron with a wildcard (if that's doable?) to fix all those recipies, but can't get the syntax right.

  2. #572
    Refugee
    Join Date
    Aug 2016
    Posts
    7
    Rep Power
    0
    Hello everyone, help me deal with the icons for items. I’m doing a mod on 18.2, I add an arrow object, in the ItemIcons folder there is a picture 160 * 160 in .png format
    The game has an item, there is a recipe, but there is no icon that I made for this item. What's wrong, with the code that I wrote, here it is.

    <item name="ammoArrowStonePaper">
    <property name="CustomIcon" value="#@modfolder:ItemIcons/ammoArrowStonePaper.png" />
    <!--<property name="CustomIcon" value="#@modfolder:Textures/iconsItem/ammoArrowStonePaper.png" />-->
    I tried to put it in another folder, but still there is no icon in the game
    tell me what is wrong or what needs to be done!

  3. #573
    Inventor wolverine576's Avatar
    Join Date
    Dec 2015
    Posts
    980
    Rep Power
    0
    How do i add a Battery to the Junk Turret recipe? I tried but ended up with double recipes lol

  4. #574
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,900
    Rep Power
    1
    Quote Originally Posted by wolverine576 View Post
    How do i add a Battery to the Junk Turret recipe? I tried but ended up with double recipes lol
    what does your XML look like?

    - - - Updated - - -

    Quote Originally Posted by PashaP79 View Post
    Hello everyone, help me deal with the icons for items. Iím doing a mod on 18.2, I add an arrow object, in the ItemIcons folder there is a picture 160 * 160 in .png format
    The game has an item, there is a recipe, but there is no icon that I made for this item. What's wrong, with the code that I wrote, here it is.

    <item name="ammoArrowStonePaper">
    <property name="CustomIcon" value="#@modfolder:ItemIcons/ammoArrowStonePaper.png" />
    <!--<property name="CustomIcon" value="#@modfolder:Textures/iconsItem/ammoArrowStonePaper.png" />-->
    I tried to put it in another folder, but still there is no icon in the game
    tell me what is wrong or what needs to be done!
    I think it builds an atlas, so your custom icon would probably be something like

    Code:
    <property name="CustomIcon" value="ammoArrowStonePaper" />
    if you name you item as ammoArrowStonePaper, it should also work without custom icon.

  5. #575
    Inventor wolverine576's Avatar
    Join Date
    Dec 2015
    Posts
    980
    Rep Power
    0
    <configs>
    <append xpath="/recipes">
    <recipe name="gunJunkTurret" count="1" craft_area="workbench" tags="learnable,perkTurrets">
    <ingredient name="gunJunkTurretParts" count="4"/>
    <ingredient name="resourceForgedIron" count="40"/>

    <ingredient name="carBattery" count="1"/>

    <ingredient name="resourceDuctTape" count="1"/>
    <ingredient name="resourceScrapPolymers" count="10"/>
    <ingredient name="resourceSpring" count="10"/>
    <effect_group>
    <passive_effect name="CraftingIngredientCount" level="2,6" operation="perc_add" value=".5,2.5" tags="gunJunkTurretParts,resourceForgedIron,resour ceDuctTape,resourceScrapPolymers,resourceSpring"/>
    </effect_group>
    </recipe>
    </append>
    </configs>

    It works, but the vanilla recipe is there too. I just want to "insert" a battery into the existing vanilla recipe
    Last edited by wolverine576; 12-10-2019 at 07:50 PM.

  6. #576
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,900
    Rep Power
    1
    Quote Originally Posted by wolverine576 View Post
    It works, but the vanilla recipe is there too. I just want to "insert" a battery into the existing vanilla recipe
    ahh you want to do this:

    Code:
    <append xpath="/recipes/recipe[@name='gunJunkTurret']">
       <ingredient name="carBattery" count="1"/>
    </append>

  7. #577
    Inventor wolverine576's Avatar
    Join Date
    Dec 2015
    Posts
    980
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    ahh you want to do this:

    Code:
    <append xpath="/recipes/recipe[@name='gunJunkTurret']">
       <ingredient name="carBattery" count="1"/>
    </append>

    Code:
    <configs>
    <append xpath="/recipes/recipe[@name='gunJunkTurret']">
       <ingredient name="carBattery" count="1"/>
    </append>
    </configs>

    Full code correct?

  8. #578
    Reconstructionist
    Join Date
    Sep 2014
    Posts
    532
    Rep Power
    0
    can xpath add in new entityclasses like a new zombie or animal? or do I need sdx still?

  9. #579
    Scavenger
    Join Date
    Nov 2018
    Location
    Post-apocalyptic Prehistoric Playground
    Posts
    50
    Rep Power
    0
    Howdy!

    I've been working on a "no crafting" mod, and this thread has been gold! for information. I've learned a lot about xpath, etc.
    I have unfortunately run into something.. Ive been able to get everything working the way i want it, but one part is giving me some issue.
    The short story is this:
    Code:
    <config>
    
    	<remove xpath="/items/item[@name='modArmorPlatingBasicSchematic']" />
    	
    	<append xpath="/items">
    <item name="modArmorPlatingBasicSchematic">
    	<property name="Extends" value="schematicNoQualityMaster"/>
    	<property name="CreativeMode" value="Player"/>
    	<property name="CustomIcon" value="modArmorPlatingBasic"/>
    	<property name="Unlocks" value="modArmorPlatingBasic"/>
    	<effect_group tiered="false">
    		<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" 
    cvar="modArmorPlatingBasic" operation="set" value="0"/>
    		<triggered_effect trigger="onSelfPrimaryActionEnd" action="GiveExp" exp="50"/>
    	</effect_group>
    </item>
    	</append>
    
    </config>
    this works, but everything i have tried to try to write it shorter.. to take up less space, and not have to
    include everything... how am i trying to say this...

    For some reason, just the way the game is, and does what it does right now, i can remove
    all recipes from "recipes.xml", BUT, when i do, the trader sells all the item mods at 0 cost..
    while all other items they sell DO have cost..
    my workaround was to leave the recipes in there (that works fine), then to change
    this line from value=1 --> value=0
    Code:
    <triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" 
    cvar="modArmorPlatingBasic" operation="set" value="0"/>
    that allows the trader to sell the item mods for #cost, but when you read the schematic,
    you get the xp, but not the ability to craft it.
    This is the intended goal, but i am looking for a shorter way to write this, rather than
    write it the way i did above for every mod*schematic...

    btw.. if i have to, i will. but i am sure there is a better way..
    also, before i try with xpath, i DO try the changes in the actual xml file,
    to make sure what i am trying is even valid..
    i have tried starts-with, ends-with, set, etc...
    each time it looks me right in the eye, and says F you,

    for example:
    Code:
    <set xpath="/items/item[starts-with(@name, 'mod')]/triggered_effect[@operation='set']/@value">0</set>
    this fails, for some reason..

    Thanks!

  10. #580
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,900
    Rep Power
    1
    Quote Originally Posted by dragonslayer770 View Post
    can xpath add in new entityclasses like a new zombie or animal? or do I need sdx still?
    You can add new models for zombies and animals using just XML and Unity Bundles.

    You would need SDX/DMT if you wanted to add a custom entity with its own animations, etc

  11. #581
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,900
    Rep Power
    1
    Quote Originally Posted by 12pack View Post
    Howdy!

    I've been working on a "no crafting" mod, and this thread has been gold! for information. I've learned a lot about xpath, etc.
    I have unfortunately run into something.. Ive been able to get everything working the way i want it, but one part is giving me some issue.
    The short story is this:
    Code:
    <config>
    
    	<remove xpath="/items/item[@name='modArmorPlatingBasicSchematic']" />
    	
    	<append xpath="/items">
    <item name="modArmorPlatingBasicSchematic">
    	<property name="Extends" value="schematicNoQualityMaster"/>
    	<property name="CreativeMode" value="Player"/>
    	<property name="CustomIcon" value="modArmorPlatingBasic"/>
    	<property name="Unlocks" value="modArmorPlatingBasic"/>
    	<effect_group tiered="false">
    		<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" 
    cvar="modArmorPlatingBasic" operation="set" value="0"/>
    		<triggered_effect trigger="onSelfPrimaryActionEnd" action="GiveExp" exp="50"/>
    	</effect_group>
    </item>
    	</append>
    
    </config>
    this works, but everything i have tried to try to write it shorter.. to take up less space, and not have to
    include everything... how am i trying to say this...

    For some reason, just the way the game is, and does what it does right now, i can remove
    all recipes from "recipes.xml", BUT, when i do, the trader sells all the item mods at 0 cost..
    while all other items they sell DO have cost..
    my workaround was to leave the recipes in there (that works fine), then to change
    this line from value=1 --> value=0
    Code:
    <triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" 
    cvar="modArmorPlatingBasic" operation="set" value="0"/>
    that allows the trader to sell the item mods for #cost, but when you read the schematic,
    you get the xp, but not the ability to craft it.
    This is the intended goal, but i am looking for a shorter way to write this, rather than
    write it the way i did above for every mod*schematic...

    btw.. if i have to, i will. but i am sure there is a better way..
    also, before i try with xpath, i DO try the changes in the actual xml file,
    to make sure what i am trying is even valid..
    i have tried starts-with, ends-with, set, etc...
    each time it looks me right in the eye, and says F you,
    Quote Originally Posted by 12pack View Post
    for example:
    Code:
    <set xpath="/items/item[starts-with(@name, 'mod')]/triggered_effect[@operation='set']/@value">0</set>
    this fails, for some reason..

    Thanks!
    I think the reason the above fails is that triggered_effect does not exist off an item node. They are always inside an <effect_group>

    Either add a // or add in /effect_group

    Code:
    <set xpath="/items/item[starts-with(@name, 'mod')]//triggered_effect[@operation='set']/@value">0</set>
    <set xpath="/items/item[starts-with(@name, 'mod')]/effect_group/triggered_effect[@operation='set']/@value">0</set>

  12. #582
    Scavenger
    Join Date
    Nov 2018
    Location
    Post-apocalyptic Prehistoric Playground
    Posts
    50
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    I think the reason the above fails is that triggered_effect does not exist off an item node. They are always inside an <effect_group>

    Either add a // or add in /effect_group

    Code:
    <set xpath="/items/item[starts-with(@name, 'mod')]//triggered_effect[@operation='set']/@value">0</set>
    <set xpath="/items/item[starts-with(@name, 'mod')]/effect_group/triggered_effect[@operation='set']/@value">0</set>
    Well, i'll be... yep.. that did the trick..
    I tried both, and they did work.. I know that I did try adding in the /effect_group/ on at least one try, but most likely had some other
    punctuation wrong or misplaced...

    Many Thanks!
    +1

    I will probably post this modlet after i play it for a little bit to make sure nothing in normal gameplay got buggered..

  13. #583
    Refugee
    Join Date
    Nov 2018
    Posts
    20
    Rep Power
    0
    Hi All,

    Maybe someone could point me in the right direction, I am trying to modify value on a perk. It is from darkness falls mod, but this should not matter. I run into similar problem modifying random brackets on vanila game. Anyway here is xml code:

    Code:
    <perk name="perkASMiningTools" parent="skillMiningTools" max_level="100" base_skill_point_cost="0" name_key="perkASMiningToolsName" desc_key="perkASMiningToolsDesc" icon="ui_game_symbol_mining">
    		<effect_group>
    			<requirement name="HoldingItemHasTags" tags="perkMotherLode"/>
    				<passive_effect name="BlockDamage" operation="perc_add" value="0.01,1" level="1,100"/>
    				<passive_effect name="HarvestCount" operation="perc_add" value="0.01,1" level="1,100" />
    				<effect_description level="1,100" desc_key="perkASMiningDesc"/>				
    		</effect_group>
    What I am aiming for is setting different value for HarvestCount. Here is my xpath:

    Code:
    <set xpath="perks/perk[@name="perkASMiningTools"]/effect_group/passive_effect[@name="HarvestCount"]/@value">0.01,0.5</set>
    Word perks comes from file structure perks/perk etc. On game load I always get an error. Only way to go around this is to xpathremove whole effect_group and append new one. I would like some more flexible solution .

    Thanks

  14. #584
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,900
    Rep Power
    1
    Quote Originally Posted by Lako View Post
    Hi All,

    Maybe someone could point me in the right direction, I am trying to modify value on a perk. It is from darkness falls mod, but this should not matter. I run into similar problem modifying random brackets on vanila game. Anyway here is xml code:

    Code:
    <perk name="perkASMiningTools" parent="skillMiningTools" max_level="100" base_skill_point_cost="0" name_key="perkASMiningToolsName" desc_key="perkASMiningToolsDesc" icon="ui_game_symbol_mining">
    		<effect_group>
    			<requirement name="HoldingItemHasTags" tags="perkMotherLode"/>
    				<passive_effect name="BlockDamage" operation="perc_add" value="0.01,1" level="1,100"/>
    				<passive_effect name="HarvestCount" operation="perc_add" value="0.01,1" level="1,100" />
    				<effect_description level="1,100" desc_key="perkASMiningDesc"/>				
    		</effect_group>
    What I am aiming for is setting different value for HarvestCount. Here is my xpath:

    Code:
    <set xpath="perks/perk[@name="perkASMiningTools"]/effect_group/passive_effect[@name="HarvestCount"]/@value">0.01,0.5</set>
    Word perks comes from file structure perks/perk etc. On game load I always get an error. Only way to go around this is to xpathremove whole effect_group and append new one. I would like some more flexible solution .

    Thanks
    The start of your xpath is probably not as correct as it should be. should it be something like /progression/perks/ ? or just add //perks/perk...

  15. #585
    Refugee
    Join Date
    Nov 2018
    Posts
    20
    Rep Power
    0
    Thanks @Sphereii,
    That did the trick.... I was so worried about the rest of the syntax I missed such simple thing.
    Purpose of // is to start at that line as I understand, so I can avoid typing to long strings in such instances?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •