Thread: Problems / Bugs with BRP?
-
March 18th, 2021, 07:19 #51
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 374
Thanks for the answer. I'll wait for an update.
/Peter
-
April 11th, 2021, 12:45 #52
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 374
Error indexing 'catname' in the function recalc() in record_char_skills.xml
- I'm running a new BRP campaign with no extensions.
- I'm running on FGU.
- I did an update just before running the test.
- [4/5/2021 2:29:55 PM] FGU: v4.0.10 ULTIMATE (2021-02-04)
- [4/5/2021 2:29:55 PM] OS: Windows 10 (10.0.0) 64bit
- [4/5/2021 2:30:45 PM] RULESET: Basic Roleplaying: the Chaosium Roleplaying System (v2021-03-09)
- [4/5/2021 2:30:45 PM] RULESET: Core RPG ruleset (v2021-04-06) for Fantasy Grounds
In order to replicate this test the "Use Skill Category Bonuses" House Rule needs to be set to "on" in the Prefs window.
When I change the value of a characteristic, I get the following warnings and errors:
Code:[4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [WARNING] setValue: Recursive call terminated for (CONTROL_NUMBER) (bonus) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value) [4/11/2021 1:17:27 PM] [ERROR] Handler error: [string "charsheet_skillcategory"]:28: attempt to index global 'catname' (a nil value)
I have also tested to do the same on FGC with the latest version of the ruleset(s) and there where no errors and the category bonuses where calculated correctly. I also did a test with a pre-coreRPG version of the Basic Roleplaying ruleset (in FGC) and there where no errors and the calculations where correct.
As far as I can see the code (in the function recalc) is the same in the post-coreRPG and the pre-coreRPG versions of the ruleset. I've tried to come up with a fix but so far I have failed, so any help is appreciated.
-
April 11th, 2021, 23:42 #53Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
April 22nd, 2021, 10:57 #54
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 374
Hi,
I've had some success going forward with the "catname" problem. The problem is the recalc() function, which is called from three places in the windowclass "charsheet_skillcategory". If I move the recalc functions code to the two controls that calls it and modify it a bit, then that code works, the category bonuses are correctly calculated.
For the "catname" label:
Code:function onValueChanged if super and super.onValueChanged then super.onValueChanged() end local name = getValue() Debug.console("category", name) local value = window.windowlist.getBonus(name) Debug.console("bonus", value) window.bonus.setValue(value) end
Code:function onValueChanged if super and super.onValueChanged then super.onValueChanged() end local name = window.catname.getValue() Debug.console("category2", name) local value = window.windowlist.getBonus(name) Debug.console("bonus2", value) bonus.setValue(value) end
So, so far so good, but the function recalc() is also called by the update() function which in turn is called by the onInit() function the first time you click on the skill tab. The update function can access the bonus control and make it visible, so it has access to the "bonus" control. If I edit the update() function, like below, and reload the ruleset and click on the Skill tab, then the debug statement "Debug.console("category4", name)" displays "s'category4' | s''". That is, it cannot access (or find) "catname", but it can access "bonus". The later is easy to verify because category names and bonus values are visible. The controls "bonus" and "catname" sould be in the same scope, right? So why can't I access "catname"?
Code:function update() print("update()") local sOptionHRSCB = OptionsManager.getOption("HRSCB") if sOptionHRSCB == "on" then local node = windowlist.window.getDatabaseNode().createChild("abilities") node.onChildUpdate = recalc bonus.setVisible(true) bonuslabel.setVisible(true) local name = catname.getValue() Debug.console("category4", name) local value = windowlist.getBonus(name) Debug.console("bonus4", value) bonus.setValue(value) else bonus.setVisible(false) bonuslabel.setVisible(false) end end
The recalc() function is also accessed when a characteristic on the Main tab is changed (the line node.onChildUpdate = recalc in the update() function). When you access recalc() this way it throws an "attempt to index global" error. And it doesn't seem to mather what statement you put first in the function.
When I change the recalc() functions code and inserts a few debug statements and a print statement, like this:
Code:function recalc() print("recalc()") local name = catname.getValue(); Debug.console("category3", name) local value = windowlist.getBonus(name); Debug.console("bonus3", value) bonus.setValue(value); end
**************
Finally, It's worth noting that the code seems to work fine in FGC, from what I can tell.
/Peter
-
April 22nd, 2021, 12:04 #55
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 374
If you want to recreate this behavior you can use the extension below. It loads the record_char_skills.xml that I've been modifying. Don't forget to turn on "Use Skill Categories" in the preferences.
-
April 22nd, 2021, 12:19 #56
-
April 22nd, 2021, 12:36 #57
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 374
-
April 22nd, 2021, 12:48 #58
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 374
I found this post when searching for info on "attempt to call global". It seems to suggest that the value of a genericcontrol cannot be accessed by getValue(). But I'm able to do so in
"catname" genericcontrol:
Code:function onValueChanged if super and super.onValueChanged then super.onValueChanged() end local name = getValue() Debug.console("category", name) local value = window.windowlist.getBonus(name) Debug.console("bonus", value) window.bonus.setValue(value) end
-
April 22nd, 2021, 15:53 #59
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
The "genericcontrol" object type does not support the getValue function; as the genericcontrol object does not support a database value nor is able to link to a database node.
The "catname" control may be a template which resolves to a stringcontrol/stringfield, which is why it works there.
Regards,
JPG
-
April 22nd, 2021, 17:10 #60Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks