Jump to content

Can't get mod buff to stay


wizardeiges

Recommended Posts

Hello,
I'm tinkering with a mod that buffs me when I stand on it but the buff disappears the moment I leave the block. How do I get the buff to have a duration after I get off the block?
I have this line with a trap in a blocks.xml.
    <property name="BuffsWhenWalkedOn" value="buffDrugRecog" />
Which applies the buff.  What do I need to add that'll give that buff a duration ?

<property name="BuffsWhenWalkedOn" value="buffBurningMolotov"/>
Sets me on fire too and when set to,say,a dirt block,it turns the game into the floor is lava which is cool. So i'm looking to see how to add duration to all this.

Link to comment
Share on other sites

Alot of buffs use a cvar counter to determine the duration. I think recog one does,but not fully sure. Look at it in buffs.xml to see. If thats the case, you would need a primer buff as the one the player gets when stepping om block. This buff would then add the recog buff and set a cvar amount.

Link to comment
Share on other sites

Looks like recog uses a cvar called: $buffDrugRecogDuration

It's subtracted from by the @$MetabolismDuration amount, and once the $buffDrugRecogDuration is LTE 0, it removes the recog buff. That check happens every 1 sec (buffs without a defined update_rate will default to 1 sec). So you'll need a buffer buff that applies the recog buff as well as sets a duration for that cvar.

Link to comment
Share on other sites

5 hours ago, Telric said:

Looks like recog uses a cvar called: $buffDrugRecogDuration

It's subtracted from by the @$MetabolismDuration amount, and once the $buffDrugRecogDuration is LTE 0, it removes the recog buff. That check happens every 1 sec (buffs without a defined update_rate will default to 1 sec). So you'll need a buffer buff that applies the recog buff as well as sets a duration for that cvar.

Is it even possible to put that in blocks.xml?

Link to comment
Share on other sites

3 hours ago, Telric said:

BuffsWhenWalkedOn triggers a buff from buffs.xml when that specific block is walked on. You'd have to add a new buff in that xml.

darn,I hoped it'd be as easy as adding a duration line. I'm new to all this modding stuff with the game. I have no idea on how to do that at all.
I appreciate your replies.

Link to comment
Share on other sites

11 minutes ago, wizardeiges said:

darn,I hoped it'd be as easy as adding a duration line. I'm new to all this modding stuff with the game. I have no idea on how to do that at all.
I appreciate your replies.

I would suggest learning buffs.. It will open up a whole new world to modding. Most of all my mods have to do with buffs. If you attempt it and need help let me know.. But def try it yourself first. Buffs.xml is quite intimidating, but once you get the hang of it, everything is fairly straight forward in there. :)

Link to comment
Share on other sites

24 minutes ago, Telric said:

I would suggest learning buffs.. It will open up a whole new world to modding. Most of all my mods have to do with buffs. If you attempt it and need help let me know.. But def try it yourself first. Buffs.xml is quite intimidating, but once you get the hang of it, everything is fairly straight forward in there. :)

So then i'd make changes in a buffs.xml to make the block give the buff with a duration? and not blocks.xml?

Are there any tools available to make this easier? currently i'm trying to use wrathmaniac's  mod creator and i've made a few very basic mods and used it to revive a old dead mod but the block buffing thing I'm not sure on how to get it working. I'm trying though lol.

Do you think it's at all possible to get this working the way I want it to with a block applying a buff and it giving a customizable duration when getting off the block?
I went over your modlets in your thread,pretty cool spider,plane,and gate mods. Will probably use them. 😎
 

Link to comment
Share on other sites

Yeah its possible. What i would do is create a new buff.. call it say buffRecogDurationTrigger or w/e you want. have that as the buff that's given through the walkson property of the block... then in buffs.xml, inside this new buff you would do onSelfBuffStart, set the cvar (what i linked earlier) to w/e you want the duration as, then another onSelfBuffStart that would AddBuff the recog buff..

Link to comment
Share on other sites

Bout to head to bed, so if you don't manage to get it working, i wrote this buff.. it should work, though i havent tested it. if anything it can be a starting spot for ya.. this is the buff that you'd reference in the walkson property.
 


