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

Help with setting food poisoning risk to to different levels

Winterhart

New member
This is the code that I thought would set the food poisoning to 100%

<set xpath="items/item[@name=foodCanBeef]/effect_group[@tiered=false]/triggered_effect[4]/requirement[@name=RandomRoll]/@min_max">100,100</set>

When I tested it in game eating CanBeef didn't give me food poisoning. Any suggestions as to what I'm doing wrong?

 
I think you also have to set the value to 100. Here is what it looks like as default <requirement name="RandomRoll" seed_type="Random" target="self" min_max="0,100" operation="LTE" value="5"/> To me, it looks like it is rolling a 100 sided dice and it needs to land on a 5 or less to trigger since default is a 5 percent chance to get food poisoning. Or perhaps changing min/max both to 0 would do the trick. I would try that first since it would be easier and only require one xpath line.

 
Just remove the random roll. If you want 100% then it’s just clutter.
That makes sense, now I just have to go learn how to remove something lol

I do want to be able to set lower levels, but I want it at 100 to see if it's working.

 
Try this. Tested it briefly and worked.

Code:
   <remove xpath="/items/item/effect_group/triggered_effect/requirement[@name='RandomRoll']/ancestor::*[@buff='buffIllFoodPoisoning0']/requirement[@name='RandomRoll']" />
- - - Updated - - -

If you want to adjust the value that's a different Xpath ;p

 
Untested

Code:
   <setattribute xpath="/items/item/effect_group/triggered_effect/requirement[@name='RandomRoll']/ancestor::*[@buff='buffIllFoodPoisoning0']/requirement[@name='RandomRoll']/@value">
     69
   </setattribute>
 
Last edited by a moderator:
Try this. Tested it briefly and worked.

Code:
   <remove xpath="/items/item/effect_group/triggered_effect/requirement[@name='RandomRoll']/ancestor::*[@buff='buffIllFoodPoisoning0']/requirement[@name='RandomRoll']" />
- - - Updated - - -

If you want to adjust the value that's a different Xpath ;p
Works great! Thanks

 
Back
Top