Jump to content

xpath changing values by a set percentage..how?


pipermac

Recommended Posts

16 minutes ago, Liesel Weppen said:

Erm? Just calculate it?

 

If CraftingIngredientTime is 13 and you want to make it faster with 10% just lower it to 11.7 (or 12, if not rounded)?

Trying to change it for all food items without having to do it for each one individually. Since they have different values your suggestion won't work.

Link to comment
Share on other sites

3 minutes ago, Liesel Weppen said:

You can keep trying, but it won't work, that's not how the game works. Good luck.

Keep trying?  I am not trying anything, I am asking if it is possible as I don't know xpath.   All you have to do is say it's not possible. Thanks

Link to comment
Share on other sites

The modifier perc_add adds a certain percentage to a value if I remember correctly. If you search the vanilla xml you will see it used often.

Generally any value that is set in xml can be modified by XPath, but there is very limited ability to change multiple things at a time.

Using your example- all food items are defined individually so xml mods would have to define the changes individually. 

Some things like trees or other things "extend" from a master item so you can modify the master, with the children inheriting the changes. That is used infrequently in vanilla xml though. We modders tend to use it a lot though.

TLDR: yes, but not easily if your plan is for a lot of items

Link to comment
Share on other sites

As I recall, this is how some of the MasterChef perks work. One of them reduces meat usage by 20% (meaning 4 pieces instead of 5 for most recipes), another shortens the cooking time. Here's an excerpt from the code for the latter, from the progression.xml

 

<passive_effect name="CraftingTime" operation="perc_add" level="1,5" value="-.1,-.5" tags="perkMasterChef"/>

 

For each rank of Master Chef, you get 10% off the cooking time, starting at 10% off and going as high as 50% off.

That could act as a sort of guide for you. If you wanted to increase the crafting time, you could make those numbers positive instead of negative. The only problem is that in this case, it only affects things tagged with "perkMasterChef". 

 

xpath modding isn't as daunting as it seems, and I'd recommend just jumping in and taking a stab at it. Mod something small first and you'll be used to it before you know it.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...