PDA

View Full Version : 2022-07-26 Small Update



Moon Wizard
July 23rd, 2022, 18:50
I have a smaller update that will be released on Tuesday that may impact some more low-level mods. These changes are localized to each function, and do not change parameter lists.

Release Notes

[CoreRPG+] Script errors on certain targeted rolls when using manual dice roll option. Fixed.
[5E] Script error could occur when certain unowned character data related to encumbrance calculations shared with players. Fixed.
[5E] Recovery rolls always displayed zero in resolution messages. Fixed.
[5E] Heal and recovery rolls always displayed damage icon in resolution messages. Fixed.
[5E] Class spell lists no longer export unless Class Spell List Definition records export selected. Used to export when spells selected as well.


Developer Notes - Changes

[CoreRPG] ActionsManager.actionDrop, ActionsManager.actionDirect, ActionsManager.getTargeting
[5E] ActionDamage.handleApplyDamage, ActionDamage.notifyApplyDamage, ActionDamage.applyDamage, ActionHeal.onHeal, ActionRecovery.onRecovery, campaign/scripts/npc_main.lua, scripts/manager_char_encumbrance_5E.lua


Regards,
JPG

Moon Wizard
July 23rd, 2022, 18:57
The changes are available in the Test channel now.

JPG

Moon Wizard
July 25th, 2022, 17:44
Updates

[5E] Class spell lists no longer export unless Class Spell List Definition records export selected. Used to export when spells selected as well.

SilentRuin
July 25th, 2022, 18:35
Updates

[5E] Class spell lists no longer export unless Class Spell List Definition records export selected. Used to export when spells selected as well.


Any hint on why my generic actions/polymorphism extension buttons no longer trigger anything? These are rolls I made myself - which seem to no longer work at all - no error - nothing. I looked at code diffs and nothing leapt out at me that would cause this.

Moon Wizard
July 25th, 2022, 18:40
I have no idea. The changes in this update are very localized. I would use Debug statements to make sure that the rolls are being set up correctly, and captured correctly.

Regards,
JPG

SilentRuin
July 25th, 2022, 18:47
I have no idea. The changes in this update are very localized. I would use Debug statements to make sure that the rolls are being set up correctly, and captured correctly.

Regards,
JPG

Did you make some rRoll new thing that is required outside of your rolls?

Moon Wizard
July 25th, 2022, 18:51
No, I explicitly listed the functions affected. You can review the changes, if you like.

Regards,
JPG

SilentRuin
July 25th, 2022, 18:52
No, I explicitly listed the functions affected. You can review the changes, if you like.

Regards,
JPG

I do code line by line comparisons from the previous 5e/corerpg - Ok going to check debug statements to see what has busted. Appears anywhere I generate my own roll at first glance.

SilentRuin
July 25th, 2022, 19:29
Usually I can find out at least why something is broken. I cannot here. Below I give two logs - first with TEST where it fails to trigger the results handler and then in LIVE where it triggers the results handler. Same exact code running in both.

TEST doing generic actions grapple button:

This is init to setup my result handlers and roll:
GameSystem.actions["genactroll"] = { sTargeting = "each" };
table.insert(GameSystem.targetactions, "genactroll"); -- Thank you to trenloe on FG forums for this - made sTargeting work

-- The generic actions initial dice roll for the source
ActionsManager.registerResultHandler("genactroll", onGenericActionRoll);
-- The generic actions that are source vs target type of dice rolls need a second die roll for the target that must occur on the host.
-- Host is only sure way to access the charsheet and skilllist (athletics/acrobatics) of a non owned character sheet.
ActionsManager.registerResultHandler("genactresult", onGenericActionResultRoll);

Kicks off first roll:
[7/25/2022 1:05:46 PM] s'manager_generic_actions:performGenericActionRoll ; called'

