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

Making a Poison DoT debuff

Hello everyone, I am trying to attempt/theorize a Poison debuff that applies damage over time. 

I am using the Bleeding debuff as a guide on how to make a Poison version of the Bleed debuff.

The question I have is, if I change this code:
 

<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffInjuryBleeding">
    <requirement name="CVarCompare" cvar="$bleedDuration" operation="LTE" value="0"/>
</triggered_effect>




To this:
 

<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffPoisonDoT">
    <requirement name="CVarCompare" cvar="$poisonDuration" operation="LTE" value="0"/>
</triggered_effect>




will the CVar of "poisonDuration" function? Or does it fail, because I havent declared a poisonDuration variable in some other file?

I hope the question I'm asking makes sense, basically I'm replacing vars like "bleedDuration" and "bleedCounter" with "poisonDuration" and "poisonCounter" but I'm wondering if that would even work or would it fail because I need to declare those variables somewhere first?

 
buffInjuryBleeding has a pretty good example of this. BleedCounter is applied either from the item or perks, such as perkDeepCuts. But you could set your counter a few different ways. It basically controls the HP lost in this situation, in conjunction with bleedAmount. There's a bit to it, but you can follow it in that buff.

So look at buffInjuryBleeding and compare it with perkDeepCuts and that should give you good idea of how it all works.

 
buffInjuryBleeding has a pretty good example of this. BleedCounter is applied either from the item or perks, such as perkDeepCuts. But you could set your counter a few different ways. It basically controls the HP lost in this situation, in conjunction with bleedAmount. There's a bit to it, but you can follow it in that buff.

So look at buffInjuryBleeding and compare it with perkDeepCuts and that should give you good idea of how it all works.


I've looked at both buffInjuryBleeding and perkDeepCuts, and understand how they function, but my question was more of whether I need to assign/initialize custom variables someplace first, before using them, since "poisonDuration" and "poisonCounter" are not actually in the game, I'm just curious if I need to initialize them someplace first before using them.

I want to note here that I dont want to use the bleed variables(bleedAmount, bleedCounter, etc) in the poison debuff code, because Im sure if an enemy is poisoned and bleeding, there will be issues with sharing similar variables.

 
No, you just use whatever. No need to initialize them. They will just work.


As a follow-up: If you set a cvar to zero it will disappear - it's the same as removing it altogether.

You can see cvars and buffs by pressing F3 in game, then selecting "ply" in the window that pops up. If you have set a cvar to zero, you will not see it in the list.

 
Back
Top