<buff name="buffThisIsYourNewBuff"  hidden="true">
		<stack_type value="replace"/>
		<duration value=".5"/> 
		<!-- you don't need a long duration for a buff that's just used as a trigger -->
		<effect_group name="Set CVar">
			<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 
			<!-- set the value here to be w/e you want the duration of the recog buff to be. -->
		</effect_group>
		<effect_group name="Add Recog Buff">
			<triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffDrugRecog" target="self"/> 
			<!-- this will add the recog buff, after this buff has finished (in .5 seconds)  -->
		</effect_group>
	</buff>

Leave a post if you need help on it.. ill check tomorrow. GL!

Link to comment
Share on other sites

8 minutes ago, Telric said:

Bout to head to bed, so if you don't manage to get it working, i wrote this buff.. it should work, though i havent tested it. if anything it can be a starting spot for ya.. this is the buff that you'd reference in the walkson property.
 



<buff name="buffThisIsYourNewBuff"  hidden="true">
		<stack_type value="replace"/>
		<duration value=".5"/> 
		<!-- you don't need a long duration for a buff that's just used as a trigger -->
		<effect_group name="Set CVar">
			<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 
			<!-- set the value here to be w/e you want the duration of the recog buff to be. -->
		</effect_group>
		<effect_group name="Add Recog Buff">
			<triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffDrugRecog" target="self"/> 
			<!-- this will add the recog buff, after this buff has finished (in .5 seconds)  -->
		</effect_group>
	</buff>

Leave a post if you need help on it.. ill check tomorrow. GL!

Awesome! thank you! i'll see what I can do with it here in a few. 😀

Link to comment
Share on other sites

22 hours ago, Telric said:

Bout to head to bed, so if you don't manage to get it working, i wrote this buff.. it should work, though i havent tested it. if anything it can be a starting spot for ya.. this is the buff that you'd reference in the walkson property.
 





<buff name="buffThisIsYourNewBuff"  hidden="true">
		<stack_type value="replace"/>
		<duration value=".5"/> 
		<!-- you don't need a long duration for a buff that's just used as a trigger -->
		<effect_group name="Set CVar">
			<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 
			<!-- set the value here to be w/e you want the duration of the recog buff to be. -->
		</effect_group>
		<effect_group name="Add Recog Buff">
			<triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffDrugRecog" target="self"/> 
			<!-- this will add the recog buff, after this buff has finished (in .5 seconds)  -->
		</effect_group>
	</buff>

Leave a post if you need help on it.. ill check tomorrow. GL!

I got it working thanks to your help! I really appreciate you taking the time to help me with all of this.
Now I have a better idea on how to put together the other mods I want that use buffs.  

I saw someone elses mod here with plate traps that stun or set on fire but I wanted them to be able to do a bunch of other different things too.

Now,how would you make something give you several buffs or debuffs at the same time? I tried making a drink before that took recog and fortbites that would apply both buffs at the same time to try and cutback on carrying multiple items at the cost of 3x but I kept getting red text and it wouldn't show up in game. 

With <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 

Would I put them ontop of each other like:
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugFortBitesDuration" operation="set" value="300"/> 

so then it'd look like this?

 

Quote



<buff name="buffThisIsYourNewBuff"  hidden="true">
		<stack_type value="replace"/>
		<duration value=".5"/> 
		<!-- you don't need a long duration for a buff that's just used as a trigger -->
		<effect_group name="Set CVar">
			<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/>
                        <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugFortBitesDuration" operation="set" value="300"/>  
			<!-- set the value here to be w/e you want the duration of the recog buff to be. -->
		</effect_group>
		<effect_group name="Add Recog Buff">
			<triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffDrugRecog" target="self"/> 
                        <triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffDrugFortBites" target="self"/> 
                        <!-- this will add the recog buff, after this buff has finished (in .5 seconds)  -->
		</effect_group>
	</buff>




Also,is there anyway to add a buff that would increase your melee speed? I see run speed in buffs but not swing speed. But I also saw another mod :
Naked Gator by the user Stample that gives a cause bleeding buff so I'm not sure on whether or not there is a way to add a drink that gives a melee speed boost. I'm not sure where to get started with something like that that isn't very obvious in buffs.xml to me.

Link to comment
Share on other sites

1 hour ago, wizardeiges said:

I got it working thanks to your help! I really appreciate you taking the time to help me with all of this.
Now I have a better idea on how to put together the other mods I want that use buffs.  

I saw someone elses mod here with plate traps that stun or set on fire but I wanted them to be able to do a bunch of other different things too.

