Thread: Problems / Bugs with BRP?
-
March 29th, 2024, 18:58 #271
Yes, this would be best as an extension.
Dominic 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 1st, 2024, 18:00 #272Patriarch
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 418
Strike rank code is not working
While testing my own strike rank handling code I noticed that the existing code doesn't really work as expected.
The SR value is never updated. That's probably becausein onUptionUpdate() in ct/scripts/ct_entry.lua returns nil.Code:local nodeActor = link.getTargetDatabaseNode();
This code in getStrikeRank() in scripts/manager_gameline.lua
returns values even if the node is nil.Code:local DEX = DB.getValue(node, "abilities.dexterity", 11); local SIZ = DB.getValue(node, "abilities.size", 11);
-
April 1st, 2024, 18:01 #273Patriarch
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 418
Following up on the previous post.
You can verify the problem by:
a) create a new campaign
b) turn on the strike ranks option
c) reload the ruleset
d) create character
e) Drag it to the CT. The SR will be 5.
f) Change the characters SIZ and DEX to 21. This should set the SR to 1. But it doesn't, it remains at 5.
g) Change SIZ and DEX to 3. This should set the SR to 7. But it doesn't, it remains at 5.
-
April 1st, 2024, 18:02 #274Patriarch
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 418
Further investigation.
DebuggingwithCode:local nodeActor = link.getTargetDatabaseNode();
I getCode:Debug.console("Node Actor 1", nodeActor)which I'm pretty sure is not what's needed. I know that the code is old so this maybe is some code that needs to be refactored?s'Node Actor 1' | databasenode = { combattracker.list.id-00001 }
-
April 1st, 2024, 19:54 #275Patriarch
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 418
Digging into this a bit more.
In ct/scripts/ct_entry.lua the following code, from onOPtionsUpdate()
results in a different database node then this code from linkPCFields()Code:function onOptionUpdate() ... local nodeChar = link.getTargetDatabaseNode();
The code in linkPCFields returns the characters db node (which is what you want), while onOptionUpdate don't. Since onOptionUpdate calls getStrikeRank with no db node the SR update fails.Code:function linkPCFields() super.linkPCFields(); local nodeChar = link.getTargetDatabaseNode();
-
April 1st, 2024, 20:18 #276
I can get it to factor the Siz and Dex mods, but it won't factor weapon or power mods into the Strike Rank. That would require more factoring to have the players/GM to pick their action and add them to the box. Which as you can see is a bit of an undertaking.
Dominic 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 1st, 2024, 20:46 #277Patriarch
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 418
Yes, I understand that. But, as I explained in my posts above, the existing code doesn't work. The SR is never updated because the getStrikerank funktion gets a nil value instead of a character node.
Just to avoid any misunderstandings, I'm not asking you to factor weapons or power into strike ranks, I'm going to fix that part myself. I'm just letting you know that there's a problem with the existing code, and (incidentally) that create problems down the line for my code.Last edited by peterb; April 1st, 2024 at 22:06.
-
April 1st, 2024, 22:44 #278
Yes, I understand your request. I just wanted to be sure there was no misunderstanding with power and weapon mods to the strike rank.
Dominic 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 2nd, 2024, 13:20 #279Patriarch
- Join Date
- Mar 2009
- Location
- Lidingö, Sweden, Europe
- Posts
- 418
Well, I got it working.
In ct/scripts/ct_entry.lua I modified onOptionUpdate() so that the DB.setValue used the database node of the CT windowlist.
I also modified linkPCFields() and added a link to a aggregated SR value that is re-calculated when the underlying data is changed.Code:function onOptionUpdate() local sOptHRSR = OptionsManager.getOption("HRSR"); strikerank.setVisible(sOptHRSR == "on"); local nodeChar = link.getTargetDatabaseNode(); local ctNode = getDatabaseNode(); local nStrikeRank = LineManager.getLine().GetStrikeRank(nodeChar); DB.setValue(ctNode, "strikerank", "number", nStrikeRank); end
As an added bonus the ordering of entries worked out by itself since high DEX = low SR.Code:function linkPCFields() super.linkPCFields(); local nodeChar = link.getTargetDatabaseNode(); if nodeChar then pp.setLink(DB.createChild(nodeChar, "pp.current", "number"), true); wounds.setLink(DB.createChild(nodeChar, "wounds", "number")); hp.setLink(DB.createChild(nodeChar, "hp.max", "number"), true); initresult.setLink(DB.createChild(nodeChar, "abilities.dexterity", "number"), true); strikerank.setLink(DB.createChild(nodeChar, "sr.activeSR", "string"), true); end end
Last edited by peterb; April 2nd, 2024 at 13:26.
-
April 2nd, 2024, 16:38 #280
I pushed a hotfix for the strike rank issue. I would look over the code for my implementation as it is somewhat different than the approach you have made.
Dominic 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)

Reply With Quote


Bookmarks