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

Issue with Burning FX on custom Burning Buff

Hello! I am having an issue where my custom buff applies the Burning particle, and is supposed to remove that particle/effect at the end of the buff.

Issue is, the burning effect lasts only for a moment, and not the full duration of the buff, and I'm wondering if anyone knows what Im doing wrong.

Here is the Code I am using, the Particle Effect portion is below the comment "<!-- Particle & FX -->"

<configs>
<append xpath="/buffs">
<buff name="buffScorchElement" name_key="buffScorchName" description_key="buffScorchDesc" showonhud="true" icon="ui_game_symbol_near_death_trauma" icon_color="255,0,0">
<stack_type value="replace"/>
<duration value="5"/>
<display_value value=".buffScrochDuration"/>
<display_value_format value="time"/>
<effect_group>
<!-- Duration Handling -->
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar=".buffScrochDuration" operation="set" value="5"/>
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".buffScrochDuration" operation="add" value="-1"/>

<!-- Effect -->
<passive_effect name="BuffBlink" operation="base_set" value="2" duration="0,3" tags="buffScorchElement"/>
<passive_effect name="HealthChangeOT" operation="base_subtract" value="1"/>

<!-- Cleanup Handling -->
<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffScorch">
<requirement name="CVarCompare" cvar=".buffScrochDuration" operation="LTE" value="0"/>
</triggered_effect>
<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar=".buffScrochDuration" operation="set" value="0"/>


<!-- Particle & FX -->
<triggered_effect trigger="onSelfBuffStart" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,0,0" parent_transform="LOD0" shape_mesh="true"/>
<triggered_effect trigger="onSelfEnteredGame" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,0,0" parent_transform="LOD0" shape_mesh="true"/>

<triggered_effect trigger="onSelfBuffRemove" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>
<triggered_effect trigger="onSelfDied" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>

<triggered_effect trigger="onSelfBuffRemove" action="StopSound" sound="buff_burn_lp"/>
<triggered_effect trigger="onSelfBuffRemove" action="PlaySound" sound="buff_burn_extinguish"/>
</effect_group>
</buff>
</append>
</configs>




Here is a link to a video to show the buff's duration VS the Burning Effect:

(Note, Equipping the Scrap Gloves is my method for applying the buff to myself)

https://youtu.be/LwPSy_fJy04

Thanks for the read!

 
Last edited by a moderator:
Well, remove the dirty language. All this talking about scrotches. 😁

