Rod's D&D 5e Framework

Framework(s) for D&D 5e.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

SDShannonS
Giant
Posts: 242
Joined: Tue Sep 12, 2006 12:21 am
Location: San Diego, CA, US

Re: Rod's D&D 5e Framework

Post by SDShannonS »

I've been working on the issue with the Athletics element of the character sheet. It appears to boil down to line 208 of Skills@Lib:Character which consists of:

Code: Select all

[h:Athletics=if(athete>0,ceil(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),athete)*ProficiencyBonus),floor(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),jack)*ProficiencyBonus)),floor(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),jack)*ProficiencyBonus)+getProperty("Strengthmod")+AthleticsMod]
That's a little hard to read all on one line but it looks to me like it's essentially three parts:

Code: Select all

if(athete>0,ceil(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),athete)*ProficiencyBonus)

Code: Select all

floor(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),jack)*ProficiencyBonus))

Code: Select all

floor(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),jack)*ProficiencyBonus)+getProperty("Strengthmod")+AthleticsMod]
The logic appears to be preventing it from ever reaching the third part where it adds StrengthMod into the calculation.

EDIT: I ended up adding the +getProperty("Strengthmod")+AthleticsMod element to the first two parts above and it seems to have resolved it, at least for a character with neither Remarkable Athlete nor Jack of All Trades. Tried testing Jack by adding bard levels but that appears to have broken something as I just keep getting "getMacroProps(): first argument must be a number" errors. Oh well. It'll do until someone more knowledgeable than I makes it right for good.
Last edited by SDShannonS on Thu Jan 16, 2020 4:23 pm, edited 1 time in total.
"You must be the change you wish to see in the world."
- Mahatma Gandhi

"You know what the chain of command is? It's the chain I go get and beat you with until you understand who's in ruttin' command here."
- Jayne

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Rod's D&D 5e Framework

Post by aliasmask »

This is what I get. Just counting parenthesis it's not a valid statement basically. Not sure what it is supposed to be either.

Code: Select all

[h: Athletics = if(athete>0,
   ceil(if(getProperty("AthleticsCheckMod")>0,
      getProperty("AthleticsCheckMod"),
      athete)
      *ProficiencyBonus),
   floor(if(getProperty("AthleticsCheckMod")>0,
      getProperty("AthleticsCheckMod"),
      jack)
      *ProficiencyBonus))
      
      
   ,floor(if(getProperty("AthleticsCheckMod")>0,getProperty("AthleticsCheckMod"),jack)*ProficiencyBonus)+getProperty("Strengthmod")+AthleticsMod]
I would start by pulling out parts and commenting what it represents. For example each if could be it's own variable.

Code: Select all

[H: athletics.mod = getProperty("AthleticsCheckMod")]
[H: highAthletics = ceil(if(athletics.mod > 0, athletics.mod, athete) * ProficiencyBonus)]
[H: lowAthletics = floor(if(athletics.mod > 0, athletics.mod, jack) * ProficiencyBonus)]
[H: Athletics = if(athete > 0, highAthletics, lowAthletics)]

SDShannonS
Giant
Posts: 242
Joined: Tue Sep 12, 2006 12:21 am
Location: San Diego, CA, US

Re: Rod's D&D 5e Framework

Post by SDShannonS »

Yeah, the whole section of Athletics appears to be an overly-convoluted if-then hodge-podge when it really doesn't need to be, especially given that a character could have both Remarkable Athlete AND Jack of All Trades so they should not been in an IF/ELSE relationship.

Proficiency is some value.
Athete (misspelled) is some value
Jack is some value.
StrengthMod is some value.

Athletics in all situations will always = Proficiency + Athete + Jack + StrengthMod
"You must be the change you wish to see in the world."
- Mahatma Gandhi

"You know what the chain of command is? It's the chain I go get and beat you with until you understand who's in ruttin' command here."
- Jayne

Reasonableman
Kobold
Posts: 5
Joined: Sat Aug 06, 2011 3:17 am

Re: Rod's D&D 5e Framework

Post by Reasonableman »

SDShannonS wrote:
Thu Jan 16, 2020 12:47 pm
Reasonableman, would you mind hosting somewhere the Lib: tokens that you have altered to correct some of these aforementioned bugs and giving us a link to download them? Seems a more efficient method of error correcting than having every reader attempt to reproduce your efforts.
It might, but it would also remove some amount of Rod's authorship, and I'm hesitant to do that without a go-ahead; and I'm doubly hesitant because I've modified these tokens in other ways that may make them incompatible with the base framework. I also keep finding bugs in my "fixes," so I also want to leave a changelog somewhere, and this seemed the most rational place.

