pipermac Posted December 30, 2020 Share Posted December 30, 2020 Is it possible to change a property value by a certain percentage? Eg. Food items have a CraftingIngredientTime, If I want to Increase or decrease all of those times by x% how can I do this? Thanks Link to comment Share on other sites More sharing options...
Liesel Weppen Posted December 30, 2020 Share Posted December 30, 2020 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)? Link to comment Share on other sites More sharing options...
pipermac Posted December 30, 2020 Author Share Posted December 30, 2020 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 More sharing options...
Liesel Weppen Posted December 30, 2020 Share Posted December 30, 2020 2 minutes ago, pipermac said: Since they have different values your suggestion won't work. Since they don't have same values, your idea won't work. Link to comment Share on other sites More sharing options...
pipermac Posted December 30, 2020 Author Share Posted December 30, 2020 Not actually trying to do a %, that was just an example what I specifically need to do multiply the current value by 100. So essentially set value=value*100 Link to comment Share on other sites More sharing options...
Liesel Weppen Posted December 30, 2020 Share Posted December 30, 2020 2 minutes ago, pipermac said: Not actually trying to do a % You can keep trying, but it won't work, that's not how the game works. Good luck. Link to comment Share on other sites More sharing options...
pipermac Posted December 30, 2020 Author Share Posted December 30, 2020 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 More sharing options...
convergent Posted December 31, 2020 Share Posted December 31, 2020 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 More sharing options...
Cranberry Monster Posted January 4, 2021 Share Posted January 4, 2021 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.