(If you don't get the hint, check how you write "scorch" in some of your lines)
Fixed the typo, but that was just a typo for the variable that holds the duration of the buff.

Still having the issue where the Burning Particle/Effect lasts ~1 second, while the buff works properly (full duration)

 
Mmh, another thing where I might as well be on the wrong track: You remove the buff with

action="RemoveBuff" buff="buffScorch"




but this buffs name is

Code:
 <buff name="buffScorchElement"
 
Last edited by a moderator:
Mmh, another thing where I might as well be on the wrong track: You remove the buff with

action="RemoveBuff" buff="buffScorch"




but this buffs name is

<buff name="buffScorchElement"



Fixed the typo.

<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffScorchElement">
<requirement name="CVarCompare" cvar=".buffScorchDuration" operation="LTE" value="0"/>
</triggered_effect>




I'll make a note that it is interesting that the buff was automatically removing when the Duration hits 0, rather than the buffScorchElement cvar.

But yeah, still having the issue where the burning particle/effect still is being removed ~1 second when the buff starts.

 
Fixed the typo.

<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffScorchElement">
<requirement name="CVarCompare" cvar=".buffScorchDuration" operation="LTE" value="0"/>
</triggered_effect>




I'll make a note that it is interesting that the buff was automatically removing when the Duration hits 0, rather than the buffScorchElement cvar.

But yeah, still having the issue where the burning particle/effect still is being removed ~1 second when the buff starts.


It would be good if you posted the whole section again with all changes.

What about the sound? Does it stop immediately too? If yes, "OnSelfBuffRemove" must be true after a tick (or second). If not, it must be a problem with the lines turning on or off the fire fire effect

 
Yeah, posting the whole version now with the typos fixed would help.

Only thing I could say to try it set the duration to 0 since you are using cvars to handle the removal anyways. Shouldn't affect anything I wouldn't think, but never know. Other than that I don't see anything else, but need to see the fixed version to know everything matches up.

 
It would be good if you posted the whole section again with all changes.

What about the sound? Does it stop immediately too? If yes, "OnSelfBuffRemove" must be true after a tick (or second). If not, it must be a problem with the lines turning on or off the fire fire effect


Posting whole code at the bottom of this reply. As for the sound it triggers correctly, when the buff is removed (at the end of the duration/timer)

Yeah, posting the whole version now with the typos fixed would help.

Only thing I could say to try it set the duration to 0 since you are using cvars to handle the removal anyways. Shouldn't affect anything I wouldn't think, but never know. Other than that I don't see anything else, but need to see the fixed version to know everything matches up.


Set the duration to 0, nothing changed visually or functionally. Still get the issue of the burning particle/effect lasting ~1 second.

Current version of the code being ran:

<configs>
<append xpath="/buffs">
<buff name="buffScorchElement" name_key="buffScorchName" description_key="buffScorchDesc" showonhud="true" icon="ui_game_symbol_near_death_trauma" icon_color="255,0,0">
<stack_type value="replace"/>
<duration value="5"/>
<display_value value=".buffScorchDuration"/>
<display_value_format value="time"/>
<effect_group>
<!-- Duration Handling -->
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar=".buffScorchDuration" operation="set" value="5"/>
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".buffScorchDuration" operation="add" value="-1"/>

<!-- Effect -->
<passive_effect name="BuffBlink" operation="base_set" value="2" duration="0,3" tags="buffScorchElement"/>
<passive_effect name="HealthChangeOT" operation="base_subtract" value="1"/>

<!-- Cleanup Handling -->
<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffScorchElement">
<requirement name="CVarCompare" cvar=".buffScorchDuration" operation="LTE" value="0"/>
</triggered_effect>
<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar=".buffScorchDuration" operation="set" value="0"/>


<!-- Particle & FX -->
<triggered_effect trigger="onSelfBuffStart" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,0,0" parent_transform="LOD0" shape_mesh="true"/>
<triggered_effect trigger="onSelfEnteredGame" action="AttachParticleEffectToEntity" particle="p_onFire" local_offset="0,0,0" parent_transform="LOD0" shape_mesh="true"/>

<triggered_effect trigger="onSelfBuffRemove" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>
<triggered_effect trigger="onSelfDied" action="RemoveParticleEffectFromEntity" particle="p_onFire"/>

<triggered_effect trigger="onSelfBuffRemove" action="StopSound" sound="buff_burn_lp"/>
<triggered_effect trigger="onSelfBuffRemove" action="PlaySound" sound="buff_burn_extinguish"/>
</effect_group>
</buff>
</append>
</configs>






I'm going to test an alternate method and I'll reply back within 2 hours.

 
Ok so Here is my update:

So just for fun, with the code above, I replaced every source of "p_onFire" with "p_electric_shock".

When tested, the Shock Effect lasts the full duration (It is added and removed properly)

Here is the code for my Alternate Method, and the notes about it, below the code:

<configs>
<!-- Add custom Vars -->
<append xpath="/buffs/buff[@name='buffPerkAbilityUpdate']">
<effect_group>
<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="varScorchDurationDE" operation="set" value="5"/> <!-- Not the actual timer, just the start-value the timer can reference on buffStart -->
<triggered_effect trigger="onSelfBuffStack" action="ModifyCVar" cvar="varScorchDamage" operation="set" value="-2"/>
<!--
Scorch deals damage every second, so Damage = (buffScorchDamage * buffScorchDurationDE)
NOTE: buffBurningElement has its own Damage over Time of 1 so total damage is this:
Total Damage = (buffScorchDurationDE * (buffScorchDamage + 1))
-->
</effect_group>
</append>

<append xpath="/buffs">
<buff name="buffScorch" name_key="buffScorchName" description_key="buffScorchDesc" showonhud="true" icon="ui_game_symbol_near_death_trauma" icon_color="255,0,0">
<stack_type value="replace"/>
<duration value="0"/>
<display_value value=".varScorchDuration"/>
<display_value_format value="time"/>

<effect_group>
<!-- Duration Handling -->
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar=".varScorchDuration" operation="set" value="@varScorchDurationDE"/>
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar=".varScorchDuration" operation="add" value="-1"/>

<!-- Particle & FX -->
<triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBurningElement"/>
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="@varScorchDurationDE"/> <!-- Doesnt actually set, see notes -->

<!-- Effect of being Scorched -->
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyStats" stat="Health" operation="add" value="@varScorchDamage"/>

<!-- Cleanup Handling :: Scorch -->
<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffScorch">
<requirement name="CVarCompare" cvar=".varScorchDuration" operation="LTE" value="0"/>
</triggered_effect>
<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar=".varScorchDuration" operation="set" value="0"/>

<!-- Cleanup Handling :: buffBurningElement & Visual Effect -->
<triggered_effect trigger="onSelfBuffRemove" action="RemoveBuff" buff="buffBurningElement"/>
<triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="0"/>
</buff>
</append>
</configs>



Here is a video to showcase this method is working:

https://youtu.be/xzeipb4-GQU

Although a little bit janky, this method works, with 2 issues:

1) The VAR for buffBurningElementDuration isnt able to be changed (possibly due to how the buff "buffBurningElement" sets that VAR)

