-
April 23rd, 2024, 04:46 #1
Error in extension call to [string "5E:scripts/manager_actor_5E.lua"]:204
Recently since last major release I've been having my players get this error
[ERROR] Handler error: [string "5E:scripts/manager_actor_5E.lua"]:204: attempt to index local 'sAbility' (a number value)
on a polymorphism extension call. Only after several hours of playing and if we exit game and come up it does not happen again.
Nowhere in the poly code does it call ActorManager5E.getAbilityBonus with a number.
It only calls it in 3 places:
Code:rRoll.nTarget = 8 + ActorManager5E.getAbilityBonus(rSource, aPowerGroup.sSaveDCStat) + ActorManager5E.getAbilityBonus(rSource, "prf") + aPowerGroup.nSaveDCMod;
Code:for k, v in pairs(DataCommon.skilldata) do local sBestLabel = ""; local nBestMod = 0; local nNPCBestMod = 0; local nBonus = ActorManager5E.getAbilityBonus(rnodeNewCTEntryActor, v.stat);
Code:for k, v in pairs(DataCommon.ability_ltos) do local nBonus = ActorManager5E.getAbilityBonus(rnodeNewCTEntryActor, k);
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
April 23rd, 2024, 07:16 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,598
If you do a global search for ActorManager5E.getAbilityBonus, you'll see that none of the built-in ruleset calls use numbers either.
Also, I haven't heard of this issue reported in standard 5E ruleset usage without extensions.
Regards,
JPG
-
April 23rd, 2024, 13:58 #3
-
April 23rd, 2024, 16:04 #4Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
April 23rd, 2024, 16:53 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,598
In the 5E code, it's only set in these lines of code (top two for aPowerGroup.sSaveDCState, bottom two for aPowerGroup.sStat). The default calls would not be setting to non-string type. Not sure where array reference idea came from...
aPowerGroup.sSaveDCStat = DB.getValue(nodePowerGroup, "savestat", "");
...
aPowerGroup.sSaveDCStat = aPowerGroup.sStat;
...
aPowerGroup.sStat = DB.getValue(nodePowerGroup, "stat", "");
...
aPowerGroup.sStat = sDesc:match("spellcasting ability is (%w+)") or "";
...
Regards,
JPG
-
April 23rd, 2024, 17:03 #6
Array comment was based on name prefix of a - and of course the crazy dual purpose of getPowerGroupRecord being able to return a aPowerGroup.data or aPowerGroup["level"] depending if nodePower argument is nil or not. Granted the latter is not going to be triggered in my calls but still - doing a dual purpose like this can cause confusion.
Right now not sure why the same code works but at some point can get "corrupted" by something - and I do use extensions. I just can't seem to duplicate the error (only seen since last major update) unless in a live game in this campaign for more than an hour and this PC tries to wild shape with polymorphism. Never seen again if we restart app for that session. Until I can duplicate it I'm just trying to guess by looking at the code. I'm not even sure its my code triggering the error.Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
April 23rd, 2024, 17:07 #7
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,598
I'm not sure what you are saying.
* getPowerGroupRecord always returns a Lua table or Lua nil value. (aPowerGroup.data == aPowerGroup["data"]; and aPowerGroup.level == aPowerGroup["level"])
* Having functions return a nil value when data can't be found is very common in the code base.
Regards,
JPG
-
April 23rd, 2024, 17:12 #8
Sorry I should have put aPowerGroup[nLevel] = aSpells; - which is an array for a level being returned. You'd have to actually look at the PowerManager.getPowerGroupRecord code to see it. What I'm saying is true - I'm just stating it wrong (when I go by memory its unreliable)- its using that array as dual purpose. Unless I've completely lost it looking at code here.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
April 23rd, 2024, 17:22 #9
My current theory is that something is calling PowerManager.getPowerGroupRecord (I do but not with nil arg) with the second arg nil then trying to use the result someplace with getAbilityBonus given the assumed non array result which turns into a number instead of string when referencing data since its an unexpected array coming back. But really I have no idea.
I'll have to wait till i can figure out how to duplicate it - which only seems to be when in a session doing lots of stuff for a while before triggering the polymorphism.Last edited by SilentRuin; April 23rd, 2024 at 17:25.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
April 23rd, 2024, 20:25 #10
My solution for now is to guard all my calls mentioned on first page with
type(whatever) == "string"
Before I allow it to process. And if its not a string I'm going to do a printstack() to see what is causing this. If its my call even triggering the error call.Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks