Cirion Posted January 30, 2019 Share Posted January 30, 2019 Tried my first basic mod. Decrease smelt time to small stones in forge <configs> <set xpath="/items/item[@name=resourceRockSmall]/property[@name=MeltTimePerUnit]/@value">0.1</set> </configs> Doesn't work - where did I go wrong? Link to comment Share on other sites More sharing options...
Royal Deluxe Posted January 30, 2019 Share Posted January 30, 2019 i suggest you to start with old fashion XML edits. And only if the edits work make them a xpath modlet If you directly start with a modlet you mostly have no idea if the issue is in the xpath or if it is the XML edit that dont work as intended. I made many modifications over the time and i still test new edits first as a simple edit of the XML (In your case i am not sure that the xml edit part will work as you think) Link to comment Share on other sites More sharing options...
DUST2DEATH Posted January 30, 2019 Share Posted January 30, 2019 resourceRockSmall does not have that property. So there is nothing for it to set. Smelt time is based on weight. (resourceRockSmall does have *this* property) Link to comment Share on other sites More sharing options...
Cirion Posted January 30, 2019 Author Share Posted January 30, 2019 Yes, you can change smelt time for rocksmall, it works when I manually edit it, tested and verified, but I hate manually fixing it every time the game updates, so I wanted to make a mod finally for it. SO it definitely works, here is the working code that needs to be into a modlet form now: <item name="resourceRockSmall"> <!-- scrap material --> <property name="HoldType" value="40"/> <property name="Meshfile" value="Items/Crafting/rock_smallPrefab"/> <property name="DropScale" value="6"/> <property name="Material" value="MresourceRockSmall"/> <property name="Stacknumber" value="6000"/> <!-- STK resource --> <property name="RepairAmount" value="300"/> <property name="RepairTime" value="0.5"/> <property name="Weight" value="5"/> <property name="MeltTimePerUnit" value="0.1"/> <property name="EconomicValue" value="50"/> <property name="EconomicBundleSize" value="50"/> <property class="Action0"> <property name="Class" value="ThrowAway"/> <property name="Delay" value="1.2"/> <!-- obsolete if rounds per minute exists --> <property name="Throw_strength_default" value="8"/> <property name="Throw_strength_max" value="25"/> <property name="Max_strain_time" value="1.5"/> <property name="Sound_start" value="swoosh"/> </property> <property name="ThrowableDecoy" value="true"/> <property name="Group" value="Resources"/> <property name="CraftingIngredientTime" value="0.5"/> <property name="DistractionTags" value="zombie,requires_contact"/> <effect_group name="Base Effects" tiered="false"> <passive_effect name="DistractionRadius" operation="base_set" value="25"/> <passive_effect name="DistractionLifetime" operation="base_set" value="1"/> <passive_effect name="DistractionStrength" operation="base_set" value="100"/> </effect_group> </item> Link to comment Share on other sites More sharing options...
DUST2DEATH Posted January 30, 2019 Share Posted January 30, 2019 you misunderstand. The default xml does not have that property, so set will not work. You will need to use an append, or insert function instead. or, change the weight value via set. Link to comment Share on other sites More sharing options...
DukeW74 Posted January 30, 2019 Share Posted January 30, 2019 Set the time you want, 0.25 is the default time. Everything extends from unit_iron including stone <set xpath="/items/item[@name='unit_iron']/property[@name='MeltTimePerUnit']/@value">0.25</set> Link to comment Share on other sites More sharing options...
Cirion Posted January 30, 2019 Author Share Posted January 30, 2019 Oh ok that makes sense now. thanks Link to comment Share on other sites More sharing options...
Cirion Posted February 1, 2019 Author Share Posted February 1, 2019 Ok so I still can't get it to work, I guess I'm pretty dense lol I hate to be the guy that asks for a hand holding, but I think at this point I need someone to solve it for me to help me to understand. I tried both append for melttime and also set for weight, neither seemed to work <configs> <set xpath="/items/item[@name=resourceRockSmall]/property[@name=Weight]/@value">1</set> <append xpath="/items/item[@name=resourceRockSmall]/property[@name=MeltTimePerUnit]/@value">0.1</append> </configs> Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted February 1, 2019 Share Posted February 1, 2019 Ok so I still can't get it to work, I guess I'm pretty dense lol I hate to be the guy that asks for a hand holding, but I think at this point I need someone to solve it for me to help me to understand. I tried both append for melttime and also set for weight, neither seemed to work <configs> <set xpath="/items/item[@name=resourceRockSmall]/property[@name=Weight]/@value">1</set> <append xpath="/items/item[@name=resourceRockSmall]/property[@name=MeltTimePerUnit]/@value">0.1</append> </configs> I am looking at the syntax ... had a similar issue with a mod i did .. Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted February 1, 2019 Share Posted February 1, 2019 Set the time you want, 0.25 is the default time. Everything extends from unit_iron including stone <set xpath="/items/item[@name='unit_iron']/property[@name='MeltTimePerUnit']/@value">0.25</set> I ran this and it loads with no errors ... It works .. and it also reduces the time to smelt scrap iron too <configs> <!-- Everything extends from unit_iron including stone --> <set xpath="/items/item[@name='unit_iron']/property[@name='MeltTimePerUnit']/@value">0.1</set> <append xpath="/items/item[@name='resourceRockSmall']"> <property name='Weight' value="1"/> </append> </configs> Link to comment Share on other sites More sharing options...
DukeW74 Posted February 1, 2019 Share Posted February 1, 2019 If you just want stone to be faster, not iron,lead and all other stuff you need to assign it to unit_stone <append xpath="/items/item/[@name='unit_stone']"> <property name="MeltTimePerUnit" value="0.25"/> <!-- default melt time --> </append> I am still learning xpath myself but I think your append is wrong. This should work? <append xpath="/items/item[@name='resourceRockSmall']"> <property name="MeltTimePerUnit" value="0.25"/> <!-- default melt time --> </append> Link to comment Share on other sites More sharing options...
Ragsy 2145 Posted February 2, 2019 Share Posted February 2, 2019 I am still learning xpath myself but I think your append is wrong. On a steep learning curve myself but I think we went in right direction Link to comment Share on other sites More sharing options...
Cirion Posted February 9, 2019 Author Share Posted February 9, 2019 EDIT: ignore this post. solved my problem I asked previously Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.