2) We now have 2 buffs visually displayed with this method, note that buffBurningElement cuts off early (which is intended, for now)

In order for this method to work we need 2 buffs:
   buffIsOnFire
   buffBurningElement
    
How this method works:
   When we apply buffScorch, it handles the Damage over Time and Duration. It also applies the 2 buffs:
   buffScorch will apply buffBurningElement
   buffBurningElement applies buffIsOnFire
   
   buffIsOnFire is what provides us with the Visual Effect of Burning.
   NOTES on buffIsOnFire:
   1) It shows up on the HUD
   2) its display value/var is ".buffIsOnFireDisplay"
   3) buffIsOnFire has a section for the setting of ".buffIsOnFireDisplay" based on if the entity has sources of burning (Flame arrow / Molotav / etc)
   4) buffIsOnFire has a section for removing its self if the entity DOES NOT have a burning buff (buffBurningFlamingArrow, buffBurningMolotov, buffBurningElement, etc)
   
   buffBurningElement is what provides us with being able to keep buffIsOnFire up, because as stated above, buffIsOnFire will be removed if no other burning buffs detected.
   
NOTE: buffBurningElementDuration seems to set its duration to 10

When trying to set the VAR "buffBurningElementDuration" like this:
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="@varScorchDuration"/>
The VAR "buffBurningElementDuration" still retains a value of 10

When trying to set the VAR "buffBurningElementDuration" like this (onSelfBuffUpdate rather than onSelfBuffStart):
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="@varScorchDuration"/>
The VAR "buffBurningElementDuration" still retains a value of 10 BUT seems to cause the buff "buffBurningElement" to last ~1 second

When trying to set the VAR "buffBurningElementDuration" like this(value instead of access a CVAR's value:
<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$buffBurningElementDuration" operation="set" value="5"/>
The VAR "buffBurningElementDuration" still retains a value of 10

So to conclude, this method works, but has a few issues, which shouldnt matter because the player most likely will have this buff on them with how I intend to use this buff. I only showcase the buff on the player for testing. This buff is intended to be applied to enemies / non-players.

 
Last edited by a moderator:
Could you make a bug report with the non-working code and mention that substituting with p_electric_shock works? It might take a while but it should get fixed eventually.

 
Could you make a bug report with the non-working code and mention that substituting with p_electric_shock works? It might take a while but it should get fixed eventually.


I should have some time tomorrow to report the bug, just wanna test a little bit more before submitting.

 
Back
Top