Now,how would you make something give you several buffs or debuffs at the same time? I tried making a drink before that took recog and fortbites that would apply both buffs at the same time to try and cutback on carrying multiple items at the cost of 3x but I kept getting red text and it wouldn't show up in game. 

With <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 

Would I put them ontop of each other like:
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugRecogDuration" operation="set" value="300"/> 
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffDrugFortBitesDuration" operation="set" value="300"/> 

so then it'd look like this?

 




Also,is there anyway to add a buff that would increase your melee speed? I see run speed in buffs but not swing speed. But I also saw another mod :
Naked Gator by the user Stample that gives a cause bleeding buff so I'm not sure on whether or not there is a way to add a drink that gives a melee speed boost. I'm not sure where to get started with something like that that isn't very obvious in buffs.xml to me.

Np glad to help! You can do it that way, for sure. Use one buff that then splits off. Idk the cvar name for fort bites, so you'd have to check that buff to find out what that is exactly, unless you did already. Another way you can do it is on the actual item itself in items.xml.. you can make a onselfprimaryactionend trigger that gives each buff. Me personally, i like to do as much as possible in one xml file. So i load down with buffs. Ill make the weapon / item give a single buff (usually i call it like.. buffThisWeaponStart) then from there i trigger other buffs via buffstart, buffupdate, or bufffinish/remove.. That's just how i do it.

As for melee attack speed, that's doable too. A bit different though. It's a passive effect, meaning it will last as long as the buff lasts, or if you use cvars (a bit more advanced..) Look in items.xml for the exact like, but i think its attacksperminute. It's a passive. Also to note, anything in items.xml that is inside the <effect_group> tags are usable through buffs. Magazine size, stamina loss, all that stuff.

Link to comment
Share on other sites

9 hours ago, Telric said:

Np glad to help! You can do it that way, for sure. Use one buff that then splits off. Idk the cvar name for fort bites, so you'd have to check that buff to find out what that is exactly, unless you did already. Another way you can do it is on the actual item itself in items.xml.. you can make a onselfprimaryactionend trigger that gives each buff. Me personally, i like to do as much as possible in one xml file. So i load down with buffs. Ill make the weapon / item give a single buff (usually i call it like.. buffThisWeaponStart) then from there i trigger other buffs via buffstart, buffupdate, or bufffinish/remove.. That's just how i do it.

As for melee attack speed, that's doable too. A bit different though. It's a passive effect, meaning it will last as long as the buff lasts, or if you use cvars (a bit more advanced..) Look in items.xml for the exact like, but i think its attacksperminute. It's a passive. Also to note, anything in items.xml that is inside the <effect_group> tags are usable through buffs. Magazine size, stamina loss, all that stuff.


I got the recog one working correctly thanks to your help and from there I got the fortbite one working too.

I'm stuck again now though.
I made a plate give the RunSpeed buff but I can't figure out how to keep the buff once leaving the plate.

This is what I have:
 

Spoiler


    <buff name="buffSwiftLegs" name_key="buffSwiftLegsName" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_pills">
        <stack_type value="replace"/><duration value="0"/>
        <display_value value=".buffSwiftLegsDisplay"/><display_value_format value="time"/>
        <effect_group>
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="subtract" value="@$MetabolismDuration"/>
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="divide" value="@$MetabolismDuration"/>
        </effect_group>
        <effect_group>
            <triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffSwiftLegs">
                <requirement name="CVarCompare" cvar="$buffSwiftLegsDuration" operation="LTE" value="0"/>
            </triggered_effect>
            <triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="set" value="0"/>
            <triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="set" value="0"/>
        </effect_group>
        <effect_group>
            <passive_effect name="RunSpeed" operation="perc_add" value=".9" duration="500"/>
        </effect_group>
    </buff>
        
</append>

</configs>
 


What will make it work correctly?
I get the buff while on the pressure plate but lose it the instant I get off it.  

I tried using yours as a template at first but I couldn't get the buff to work,this is what I tried:
 

Spoiler

    <buff name="buffSwiftLegs" name_key="buffSwiftLegsName" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_pills">
        <stack_type value="replace"/>
        <duration value=".5"/> 
        <!-- you don't need a long duration for a buff that's just used as a trigger -->
        <effect_group name="Set CVar">
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffSwiftLegs" operation="set" value="500"/> 
            <!-- set the value here to be w/e you want the duration of the buff to be. -->
        </effect_group>
        <effect_group name="Add RunSpeed Buff">
            <triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffSwiftLegs" target="self"/> 
            <!-- this will add the buff, after this buff has finished (in .5 seconds)  -->
        </effect_group>
        <effect_group>
            <passive_effect name="RunSpeed" operation="perc_add" value=".9" duration="500"/>
        </effect_group>
    </buff>