This is the rRoll it sends to perform first roll "genactroll":
[7/25/2022 1:05:46 PM] { s'aDice' = { #1 = s'd20' }, s'sSourceCheck' = s'Athletics', s'sGenericAction' = s'Grapple', s'bSecret' = bFALSE, s'nMod' = #6, s'sDesc' = s'', s'sType' = s'genactroll', s'sCharsheet' = s'charsheet.id-00003', s'sSourceActorCT' = s'combattracker.list.id-00016', s'iGenericAction' = #0 }

This is the OOB message used to trigger the next roll:
[7/25/2022 1:05:49 PM] s'manager_generic_actions:handleApplyHostGenericAc tion; msgOOB = applyhga'

This is the rRoll it sends to perform the second roll "genactresult":
[7/25/2022 1:05:49 PM] { s'aDice' = { #1 = s'd20' }, s'sSourceCheck' = s'Athletics', s'nMod' = #3, s'sDesc' = s'', s'sGenericAction' = s'Grapple', s'bSecret' = bFALSE, s'iSourceDieResult' = #17, s'sTargetCheck' = s'Strength', s'sSourceName' = s'Ravina', s'sCTTargetNode' = s'combattracker.list.id-00018', s'sType' = s'genactresult', s'sCharsheet' = s'charsheet.id-00003', s'sSourceActorCT' = s'combattracker.list.id-00016', s'iGenericAction' = #0 }

This is where it fails to trigger the results handler for "genactresult"...

LIVE doing generic actions grapple button (same init):

Kicks off first roll:
[7/25/2022 1:09:36 PM] s'manager_generic_actions:performGenericActionRoll ; called'

This is the rRoll it sends to perform first roll "genactroll":
[7/25/2022 1:09:36 PM] { s'aDice' = { #1 = s'd20' }, s'sSourceCheck' = s'Athletics', s'sGenericAction' = s'Grapple', s'bSecret' = bFALSE, s'nMod' = #6, s'sDesc' = s'', s'sType' = s'genactroll', s'sCharsheet' = s'charsheet.id-00003', s'sSourceActorCT' = s'combattracker.list.id-00005', s'iGenericAction' = #0 }

This is the OOB message used to trigger the next roll:
[7/25/2022 1:09:38 PM] s'manager_generic_actions:handleApplyHostGenericAc tion; msgOOB = applyhga'

This is the rRoll it sends to perform the second roll "genactresult":
[7/25/2022 1:09:39 PM] { s'aDice' = { #1 = s'd20' }, s'sSourceCheck' = s'Athletics', s'nMod' = #3, s'sDesc' = s'', s'sGenericAction' = s'Grapple', s'bSecret' = bFALSE, s'iSourceDieResult' = #17, s'sTargetCheck' = s'Strength', s'sSourceName' = s'Ravina', s'sCTTargetNode' = s'combattracker.list.id-00018', s'sType' = s'genactresult', s'sCharsheet' = s'charsheet.id-00003', s'sSourceActorCT' = s'combattracker.list.id-00005', s'iGenericAction' = #0 }

This is where it actually triggers the "genactresult" results handler and works:
[7/25/2022 1:09:41 PM] { s'aDice' = { #1 = { s'value' = #4, s'type' = s'd20', s'result' = #4 }, s'expr' = s'd20', s'total' = #4 }, s'sGenericAction' = s'Grapple', s'sSourceCheck' = s'Athletics', s'bSecret' = bFALSE, s'iSourceDieResult' = s'17', s'sSourceActorCT' = s'combattracker.list.id-00005', s'sDesc' = s'', s'sSourceName' = s'Ravina', s'sTargetCheck' = s'Strength', s'nMod' = #3, s'sCTTargetNode' = s'combattracker.list.id-00018', s'iGenericAction' = s'0', s'sType' = s'genactresult', s'sCharsheet' = s'charsheet.id-00003', s'nTotal' = #4 }
[7/25/2022 1:09:41 PM] s'manager_generic_actions:onGenericActionResultRol l; rSource table: 0000022FFB0D42D0'
[7/25/2022 1:09:41 PM] s'manager_generic_actions:onGenericActionResultRol l; rTarget nil'


I have absolutely no idea what you have changed to have the first results handler trigger and the second one fail in TEST. But something has changed. I just need to know what.

This also happen in polymorphism where I build my own roll/results.

SilentRuin
July 25th, 2022, 19:58
I strongly suspect the targeting changes - as I have no control or access to any of this outside of my call to ActionsManager.performAction(draginfo, rTargetActorCT, rRoll); for each of my rolls - I suspect the logic you changed has somehow broken it. But as I don't understand why it was changed I have no idea how it was broken. I assume this as the only way I can see this doing "nothing" for that performAction is if the getTargeting no longer returns what it once did.

In CoreRPG\scripts\manager_actions.lua:

You changed the return for getTargeting from LIVE:

if not aTargeting then
aTargeting = {};
end
if #aTargeting == 0 then
table.insert(aTargeting, {});
end

return aTargeting;


To TEST:


return aTargeting or {};


I'm guessing this is what is somehow killing me. But am not sure. Its the only thing relative to performAction for dice rolls that I can see was changed that might impact it.

SilentRuin
July 25th, 2022, 20:19
Verified in a an odd way that this is the issue somehow. I have 4 extensions that use ActionsManager.performAction(draginfo, rActor, rRoll); to do their own die rolls - everyone of them is busted except the one I had to do my own version of performAction(draginfo, rActor, rRoll, aTargets) in order to do some internal changes. That one still works.

Not sure what is breaking it - but I'm not sure its within my control to fix. It goes into ActionsManager.performAction and then into your internal changes and never triggers anything. I assume because of something with the targeting changes.

Moon Wizard
July 25th, 2022, 20:46
Can you provide a sample campaign with a single extension (and a copy of the extension) where I can get the issue to trigger?

Regards,
JPG

Moon Wizard
July 25th, 2022, 20:47
The difference in the targeting is literally that rTarget should be nil if nothing targeted; instead of an empty table. The empty table was causing issues with manual rolling.

SilentRuin
July 25th, 2022, 21:41
Can you provide a sample campaign with a single extension (and a copy of the extension) where I can get the issue to trigger?

Regards,
JPG

I loaded the campaign, extension, screenshots, and simple directions on how to duplicate it in LIVE(works)/TEST(fails). All under your discord name.

Moon Wizard
July 26th, 2022, 00:45
Just pushed an update that should address this issue.

Regards,
JPG

SilentRuin
July 26th, 2022, 00:56
Just pushed an update that should address this issue.

Regards,
JPG

Validated that it fixed all 3 of my extensions that used performAction on a die roll. Thanks!

Moon Wizard
July 26th, 2022, 21:50
These updates are Live now.

JPG

SilentRuin
July 28th, 2022, 16:54
I had an issue reported today on something I did not even know you could do. If you drag the chat bubble of a roll over the CT PC wounds it will add that into it. The bug with polymorphism active is that it will simply replace the number and error out. It mentions some deprecated code calls of things I do not call - where the ActionDamage.applyDamage (which has deprecated use of messageDamage) is telling me its deprecated as shown in log.

[7/28/2022 10:34:57 AM] s'ActionDamage.applyDamage - DEPRECATED - 2022-07-19 - Use ActionDamage.applyDamage(rSource, rTarget, rRoll)'
[7/28/2022 10:34:57 AM] s'ActionDamage.messageDamage - DEPRECATED - 2022-07-19 - Use ActionDamage.messageDamage(rSource, rTarget, rRoll)'
[7/28/2022 10:34:57 AM] [ERROR] Script execution error: [string "scripts/manager_action_damage.lua"]:1519: bad argument #2 to 'format' (string expected, got nil)


But since I did a code search across all rulesets and my extensions I don't see where I call it directly. However in FGU 5E ruleset code, I do see where it is still calling the old format that could trigger the above print statement.


5E\campaign\template_char.xml (1 hit)
Line 428: ActionDamage.applyDamage(nil, rActor, false, draginfo.getDescription(), draginfo.getNumberData());
5E\ct\ct_host.xml (1 hit)
Line 226: ActionDamage.applyDamage(nil, rActor, CombatManager.isCTHidden(node), draginfo.getDescription(), draginfo.getNumberData());
5E\scripts\manager_action_save.lua (1 hit)
Line 706: ActionDamage.applyDamage(nil, rSource, rRoll.bSecret, "[HEAL]", 1);


As I don't directly call it - and it appears when not using poly it works - I have to assume that somehow my overriden charsheet is triggering the template_char stuff where the normal sheet is not?

In any case - I'm not sure what is going on since I don't directly call this stuff but somehow its triggering stuff that claims its deprecated (template_char.xml?) which of course does not populate all the stuff that your new code uses and chokes on the bad argument.

Any ideas? I admit I'm at a loss at this indirect hit and the fact 5E ruleset has calls in it that are claimed to be deprecated.

Moon Wizard
July 28th, 2022, 17:49
The error would only trigger if the third parameter is not a table and the fourth parameter is nil; or if the third parameter is a table and .sDamageText is not defined in the table. That is most likely where the error is specific to your code.

For the deprecated calls, the vehicle update I'll be working on next week already has those fixed; and just forces to use the new format completely. That experiment of trying to support both didn't work out the way I had hoped.

Regards,
JPG

SilentRuin
July 28th, 2022, 18:16
The error would only trigger if the third parameter is not a table and the fourth parameter is nil; or if the third parameter is a table and .sDamageText is not defined in the table. That is most likely where the error is specific to your code.

For the deprecated calls, the vehicle update I'll be working on next week already has those fixed; and just forces to use the new format completely. That experiment of trying to support both didn't work out the way I had hoped.

Regards,
JPG

Yeah I knew what caused the error as I said - the deprecated calls. Which I don't directly call myself, hence can't really fix on my side if they are using the 5E ruleset ones. I assume those updates for the 5E ruleset deprecated calls will be fixed then in LIVE next Tuesday and wait to see if my problem is resolved (should as far as I can tell). I assume you mean prep work for vehicle support and not the actual vehicles themselves are coming out (as that will be something I hope to have a chance in test so I can support it in the relevant areas of my extensions).

Anyway, I'll wait till next update as this is something users can definitely work around - just don't drag chat bubble die rolls into charsheet.

SilentRuin
August 3rd, 2022, 23:36
With the added logic Moon Wizard gave me to compensate for the deprecated branch vs new calling branch in messageDamage the problem should be resolved on my end.