• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Complete noob to modding help

Cirion

Refugee
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?

 
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)

 
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)

 
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>

 
you misunderstand.

The default xml does not have that property, so set will not work.

zxMLUOZ.jpg


You will need to use an append, or insert function instead. or, change the weight value via set.

 
Set the time you want, 0.25 is the default time. Everything extends from unit_iron including stone

Code:
<set xpath="/items/item[@name='unit_iron']/property[@name='MeltTimePerUnit']/@value">0.25</set>
 
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>

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

 
Last edited by a moderator:
Set the time you want, 0.25 is the default time. Everything extends from unit_iron including stone

Code:
<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

Code:
<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>
 
Last edited by a moderator:
If you just want stone to be faster, not iron,lead and all other stuff you need to assign it to unit_stone

Code:
<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?

Code:
<append xpath="/items/item[@name='resourceRockSmall']">
   <property name="MeltTimePerUnit" value="0.25"/> <!-- default melt time -->
</append>
 
Back
Top