Also wanted to mention that the speed buff plate makes snakes move at light speed but it doesn't affect vehicles while on it lol.


Another smaller issue i'm having is that I have no idea where to put in a items in game description.

Link to comment
Share on other sites

Well, first thing.. Buffs are read top down. This means if you have an on update that subtracts a value, before that value is set, itll mess things up. So what your buff is doing is subtracting from the cvar which is set to 0, so you're going into negative.. then its removing that buff instantly cuz of the requirement update to remove further down the buff. Try setting the cvar at the very top of the buff and see what happens. I would also use a onselfbuffstart instead of update to set the cvar. If you use update, then every tick it will reset that cvar to the value you set. The buff i gave you will work, but it has a duration of half a second. You'll just need to change that, then add in an onselfbuffupdate to subtract from the cvar, as well as add the remove buff stuff with the same requirement.

Link to comment
Share on other sites

22 hours ago, Telric said:

Well, first thing.. Buffs are read top down. This means if you have an on update that subtracts a value, before that value is set, itll mess things up. So what your buff is doing is subtracting from the cvar which is set to 0, so you're going into negative.. then its removing that buff instantly cuz of the requirement update to remove further down the buff. Try setting the cvar at the very top of the buff and see what happens. I would also use a onselfbuffstart instead of update to set the cvar. If you use update, then every tick it will reset that cvar to the value you set. The buff i gave you will work, but it has a duration of half a second. You'll just need to change that, then add in an onselfbuffupdate to subtract from the cvar, as well as add the remove buff stuff with the same requirement.




I really don't know what i'm doing anymore lol.
 

Spoiler

    <buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_pills">
        <stack_type value="replace"/><duration value=".5"/>
        <display_value value=".buffSwiftLegsDisplay"/><display_value_format value="time"/>
        <effect_group>
            <passive_effect name="RunSpeed" operation="perc_add" value=".9" duration="500">
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
        <effect_group>
            <triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffSwiftLegs" target="self">
                <requirement name="CVarCompare" cvar="$buffSwiftLegsDuration" operation="LTE" value="100"/>
        </effect_group>
    </buff>
        


 

Spoiler

    <buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_pills">
        <stack_type value="replace"/>
        <duration value=".5"/> 
        <!-- you don't need a long duration for a buff that's just used as a trigger -->
        <effect_group name="Set CVar">
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="RunSpeed" operation="set" value="500"/> 
            <!-- set the value here to be w/e you want the duration of the recog buff to be. -->
        </effect_group>
        <effect_group>
        <effect_group name="Add RunSpeed Buff">
            <triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="RunSpeed" target="self"/> 
            <!-- this will add the recog buff, after this buff has finished (in .5 seconds)  -->
        </effect_group>
    </buff>


Been at this for hours. 
I changed it to onselfbuffstart,deleted several lines,shifted them around,and nothing has worked. At one point I had it give me a 50 second buff that lasted for 5 minutes until I closed it,assuming it had a infinite buff timer while not giving me the actual speed buff,only the text from it.
 

Link to comment
Share on other sites

3 hours ago, wizardeiges said:

I wrote this and tested it, it will give a 8 minute buff when you walk on a block that gives it.
 



<buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_pills">
        <stack_type value="replace"/>
		<duration value="0"/>
        <display_value value=".buffSwiftLegsDisplay"/>
		<display_value_format value="time"/>
		<effect_group name="Set CVars">
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="set" value="500"/>
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
			
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="subtract" value="1"/>
		</effect_group>
        <effect_group name="Passive Effects">
            <passive_effect name="RunSpeed" operation="perc_add" value=".9"/>
		</effect_group>
    </buff>


If you want it to do something else, let me know.

 

Not sure why it put all that in a quote... lol

Link to comment
Share on other sites

12 hours ago, Telric said:

 

Not sure why it put all that in a quote... lol

Woooow I was over complicating that to hell and back. What I was trying with 5-30 lines you've done in only a few.

When I trigger the buffs,I can't seem to reapply them if it's already going so if I trigger the 8minutes then I have to wait the full 8 minutes before being able to reapply the buff. Is there anyway I can get the plate to retrigger the buff and set it back to the 8 minute cap?
Also,by using what you posted as a template,I got the swing speed working and lol. Slowly turning 7 days into a punching doom mod.


