-
July 28th, 2020, 23:17 #1
Bug related to today's hotfix about custom DC
Hi
I just wanted to update my extensions for the hotfix of today Thanks for the fix about custom DCs, but I see still some problem, the following code
Code:local nDC = getActionSaveDC(nodeAction); if nDC ~= nCustomDC then DB.setValue(nodeAction, "savedctype", "string", "fixed"); DB.setValue(nodeAction, "savedcmod", "number", nCustomDC - nDC); end
Code:DB.setValue(nodeAction, "savedctype", "string", "fixed"); DB.setValue(nodeAction, "savedcmod", "number", nCustomDC);
But when it is now defined as fix one does not need to subtract nDC
Though I understand the idea of the previous code. Because DC numbers in brackets of spell entries of NPCs are just meant as a result of the value, they are still dynamic with the ability. The previous code allows this dynamic, but not the new one; I just tested with the old code and it is dynamic and behaves as expected (in a positive way) (for both, PC and NPC)
Hence, I am not sure what exactly happened with the reported module, the reported things here, https://www.fantasygrounds.com/forum...l=1#post529128, looks like as if nDC got not subtracted in that module (as if it was 0?), when I understand it correctly. I hope I didn't provide a red hering related to this bug (sorry if so; when I wrote my suggestion related to this problem, then I didn't look at the code again, was just a spantaneous idea)
Therefore I am still more on the side of the first code, and I have no idea what went wrong in the reported module. May be related to how it got created?
Sorry for the stress-testing Now I took a closer look (but also a very edge case I think)
Best,
KelrugemLast edited by Kelrugem; July 28th, 2020 at 23:24.
My extensions for 3.5e and Pathfinder
Bug reports please here
-
July 28th, 2020, 23:20 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Thanks for the catch on that one. Fixed.
JPG
-
July 28th, 2020, 23:24 #3
I think I may know what happend:
1. The spells got added to the NPCs before its abilities got adjusted. The way how the code is coded would then result to nDC= 0 in that moment. Thus, the full custom DC is added to the mod.
2. The problem: The custom DC in such spell entries are calculated with the correct ability value of the NPC entry
3. When then the ability gets entered, then the advantage of having the mentioned dynamic results into that the full ability mod is accounted into the DC, again
Hence, when one wants to have the advantage of the dynamics of the old code, then it is necessary that the abilities of the NPCs are entered before the spells get added (by a parser for example; manual drag&drop of spells is normally without the custom DC, from some library). Difficult for me now to decide what is the better design. The new code is of course less error-prone for module developers, while the old one allows dynamic (imagine the NPC buffs their ability and then the DCs have to increase, and so on.)Last edited by Kelrugem; July 28th, 2020 at 23:27.
My extensions for 3.5e and Pathfinder
Bug reports please here
-
July 28th, 2020, 23:25 #4My extensions for 3.5e and Pathfinder
Bug reports please here
-
July 28th, 2020, 23:27 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Yeah, it was originally built, such that it assumed that it could calculate the DC. (i.e. existing NPC and spell list) However, if the tag existed on a new import, the DC wasn't calculated yet and returned 0 initially, and then updated correctly after that. This caused the DC to essentially be doubled (or close to it).
Regards,
JPG
-
July 28th, 2020, 23:31 #6My extensions for 3.5e and Pathfinder
Bug reports please here
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks