PDA

View Full Version : Nsaty bug with "IF"



Asgurgolas
December 6th, 2020, 05:28
So, I have a Dragon Shaman character in my 3.5 game who has the ability to "fast healing 1 whenever HP are at or below half its total" (a draconic aura, to be exact). So I went and scripted an effect "IF: bloodied; FHEAL: 1" ("whenever you ping as "bloodied" (50% or less hp), then run a FHEAL: 1").
And it works. It works until for some reason, HP go to negative (-1 or less), at which point FG hangs up for quite a lot, delivers me a "Script Error: [string "scripts/manager_actor.lua"]:29: stack overflow", and most of the times I need to shut down FG from task manager and re-run it to remove that effect from CT's actor (while hoping it doesn't hang up again in the meantime). Among things (should it unfreeze on its own), that character's HP are locked: I can modify'em as much as I want, if I bear with its hanging for minutes each time... but damage and healing effects, such as attacks and cure wounds, don't budge the value: if that character has 24 wounds over 20 total hp (-4), a longsword critical dealing 24 damage still leaves wounds at 24. Same with "cure wounds" healing 10 hp, still leaves wounds at 24.

At first I thought it was some extension, but this bug persists with

my 3.5 campaign
my 3.5 campaign with no extensions
3.5 new campaign (created for this test), clean, no data besides FG default
PF1 new campaign (created for this test), clean, no data besides FG default
5e new campaign (created for this test), clean, no data besides FG default

Aat this point I suppose it's not a matter of settings, so I here I am to ask for help, wisdom, and possibly a pop-corn bag

LordEntrails
December 6th, 2020, 06:07
Pop corn sounds good :)

I think this is something the devs are going to have to look into. Sounds like a out of bounds error :)

Kelrugem
December 6th, 2020, 06:24
Hm, once I also ran into that problem (Asgurgolas, since you know my extensions, that was about that nodex also recognizes CA, there I had a similar trouble). I thought it was about my extension, but since you were able to reproduce it without extensions now, a fix of that may also allow me to extend my extensions :D Thus, I am now here, too

... and I have brought popcorn! :D

Asgurgolas
December 6th, 2020, 09:18
"Extend extensions" sounds spiffy *eats popcorn*

superteddy57
December 6th, 2020, 15:39
I attempted to try and replicate the issue, but it appears to be working. We might need more information as I am unable to get the error to fire.

41710

Kelrugem
December 6th, 2020, 16:13
I attempted to try and replicate the issue, but it appears to be working. We might need more information as I am unable to get the error to fire.

41710

As far as I see the wounds did not succeed the HP in your example, isn't it? For example start with 14 or 15 wounds while having 13 HP :)

superteddy57
December 6th, 2020, 16:20
I continued testing with 15, 26, 36, and 56 wounds and it didn't produce the error in either of those cases. What I did find is at 15 it will roll the stabilization roll and add damage instead of healing. What my goal is to see if I could replicate the error reported. With the information provided, I'm having a bit of trouble to do so. We might need some logs to see if I can see if I'm missing something with my test case.

Kelrugem
December 6th, 2020, 16:25
I continued testing with 15, 26, 36, and 56 wounds and it didn't produce the error in either of those cases. What I did find is at 15 it will roll the stabilization roll and add damage instead of healing. What my goal is to see if I could replicate the error reported. With the information provided, I'm having a bit of trouble to do so. We might need some logs to see if I can see if I'm missing something with my test case.

The stabilization roll always results into damage when it is a failure, it does not heal when it successes (it just applies "stable" effect then) :) (EDIT: Ah, wait, now I know what you mean, the FHEAL should already lead to a "stable" effect, hence, no damage expected :D )

I also now just tested and I could not replicate it sadly, too

superteddy57
December 6th, 2020, 16:32
The stabilization roll always results into damage when it is a failure, it does not heal when it successes (it just applies "stable" effect then) :) (EDIT: Ah, wait, now I know what you mean, the FHEAL should already lead to a "stable" effect, hence, no damage expected :D )

I also now just tested and I could not replicate it sadly, too

Agreed, still a weird issue, but at the moment, not able to replicate it. I would say if anyone runs into this again, to please collect the logs and we'll have another crack at tracking down the culprit.

