Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Custom Character Sheets, repeating sections and capitalization of RowID

1633731224
Jiboux
Pro
Sheet Author
Compendium Curator
Hi, While developping our sheet, we noted all sorts of bugs in the relationship between the API and the character sheet, many of them related to different capitalization strategies around the variable names... The latest that somehow made me scream in front of my screen, is a sheetworker routine that worked fine when I tested on the sandbox, but not on the production server. This routine, is triggered by a change of the name of a talent/skill (which are repeating sections) on("change:repeating_talents:t_name change:repeating_knacks:nac_name change:repeating_skills:sk_name", fn(AutoFill)); First very annoying bug, is that the routine triggers correctly when the name is changed by the user, and on the sandbox, it also triggers when the name is changed by the API... But not on the live server. We have already noticed in the past that triggers for repeating sections only worked if the attribute name was fully lowercased, and had to work around by either triggering on any change of the repeating section ( on("change:repeating_talents") or by creating a communication channel between the API and sheet (a string held in a non repeating variable, that triggers a sheetworker, that parses the string as acommand line to call the right sheetworker routines on the repeating sections named in the command line) I have now another example where the exact same setAttrs arguments (that I log) don't have the same results: [Log] setAttrs - repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_Mod-Type: Init repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_Target: None repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_Special: Initiative repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_Defensive: 0 repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_Resistance: 0 repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_MoveBased: 1 repeating_talents_-mlwt-7r9ceqeyvi6f9a_T_VisionBased: 0 When the above happens directly through a sheetworker trigger, the attribute are written, and the exact same happening on a API trigger, doesn't actually update the attributes... (Note that strangely enough, it works with sheetworker triggers, with vanalized rowIds, and with API that gives properly capitalized rowIds, it doesn't work, whether I keep the proper rowids, or vandalize them myself) Is it on the Roadmap of roll20 o finally adress the capitalization of repeating sections by making everything caps insensitive ?
1633736369
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
That is certainly frustrating. There have been a few changes to how cases are handled in the backend that some of us have noticed. However, the best practice for character sheets is to have all attributes be lowercased. Everything except for the API interacts with attributes in a case insensitive manner (and even the API can be made to mostly interact it this way as well).
1633789918
Jiboux
Pro
Sheet Author
Compendium Curator
Yes, if you know of this good practice early enough in development. Starting from existing code and exceeding 20.000 lines of code, it s a bit too late for that. Would like roll20 to address that