Jump to content

Help with altering a buff from Iron Gut perk


Kman03

Recommended Posts

I want to increase the bonus time you get eating consumables from the Iron Gut perk. I just cant figure out how to do it.

 

any help is much appreciated

 

Its located in the buffs.xml and its a bit too tricky for me to figure out lol

 

its like if a certain value = x, then edit another value thats above this value in the code

 

 

<!-- perkSlowMetabolism : buff duration update, $MetabolismDuration is 1 to .5 -->
            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value="1">
                <requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="0"/></triggered_effect>


            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".909">
                <requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="1"/></triggered_effect>


            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".833">
                <requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="2"/></triggered_effect>


            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".769">
                <requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="3"/></triggered_effect>


            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".714">
                <requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="4"/></triggered_effect>


            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".667">
                <requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="5"/></triggered_effect>

 

 

the values I want to change are the .909, .833, .769 etc.

 

the goal is to have the buffs go 10% 30% 50% 70% 90%. I am wondering if "<!-- perkSlowMetabolism : buff duration update, $MetabolismDuration is 1 to .5 -->" will prevent the buff going past 50%.

Edited by Kman03 (see edit history)
Link to comment
Share on other sites

It seems $MetabolismDuration is the value that is subtracted each second or tick from any buff durations like $buffRedTeaDuration in buffs.xml, this is why lower values are better.

 

When you drink the tea, a line in items.xml for RedTea and Puremineralwater sets $buffRedTeaDuration to 303 (does that mean seconds aka 5 minutes?

 

**The wiki says the duration should be 4 minutes!? Strange fact nr.1**

 

Now each tick or second the value of $MetabolismDuration is substracted from $buffRedTeaDuration. With no Metabolism perk at all 1 would be substracted, making the duration 5 minutes. With fully perked Metabolism that value would be .5 which should double the duration to 10 minutes.

In the display the duration is calculated as $buffRedTeaDuration divided by $MetabolismDuration.

 

**The games description of fully perked Metabolism says it makes drugs last 50% longer, not 100% longer!? Strange fact nr.2**

 

So probably I misinterpreted some details here and have to check in detail where I've gone wrong.

But apart from those details I think I got the mechanism right. So just decrease those numbers in perkMetabolism further and the duration should go up.

 

Link to comment
Share on other sites

Thanks for the reply. I understand what I need to change. I am trying to figure out how to write the code to make that change, e.g. ......set xpath= etc etc. I am thinking to somehow set the identification to target the ( for example ) <requirement name="ProgressionLevel "..... @value 3, and then change the @value .769. But how do I do that since the @value .769 is above the @value 3.

 

Still new to xml edits so trying to learn ;-)

Link to comment
Share on other sites

I'm having the same problem with fortbites values. I'm thinking maybe you can't do set xpath on  trigger effects when there is more than one because you cant indicate which one to change so my next attempt will be to use append the whole lot , if that doesn't work maybe remove all of them  - then append them....

Link to comment
Share on other sites

I assume you know

 

https://community.7daystodie.com/topic/7653-xpath-modding-explanation-thread ?

 

I'm pretty sure you can specify parameters in the following requirements line, but I would have to search for the exact syntax as well.

 

Delete and replace works too. It seems many modders simply use this method to get around the complexity of xpath.

 

Edited by meganoth (see edit history)
Link to comment
Share on other sites

ok, so I tried a different approach and still must be doing something wrong. 

 

I went for completely removing the code and replace it with the new values.

 

This is the code I wanted to remove. I mean all of the triggered_effect lines.

Spoiler
<buff name="buffPerkAbilityUpdate" hidden="true" remove_on_death="false">
  <stack_type value="replace"/>
  <effect_group>
    <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value="1">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="0"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".909">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="1"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".833">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="2"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".769">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="3"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".714">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="4"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".667">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="5"/></triggered_effect>

 

 

This is what I tried to do that.

 

Spoiler
<configs>

	<remove xpath=
		"/buffs/buff[@name='buffPerkAbilityUpdate']/effect_group[@name='triggered_effect']/cvar[@name='$MetabolismDuration']"/>
</configs>

 

 

 My thinking is by using the [@name='$MetabolismDuration'], it would remove all the lines with that cvar.

The line of code I wanted to insert after is

 <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$DrowningTimerMax" operation="add" value="30"

 

So I used this,

Spoiler
<insertAfter xpath=
		"/buffs/buff[@name='buffPerkAbilityUpdate']/effect_group[@name='triggered_effect']/cvar[@name='$DrowningTimerMax']/operation[@name='add']">
		
		<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value="1">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="0"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".909">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="1"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".768">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="2"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".665">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="3"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".587">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="4"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".525">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="5"/></triggered_effect>
		</insertAfter>

 

 

 

The whole thing together looks like this,

 

Spoiler
<configs>

	<remove xpath=
		"/buffs/buff[@name='buffPerkAbilityUpdate']/effect_group[@name='triggered_effect']/cvar[@name='$MetabolismDuration']"/>
		
	<insertAfter xpath=
		"/buffs/buff[@name='buffPerkAbilityUpdate']/effect_group[@name='triggered_effect']/cvar[@name='$DrowningTimerMax']/operation[@name='add']">
		
		<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value="1">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="0"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".909">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="1"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".768">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="2"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".665">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="3"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".587">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="4"/></triggered_effect>
			<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$MetabolismDuration" operation="set" value=".525">
				<requirement name="ProgressionLevel" progression_name="perkSlowMetabolism" operation="Equals" value="5"/></triggered_effect>
		</insertAfter>

</configs>

 

 

I am guessing my remove and insertAfter are probably wrong but I don't get any errors when loading up the game.

Edited by Kman03 (see edit history)
Link to comment
Share on other sites

First of all the resulting xml is stored somewhere in your savegame so you can always check whether it does what you think it does or where it fails in changes with mulitple steps. Important: Get a diff utility to actually find every single line that changed.

 

Secondly with "remove and replace" you try to remove something completely without referencing single lines, otherwise it wouldn't be any easier. So in this case you would remove the whole buff with name "buffperkAbilityUpdate" and then reinsert the buff with dozens of unchanged lines of other perks as well.

 

Makes writing the xpath easier but also makes it more likely that your mod doesn't play well together with other mods.

 

 

 

Edited by meganoth (see edit history)
Link to comment
Share on other sites

Thanks for your help Meganoth. I tried to completely remove the "buffperkAbilityUpdate" and replace it with itself with the new values. That didn't work either. I am obviously not knowledgeable enough to figure this out lol. So instead what I did was make a complete copy of the vanilla game folder, made the changes I wanted in there and launch the game from that folder.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...