Asgurgolas
December 6th, 2020, 18:36
In my current testing (between one busy thing and another), the bug happens to trigger ONLY on character sheets (NPCs seems to work fine), and not on pf1 anymore (don't ask XD).

I think it has to do with some fix from a long time ago, that "stopped" fast healing from working when HP were negative, but I think it was from some extension and I tested extensionless... so I'm back on the dowsing work :p


Also in the current campaign (where I'm also testing with extensions) the error goes on both "29" and "210"

Script Error: [string "scripts/manager_actor.lua"]:210: stack overflow
Script Error: [string "scripts/manager_actor.lua"]:29: stack overflow

celestian
December 6th, 2020, 19:47
In my current testing (between one busy thing and another), the bug happens to trigger ONLY on character sheets (NPCs seems to work fine), and not on pf1 anymore (don't ask XD).

I think it has to do with some fix from a long time ago, that "stopped" fast healing from working when HP were negative, but I think it was from some extension and I tested extensionless... so I'm back on the dowsing work :p


Also in the current campaign (where I'm also testing with extensions) the error goes on both "29" and "210"

Script Error: [string "scripts/manager_actor.lua"]:210: stack overflow
Script Error: [string "scripts/manager_actor.lua"]:29: stack overflow

That smells like a object being removed while in a for loop iterating over the object list.

I had a similar issue where I was trying to remove an effect within the damage "application" (manager_action_damage.lua I think?) but on top of that was a for loop iterating over said list of objects (effects).

Might be completely unrelated but... you can use the trace and see whats called before the errors.

Kelrugem
December 6th, 2020, 19:55
Yes, with my extension loaded I can reproduce it, though I do not understand what stack overflow means, I also did not directly touch manager_actor or the effects bloodied and FHEAL, so, not sure what is going on; better do not use bloodied for such things at the moment :) (funnily, IF: CUSTOM(bloodied); FHEAL: 1 works (having the effect bloodied then, too), hence, other combinations work, it is just about bloodied and FHEAL). So at the moment you may want to avoid such edge case effects, until I can look at that :)

Kelrugem
December 6th, 2020, 19:56
That smells like a object being removed while in a for loop iterating over the object list.

I had a similar issue where I was trying to remove an effect within the damage "application" but on top of that was a for loop iterating over said list of objects (effects).

Might be completely unrelated but... you can use the trace and see whats called before the errors.

Ah, thanks for the advice, maybe something related to the addition/removal of the stable effect in that said process; hmm

Asgurgolas
December 6th, 2020, 20:12
On a side note; I tried using kelrugem's overlay package to "NIF: dying; IF: bloodied; FHEAL: 1" in the hope to halt fast healing while at -1 or lower, but it doesn't work (it just ignores the whole effect)

Kelrugem
December 6th, 2020, 20:14
On a side note; I tried using kelrugem's overlay package to "NIF: dying; IF: bloodied; FHEAL: 1" in the hope to halt fast healing while at -1 or lower, but it doesn't work (it just ignores the whole effect)

Yes, because dying is in general not a condition which you can test for :)

Asgurgolas
December 6th, 2020, 21:26
Yes, because dying is in general not a condition which you can test for :)

You sure? Because "IF: dying; stable" works ^^; (with that it won't check the d100 for stabilization rolls when at -1 or lower nor it will deal 1 damage on failure)

Kelrugem
December 6th, 2020, 21:40
Yeah, pretty sure :) When the IF is used for something which does not exist in sense of coding, then that part is simply ignored which is why nothing happens. It is like you would have applied just the stable effect :) (which does precisely the same by the way :) )

The same for NIF, so, since dying does not exist like that for the code, it ignores the NIF part and so it will just look at the rest and behave as the original effect :)

Asgurgolas
December 7th, 2020, 15:22
Now I feel more of an idiot than I usually am >.>

Kelrugem
December 7th, 2020, 16:33
Now I feel more of an idiot than I usually am >.>

No worries, happens :D

Kelrugem
December 10th, 2020, 00:32
Oki, I think I have found the problem (I think): My wound overlays are checking whether someone has the effect stable when someone is at HP -1 and -9, these overlays are set when the status of a token is set. The conditions like healthy trigger of course also the code which checks the status... So, with my extension, having effects like IF: bloodied; results into a loop where the effect stable is checked on the entry, resulting into that the effect list is checked for stable such that it wants to check again the healthy part, which checks for stable... loop, hence the stack overflow... :D

Wow, that was a strange problem, took me some while to figure it out :D So, I tell the code not to check the stable effect when it is because of such IF effects