I just reloaded my game when having the buff and when loading back in,the buff turned to 58 minutes long. Eating glass removes it but getting the buff and loading back in with it changes the duration to 58 minutes everytime. Is there anyway to prevent this?

 

Link to comment
Share on other sites

For the reapplying it part, you can add a onSelfBuffStack just above the first onSelfBuffStart. Have it also set the cvars (basically copy paste the first two lines in Set CVars effect group and rename them to be onSelfBuffStack.) This will make it so when the buff triggers it's stack_type=Replace, it will reset the cvars. As for the reloading... i'm not sure ill have to try it out myself later today after work and get back to you on that.

Link to comment
Share on other sites

11 hours ago, Telric said:

For the reapplying it part, you can add a onSelfBuffStack just above the first onSelfBuffStart. Have it also set the cvars (basically copy paste the first two lines in Set CVars effect group and rename them to be onSelfBuffStack.) This will make it so when the buff triggers it's stack_type=Replace, it will reset the cvars. As for the reloading... i'm not sure ill have to try it out myself later today after work and get back to you on that.


Like this?
 

Spoiler

<buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_agility"  icon_color="0,255,0">
        <stack_type value="replace"/>
        <duration value="0"/>
        <display_value value=".buffSwiftLegsDisplay"/>
        <display_value_format value="time"/>
        <effect_group name="Set CVars">
            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="set" value="500"/>
            <triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="set" value="500"/>
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
            
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".buffSwiftLegsDisplay" operation="subtract" value="1"/>
        </effect_group>
        <effect_group name="Passive Effects">
            <passive_effect name="RunSpeed" operation="perc_add" value=".9"/>
            <passive_effect name="AttacksPerMinute" operation="perc_add" value=".9"/>
            <passive_effect name="JumpStrength" operation="perc_add" value=".9"/>
        </effect_group>
    </buff>



It doesn't reset the buff so i'm going to assume I did it wrong. What should it look like?

I've buffed then restarted the game and severytime it applies the buff at 59 minutes without fail on reloading back in when loading out with the buff. It's weird because it doesn't do that with the recog plate buff,also the recog plate buff can be reset without issue by touching the recog plate.
 

Link to comment
Share on other sites

Hmm idk why its not reseting.. but i did some patchwork on it.. This buff works if you want to use it. Just need to change the buffswhenwalkedon to be the buffSwiftLegsTrigger. (i added that one.) tested the resting and it works. As for the timer going up to 59 minutes, it was because you used a . cvar... from the documentation: "CVars that start with "." are NOT networked AND they are not saved with the game."  so it wasnt saving the cvar. changing it to be a normal cvar made the timer stay as it should be.

 


<buff name="buffSwiftLegsTrigger" hidden="true">
        <stack_type value="ignore"/>
        <duration value=".5"/>
        <effect_group name="Replace if HasBuff">
            <triggered_effect trigger="onSelfBuffStart" action="RemoveBuff" buff="buffSwiftLegs" target="self"/>
			
            <triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffSwiftLegs" target="self"/>
        </effect_group>
    </buff> 
<buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_agility"  icon_color="0,255,0">
        <stack_type value="effect"/>
        <duration value="0"/>
        <display_value value="buffSwiftLegsDisplay"/>
        <display_value_format value="time"/>
        <effect_group name="Set CVars">			
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="set" value="500"/>
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
            
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="buffSwiftLegsDisplay" operation="subtract" value="1"/>
        </effect_group>
        <effect_group name="Passive Effects">
            <passive_effect name="RunSpeed" operation="perc_add" value=".9"/>
            <passive_effect name="AttacksPerMinute" operation="perc_add" value=".9"/>
            <passive_effect name="JumpStrength" operation="perc_add" value=".9"/>
        </effect_group>
    </buff> 

 

Link to comment
Share on other sites

2 hours ago, Telric said:

Hmm idk why its not reseting.. but i did some patchwork on it.. This buff works if you want to use it. Just need to change the buffswhenwalkedon to be the buffSwiftLegsTrigger. (i added that one.) tested the resting and it works. As for the timer going up to 59 minutes, it was because you used a . cvar... from the documentation: "CVars that start with "." are NOT networked AND they are not saved with the game."  so it wasnt saving the cvar. changing it to be a normal cvar made the timer stay as it should be.

 





