I was playtesting my newest game today and got some weird behaviors. Specifically, I have a script that, given certain conditions, reduces some hero stats (all currentstat). This, however, is reversed at the inn by a script that resets all currentstats to the maximumstat values (which works, since the max are never changed).
Well, when playtesting today, I suddenly realized that one member of my party had drastically reduced stats ((this script is the only thing that affects stats that way)), and they would not reverse even with the stat resetter script. This is very unusual to me, because:
a.) all of the other characters had also been influenced by the stat-reduction script at some point, and were all fine
b.) there is nothing in my scripts that reduces maxstat, I did a search for the phrase and it only turns up in the context of "getherostat"
After I noticed this, I spent about three hours trying every possible combination of things I could do to figure out why it had happened. I tried dropping the stats and saving and quitting before running the resetter; tried dropping the stats and leveling up to see if it was throwing off the curve somehow; tried dropping the stats and dying in battle; tried dropping the stats and ending a battle with the hero JUMPED off the screen; tried dropping the stats, dying, then running the stat resetter before raising; tried dropping the stats, dying, then running the stat resetter AFTER raising; and a ton of other permutations I'm forgetting right now. I even tried it with other copies of the same hero. In all of these cases, the stat resetter worked normally, and I could not reproduce any behavior wherein the stats would be permanently reduced.
Based on a showvalue debug that returns the character's maxstat values, it seems plain that what has happened is that the maxstats were altered somehow; and yet, nothing in my scripts touches these.
So, my question is, is there any action performed by the engine's inherent coding (leveling up, dying, reviving, resting at an inn, shopping, using doors, ANYTHING) that would cause a hero's max stats to be set to their currentstat values?
If not, does anyone have any insights into what might be causing this?
OH! Dunno if this is significant, because I can't remember if the stat-reducer script was active at the time it happened, but I did get a weird error report (despite having the game set to "show no warnings" due to impending release) (no idea what caused it), that said:
"Script data may be corrupt or unsupported: failed to load indirect script 32756 showstringat, interpreter overloaded".
Notably, that crashed game.exe, but when I reloaded my save and did the same action as previous, it was fine, with no crash. Just mentioning this in case it could be relevant to the maxstat issue somehow.
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
It's worth noting that these scripts were finished two months ago and have been tested constantly since, and today is the first time I noticed this happening. I know this is a dumb question in the context of computers, but is it possible it was somehow just a one-time "fluke" of some sort?
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
I am not aware of anything that would do this...
but my first guess would be to ask if it could be equipment related. For example, a situation of modifying the stats with a script, then changing equipment, and then resetting the stats with a script again.
If that it it, it is still definitely a bug, but maybe that gives you a direction to search for steps to reproduce the bug.
As for the script overload and the crash, that is pretty odd. If that happened at the same time as the stat bug I would say they could be related, but I can't guess any connection otherwise.
but my first guess would be to ask if it could be equipment related. For example, a situation of modifying the stats with a script, then changing equipment, and then resetting the stats with a script again.
If that it it, it is still definitely a bug, but maybe that gives you a direction to search for steps to reproduce the bug.
As for the script overload and the crash, that is pretty odd. If that happened at the same time as the stat bug I would say they could be related, but I can't guess any connection otherwise.
We had a brainstorming session in IRC and solved this: it was due to the behaviour when an attack (eg. healing item) is used out of battle, which is that way to enable permanent stat boosters. I added new general bitset as a workaround.



