Thread: 5E - Capital Gains
-
November 26th, 2021, 11:42 #21
On the difference between your use of a local global to pass custom values and adding parameters..
In a normal product it would be a poor design ( you would change the full source code. ), but in this case of extension API it is probably better than passing extra variables to replaced ruleset functions. Because rulesets and other extensions are not written to cope with the extra parameters.
It would be different if the ruleset used the '...' by default, ie 'function parseEffectComp(s,...)' and always passed the '...' to sub function calls to default that all functions by design should consider the possibility of extra parameters and the need to pass those about.
BUT since the ruleset does not use the '...' by default, I do think your global version with increased compatibility is the better design than passing parameters.
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
-
November 26th, 2021, 12:03 #22
My suggestions are just suggestions. As you say you have reasons for how they are encoded, and I gave suggestions and reason for mine. Your users can make suggestions and maybe you will implement or not.
On the dice encoding after the [] section, dice.PNG are the 5e ruleset responses to the different types. By default neither of the '[] d6' or '[]d6' evaluate to a valid 'DMG: line'
Which is why I suggested and implemented in my extension the value been inside the '[]' section. To the ruleset this still parses with the default code.
ie, [2CHA6] would parse into '2 *' the lookup for 'CHA6' which would then fail to lookup due to the 'elseif sTag == "CHA" then' which would not map it and so would be correctly skipped due to the ruleset 'nil' check.
I dont know in what 'cases' these 'sometimes' work?
But as you say, how you want to encode the token structure is upto you on this. I can only make suggestions.
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
-
November 26th, 2021, 12:10 #23
You have to write: DMG: d6 [2CHA] First the dice, then tags, the space after d6 will be interpreted as an addition. If you want to add damage types, then DMG: d6 [2CHA], slashing and so on
Or are you speaking about using 2CHA as the number of d6 you want to use? (here: the 2*CHA mod will be added as a modifier to 1d6)Last edited by Kelrugem; November 26th, 2021 at 12:12.
My extensions for 3.5e and Pathfinder
Bug reports please here
-
November 27th, 2021, 19:55 #24
Yes I'm only talking about the 2CHA becoming a number of dice of a dice type not a basic addition of value. Which is used by the CG extension to generate flexible dice amounts, see image in link
As I said by default 5e ruleset does not support this and we were talking about the merits or not of encoding this as either '[2CHA]d6' as per CG or as my extensions do as '[2CHA6]'.
My feeling was that the '[]' should be self contained as the 5e ruleset would see [2CHA6] as looking for 2x 'CHA6' which would fail but would still process the rest of the DMG type line. While '[2CHA]d6' breaks the parse process and stops. Both are going to cause failures to evaluate but in different ways. My point was that its very simple to have a 'space' that is hard to spot so '[2CHA] d6' and '[2CHA]d6' causing different results. While [2CHA6] is very specific if more 'cryptic' because you are not listing a 'd<n>' descriptor.
It comes back to a lot of the match type codes do searches for the likes of 'ends with ']'' which an encoding of '[2CHA]d6' breaks as now it end with ']d6' when tokens get split by ' ' separators. If you split by ' []' list of tokens to split with then the processing code is different because you are looking at start token '[' a number of tokens and then end token ']'. which is very different code to match("[(^])") { I'm sure I've got that wrong from off the top of my head, for starts with '[' and give me everything upto the end of ']' } type lua match searches used around the code and effect parses.
But how the encode works and is adjusted is up to CG, I was only making a suggestion to keep everything in the '[]' as this feel more in the spirit of the '[]' generation to 'something' exchange process of the effect line.
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
-
November 27th, 2021, 20:11 #25
Just a my .02. If you go with [2CHA]d6 instead of [2CHA6] then you can leverage EffectManager5E.evalEffect to eval the brackets for you
-
November 27th, 2021, 21:45 #26
As shown in #22 see image Dice.png the '[2CHA]d6' does not evaluate in the default 5e ruleset.
I'm not sure if the ruleset has an option to enable this parse process or if its an extension in use that allows this change ?
But my testing show, and seen in the image attached above, that the default ruleset does not process that construct. Which is why my extension added support for '[2CHA6]'.
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
-
November 28th, 2021, 14:42 #27
I've updated advanced spell damage and seems to be evaluating the CG effect lines and clears up the initial script error when character is open.
It does require CG to load after ASD, so I'd request a change to <loadorder>120</loadorder>
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
-
November 29th, 2021, 14:58 #28
Just released version 1.0.3 which increases load order and fixes a bug with periodic resource loss.
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
November 29th, 2021, 17:28 #29
- Join Date
- Jan 2020
- Posts
- 280
Thanks for your rapid attention on this, MeAndUnique! Happy to report I have updated and all is well now
-
November 30th, 2021, 15:10 #30
Thanks, I've been planning a 'survival' type adventure campaign and this extension will be very useful. I have a couple of requests, I'm not a coder so I don't know how practical these requests are so take them with a grain of salt.
Can you make the Resource section operate as a "drop down menu" like other sections do where you can minimize the space taken up on the Actions tab?
Can you have the Resource usage also reduce the Inventory count of things like Rations and Waterskins?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks