Jump to content

Making a Poison DoT debuff


Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

8 minutes ago, bdubyah said:

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.

Link to comment
Share on other sites

  • 2 weeks later...
On 10/3/2021 at 7:18 PM, bdubyah said:

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.

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