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

Can't get mod buff to stay

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.

 

Code:
<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>
 
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.
 

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:
 

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:
 

<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.

 
Last edited by a moderator:
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)

 
Back
Top