PDA

View Full Version : 5e Ongoing damage oddity



Stv
May 2nd, 2021, 14:22
Hi,
I've noticed that ongoing damage is applied 2 different times depending on if it is a static value or a die roll.
Is there a reason for this, as it's really making my life hard to get it to function as I need in a new extension I'm writing.

Pic attached to show what I mean.

Cheers, Steve

Zacchaeus
May 2nd, 2021, 15:39
I'm not sure what your issue is. You have two DMGO's on the player one that does a fixed amount and one that does a random amount. Obviously both will be applied to the player since you have two of them on. What is it you are trying to achieve?

Stv
May 2nd, 2021, 15:56
The issue I have is that one of the damages is applied before the character starts its turn, and the other after the player starts its turn. I'm just wondering why this is, as both are DMGO.

Cheers, Steve.

Kelrugem
May 2nd, 2021, 17:59
The static one is just "faster" because there is no physical die rolled, that is normal :) The order of the chat messages is not the same as the order of application, just depends on when the chat message gets activated in the code; so, at actor's turn start the static DMGO chat message is just earlier :) So, the actor is already active even if the chat message for that is slightly later (and the information for the static DMGO effect about the actor is there, otherwise its damage couldn't be applied; maybe that helps, too?) :)

If you still see a problem, then we may need to know more about what you want to achieve with your code :)

Stv
May 2nd, 2021, 18:05
I'll investigate further, I hope you're correct Kelrugem :)

Hopefully I don't have to change how I am approaching things.

Cheers, Steve.

Stv
May 2nd, 2021, 18:48
Just done a bit more digging, and it looks to me that the static DMGO damage is applied before the turn start.
It's definately before the CombatManager.setCustomTurnStart funtion is called.

Back to the drawing board I think :S

Cheers, Steve.

*Edit*

Ignore the above, I'll have to try and get the data I need before it's pushed to the chat, as I think the latency of the die roll chat is the problem.

Kelrugem
May 2nd, 2021, 21:15
Just done a bit more digging, and it looks to me that the static DMGO damage is applied before the turn start.
It's definately before the CombatManager.setCustomTurnStart funtion is called.

Back to the drawing board I think :S

Cheers, Steve.

*Edit*

Ignore the above, I'll have to try and get the data I need before it's pushed to the chat, as I think the latency of the die roll chat is the problem.

You could try to edit the applyOngoingDamageAdjust (it is called something like this, may be a bit differently named) in the 5e effect manager for example :) But not sure if this helps since I do not know what you want to do :D

Stv
May 2nd, 2021, 21:37
But not sure if this helps since I do not know what you want to do :D

It's a secret ^^

I'm trying to enable/disable an effect depending on if damage has been taken. The DMGO latency is proving problematic at the moment. I'll figure a workaround though (I hope:) )

Cheers, Steve

Kelrugem
May 2nd, 2021, 21:59
It's a secret ^^

I'm trying to enable/disable an effect depending on if damage has been taken. The DMGO latency is proving problematic at the moment. I'll figure a workaround though (I hope:) )

Cheers, Steve

:D

In PF1 the regeneration effect is disabled for one round if damage of a specific type is taken :) You could take a look there, that sounds like something similar to your situation :) (look in the 3.5e ruleset; both rulesets share the same scripts, PFRPG.pak just changes some general data in DataCommon)

Stv
May 2nd, 2021, 22:00
Sweet, thanks for the pointer. I'll take a look.

Cheers, Steve.

Zacchaeus
May 2nd, 2021, 22:07
Same thing applies in 5e to regeneration if specific damage is taken. See any vampire.

Kelrugem
May 2nd, 2021, 22:20
Same thing applies in 5e to regeneration if specific damage is taken. See any vampire.

ah, even better probably then :)

DCrumb
May 3rd, 2021, 14:49
@Stv If you add a few more actors between the start of round and the actor that is getting the ongoing damage, does that change the difference in timing between the static damage and the rolled damage? It may be that the static damage is going off at the start of round, and the rolled damage is going off at the actor's turn.

Trenloe
May 3rd, 2021, 16:48
The rolled damage, like other rolls in FG, is initiated by the same code as the set damage (no dice). However, as the FG code doesn't wait for the dice to be rolled and land (if it did this FG would stop processing all code during this time) when the code for DMGO ends, the code for the actor end of turn runs, and so the code for the beginning of the next actor's turn also runs - then the dice stop rolling and the dice based DMGO code runs and applies the results of the roll. This is pretty standard throughout FG code - if actual dice are being rolled, then code continues while the dice are being rolled, and then the application of the roll occurs later, once the dice stop rolling.

Some code, e.g. rolling of NPC initiative when they're added to the CT, is done via in script random number generation, so that the result is available to the code immediately. It would obviously take a bit of work to change DMGO to use a random number instead of a dice roll in the base 5e ruleset (and some users might not like it), but that might be something to look into for your code. Otherwise, you'll need to look into the DMGO result application code to see how to process the result of the dice based DMGO rolls.

Stv
May 3rd, 2021, 19:14
The rolled damage, like other rolls in FG, is initiated by the same code as the set damage (no dice). However, as the FG code doesn't wait for the dice to be rolled and land (if it did this FG would stop processing all code during this time) when the code for DMGO ends, the code for the actor end of turn runs, and so the code for the beginning of the next actor's turn also runs - then the dice stop rolling and the dice based DMGO code runs and applies the results of the roll. This is pretty standard throughout FG code - if actual dice are being rolled, then code continues while the dice are being rolled, and then the application of the roll occurs later, once the dice stop rolling.



Some code, e.g. rolling of NPC initiative when they're added to the CT, is done via in script random number generation, so that the result is available to the code immediately. It would obviously take a bit of work to change DMGO to use a random number instead of a dice roll in the base 5e ruleset (and some users might not like it), but that might be something to look into for your code. Otherwise, you'll need to look into the DMGO result application code to see how to process the result of the dice based DMGO rolls.


Yeah, I think I have some more work to do ^^

Cheers, Steve.