On that note: modifying line 184 of Attacks@Lib:Character to

Code: Select all

[r,if(getProperty("SpellcastingAbility")==""),code:{[h:spellmod1=0]};{
will stop "Set value for spellmod1" spam when you have a custom, non-spell attack on your character sheet, but I'm not 100% sure it doesn't break something else, because I'm also trying to modify the "Create Attack" macro to allow you to define the ability mod it keys off.

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Rod's D&D 5e Framework

Post by aliasmask »

I usually put my changelog on the lib token and post the lib token on the forums discussing changes. Then it would be up to whoever to use or not use the lib token. When working with Lindsay, he would often update the original code then post the new version in the OP whenever he got around to it.

Reasonableman
Kobold
Posts: 5
Joined: Sat Aug 06, 2011 3:17 am

Re: Rod's D&D 5e Framework

Post by Reasonableman »

Something is busted with either the transfer macros, the "Create Equipment" macro, or possibly with createMacro().

If you "Create Equipment" on a token (ex, "Crowbar") and then transfer it to another token (ex, from an encounter pin or character), that works fine. If you "Create Equipment" on a token twice (ex, "Bow" and "Arrow") and then transfer both to another token, that works fine.

But, if you "Create Equipment" on a token, do the same to another token, then transfer either item from one token to the other, it overwrites the created equipment. Get "Bow" from one treasure chest, then "Arrow" from another, and suddenly "Bow" is gone.

Weirdly, this doesn't seem to affect equipment from the existing libraries. It's also not 100% consistent: sometimes, a particular piece of equipment will become immune to this overwrite, perhaps if it's transferred enough (needs more testing). It should be noted that the "(Item name) Quantity" property isn't being reduced to zero; if you "Create Equipment" with the same name on a token again, it will increase the quantity to 2; something is causing the macros to be overwritten.

EDIT: The functions that transfer item macros from token to token use createMacro() to make a copy in the destination token, but don't strip out the index from the properties list; this leads to overwrites. I'm reasonably certain that deleting that one property from the list will fix the issue, but it will require changing the CurrentMacroProps list to use ";" as a delimiter so we can call deleteStrProp() to kill that specific property easily. I need to do some testing to determine if changing it from "," causes any problems elsewhere.

rpt-steve
Kobold
Posts: 19
Joined: Thu Oct 03, 2019 10:42 am

Re: Rod's D&D 5e Framework

Post by rpt-steve »

anathemort wrote:
Sat Dec 07, 2019 7:06 pm
Thanks for the verification! Another setup question... I'm on the Bestiary map, trying to build a new NPC. I have added the token to the map (using TokenTool, just drag-dropped onto MapTool). I set the token to be a NPC and I selected it, then copied the basic macros from the campaign panel. I want to modify the statblock but when I click the statblock macro, I get this message in chat:
Unknown JSON type "" in function "json.get".
I'm sure I could get away with just copying an existing NPC and changing the token, but there must be a way to do this from scratch. Advice appreciated!
Late response, but since I didn't see anyone else addressing this question, here goes:

I was able to successfully build a new NPC token, in my case, an Illusionist NPC class token. I achieved this by doing the following:
1. Find an NPC/monster token amidst those Rod has provided which is similar to what you want to make (I used the Archmage)
2. Drag it onto the map and select it
3. In the Selection macros, just beside the Statblock macro is another macro called "info." This macro actually contains a JSON-style block of data which the framework uses to generate the token's statblock.
4. Edit the chosen token. Give it a new name and "Save As" a new token (so you don't accidentally overwrite the original token you used.)
5. Edit the "info" macro for this new token of yours.
6. Alter the JSON data block to represent the creature or NPC you want this to be. (I found it easier to CTRL+A, copy the whole thing out to a proper text editor, then copy/paste it back into MapTool after the edits were complete.)

If you're at all familiar with JSON objects, it's pretty easy to read. Even if not, take a few minutes to read through the existing data block for the template token you chose and it should become apparent what needs to be changed. Try to choose a template token that is similar to what you're making; for example, if you're trying to create a spellcaster, choose an existing token with spellcasting abilities to start with.
You coud theoretically reference multple existing tokens, if you need to combine abilities of different types and can't find them all on one token.

Bujinmar
Kobold
Posts: 1
Joined: Thu Feb 06, 2020 4:48 pm

Re: Rod's D&D 5e Framework

Post by Bujinmar »

Hi, Love this frameworks started using maptools lately its really confusing sometimes but my players love so do what we gotta do ... I started using it and works good until I realize we couldnt pull the character sheet up after adding certain things to there inventory via well the tokens like dungeering kit and I would get this error ever time ( getMacroProps(): first argument must be a number. ) Im not a coder so if anyone at all knows how to fix this I would apreciate it ... bet its simple :shock:

Sylphir
Kobold
Posts: 1
Joined: Thu Feb 06, 2020 11:23 pm

Re: Rod's D&D 5e Framework

Post by Sylphir »

Bujinmar wrote:
Thu Feb 06, 2020 4:52 pm
Hi, Love this frameworks started using maptools lately its really confusing sometimes but my players love so do what we gotta do ... I started using it and works good until I realize we couldnt pull the character sheet up after adding certain things to there inventory via well the tokens like dungeering kit and I would get this error ever time ( getMacroProps(): first argument must be a number. ) Im not a coder so if anyone at all knows how to fix this I would apreciate it ... bet its simple :shock:
I'm not 100% sure that's what you have but based on what you said it's most likely the issue. I have found that if you have more than one macro of the same name, the entire character token gets glitched out since the code reads the names verbatin and doesnt have an id system.

Check the character token for macros with duplicate names. Some examples that may happen: copies of the same item in the inventory group, different spells that have the same name throughout the character (one example that actually happened to me: Darkvision, I had to go into the modules and rename one of the Darkvision spells to Darkvisi0n to resolve the conflict), etc.

anathemort
Kobold
Posts: 4
Joined: Tue Dec 03, 2019 10:59 pm

Re: Rod's D&D 5e Framework

Post by anathemort »

Has anyone tried this with >= 1.5.11 and the changes to the JSON tooling? Any issues we should be aware of?

rpt-steve
Kobold
Posts: 19
Joined: Thu Oct 03, 2019 10:42 am

Re: Rod's D&D 5e Framework

Post by rpt-steve »

anathemort wrote:
Sun Feb 23, 2020 4:54 pm
Has anyone tried this with >= 1.5.11 and the changes to the JSON tooling? Any issues we should be aware of?
I tried it once and immediately started getting errors about undefined values that I had no idea how to solve.

I figure I'll take another crack at it (with 1.5.12 now) once I get more familiar with debugging macros in general. Some of the other bug fixes in this thread have been very educational in that regard, too!

User avatar
rtakehara
Cave Troll
Posts: 48
Joined: Mon Nov 11, 2019 5:11 pm
Contact:

Re: Rod's D&D 5e Framework

Post by rtakehara »

Hey guys, sorry for the absence and thanks for all the comments and fixes, I've been doing a rework on the character sheet. I didn't update the OP yet because
1 - It's not ready yet and
2 - It will change a lot, so even when its done it will break other parts of the framework, so I will have a lot of fixing to do

for now, if you wanna try it and/or give feedback the link is here

I am trying to remember to add comments, indentation and make it more robust so it wont break that easily, and to make it easier for people to change/fix/add/steal

Vexlor
Kobold
Posts: 14
Joined: Fri Apr 24, 2009 8:43 pm

Re: Rod's D&D 5e Framework

Post by Vexlor »

How do you start the character creation wizard in you framework? Thanks.

Eight
Kobold
Posts: 2
Joined: Sun Mar 22, 2020 5:24 pm

Re: Rod's D&D 5e Framework

Post by Eight »

Hi guys !

First of all, thank you very much Rodrigo for your nice work. I'm begining GMastering and you offered me a nice tool even 5 years after DnD5 release like I've rode on Youtube ; ). Shall we Chromatic Orb those ones impatients or not saying hello.. Anyway.

I'm writing here because I get an error while creating tokens (wizard and manual) just like shown on your tutorial:

Erreur lors de l'exécution de isOwnedByAll il n'y a pas de Pion d'ID inconnue . (can't find the way to turn chat in english) But that means :

Error while running isOwnedByAll there is no UnkonwnID Token.

I've tried changing Name, GM Name, label, PC/NPC, Owners,.. Not better. Next i've tried to understand the script but I've no clue for the moment. I'm downloading files anew in case of corruption.

If any ideas I'd glad to ear it, I'm discovering Maptool too, so I might be missed something.

Cya.

Eight
Kobold
Posts: 2
Joined: Sun Mar 22, 2020 5:24 pm

Re: Rod's D&D 5e Framework

Post by Eight »

Found !

A comma in the token's name was generating the error. Solved by ...removing it. :lol:

Now I'm stuck when we have to set hit points or alignement. This time it's :

Error while running getProperty there is no Impersonated Token. (Erreur lors de l'exécution de getProperty il n'y a pas de Pion personnifié.)

or sometimes:
Unknown Macro

And I can't use the character sheet properly with the created token while it's perfectly working with existing ones.

I keep trying.

Cya.

Post Reply

Return to “D&D 5e Frameworks”