<buff name="buffSwiftLegsTrigger" hidden="true">
        <stack_type value="ignore"/>
        <duration value=".5"/>
        <effect_group name="Replace if HasBuff">
            <triggered_effect trigger="onSelfBuffStart" action="RemoveBuff" buff="buffSwiftLegs" target="self"/>
			
            <triggered_effect trigger="onSelfBuffFinish" action="AddBuff" buff="buffSwiftLegs" target="self"/>
        </effect_group>
    </buff> 
<buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegsDesc" tooltip_key="buffMegaCrushTooltip" icon="ui_game_symbol_agility"  icon_color="0,255,0">
        <stack_type value="effect"/>
        <duration value="0"/>
        <display_value value="buffSwiftLegsDisplay"/>
        <display_value_format value="time"/>
        <effect_group name="Set CVars">			
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffSwiftLegsDuration" operation="set" value="500"/>
            <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="buffSwiftLegsDisplay" operation="set" value="@$buffSwiftLegsDuration"/>
            
            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="buffSwiftLegsDisplay" operation="subtract" value="1"/>
        </effect_group>
        <effect_group name="Passive Effects">
            <passive_effect name="RunSpeed" operation="perc_add" value=".9"/>
            <passive_effect name="AttacksPerMinute" operation="perc_add" value=".9"/>
            <passive_effect name="JumpStrength" operation="perc_add" value=".9"/>
        </effect_group>
    </buff> 

 


 Lol I was pretty far off from getting this to work properly after looking at what you put together.
Do you have charts for this,have some tool,or have you just memorized how to do all of this?
The buff can even be topped back up when touching the plate now! 😎

I've gone through other mods xml files trying to learn how to make these mods but I haven't been able to figure out how to take from them on how to structure these mods correctly.
The traps mod made by someone else is similar but comparing what you put together and what they put together,they're very different from each other. I find yours a lot more understandable due to how it's structured a lot differently.

With this,I can make slight edits and put in any of the passive effects to build all of the buff plates! I really appreciate all of your help. I doubt I would have gotten this far without you helping.

Now I have a few other things I need to do:
How to make a drink that gives these passive buffs
How to make a block / items description
How to change a items worth because these plates are worth 7k+ and I don't want them to be worth so much.
 

Spoiler

 

I thought item description was in the descriptionkey:

Spoiler


    <block name="SwiftLegsPlate">
    <property name="CustomIcon" value="pressureplateLong"/>
    <property name="CustomIconTint" value="13ff00"/>
    <property name="DescriptionKey" value="SwiftLegs-Walking on this will apply a SwiftLegs buff. Run like the wind."/>



But that doesn't make it show up in the game in the items description. What am I doing wrong?

I thought it might have been the localization too because I have mods that have the description in the localization but that doesn't work either:
 

Spoiler

SwiftLegsPlate,blocks,Block,New,SwiftLegsPlate,,,,,
SwiftLegsPlateDesc,blocks,Block,New,"This will Apply a SwiftLegs buff when walked on.",,,,,



I was able to get the Description for the buff to work in game and even changed the little text that pops up when triggering it:
 

Spoiler

<buff name="buffSwiftLegs" name_key="buffSwiftLegs" description_key="buffSwiftLegs- You feel your body swell with strength! Run speed +90% AttacksPerminute+90% JumpStrength+90%" tooltip_key="Rip and Tear until it is done!" icon="ui_game_symbol_agility"  icon_color="0,255,0">
 



But a items description doesn't seem to change like a buffs description does when editing the description key.
I've tried some guesswork by moving  description_key="213123123" into the block name row and that didn't do anything.

 


Edited: lol I figured out how to set a items description.

Link to comment
Share on other sites

I've been messing with buffs for a long time. Years.. so i just know what to do with them generally. Having organization in buffs will definitly help out. I dont think there's a limit to how many effect groups you can have, so use them to organize as much as possible. Very useful. For your other howtos.. Drink to give a buff would be in items.xml, in the actual items effect group, add a onSelfSecondaryActionEnd (or primary, depending) that adds the buff in question. Localization is wehre you do all descriptions and such. Easiest way would be to have a localization.txt file in your mod with Key,English at the very top. then you'll just need the item / buff name, followed by the english translation. For the value, look for economicvalue in items.xml or blocks.xml. The price you pay to obtain will always be 5x that amount i believe. (traders.xml controls the % markup)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...