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

Button in Macro quick bar and custom compendium for abilities

Hello again fellow devs, I'm here with two question regarding the custom sheets aspects. My custom sheet is formed by now: sections, tabs , sheet workers,roll templates and some automated calculus for many inputs. What is lacking now is some other functionalities, currently I'm focusing on:  Creating a button to post in chat a summary of characther info: hp, mp , def etc. no user input or rolls needed, but I want to make this button avaiabile in the macro bar ( Similiraly when I created my original custom macros) which type of the three categories of buttons of Roll 20 offers : roll, action , conpendium is suited to this specific case? And how is this behavior implemented in the sheet? Side question: the action button wiki states that the button name should not contain underscores after act_  but mine does and the sheet workers tied to them seems to catch the event fine, is the wiki outdated?         Abilities : I'm facing the first big problem with the multitude of types and behaviors , especially for spells like abilities; in this cases how the other sheet devs approached this problem? Should I hard code everything in the sheet HTML file and hide them with CSS to be used and showed when needed ? Or there is the chance of creating a "compendium" in a separate file where entire classes and abilities are stored to be pulled in the sheet when needed?
1675701515
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Luc, Creating a button to post in chat a summary of characther info: hp, mp , def etc. no user input or rolls needed, but I want to make this button avaiabile in the macro bar ( Similiraly when I created my original custom macros) which type of the three categories of buttons of Roll 20 offers : roll, action , conpendium is suited to this specific case? And how is this behavior implemented in the sheet? This would be a roll button. Downside to a roll button is that you can't use CRP. There is an involved workaround to connect roll buttons to action buttons to allow you to have both the ability to drag to the macro bar and use CRP (the workaround is simply a mixin in the K-scaffold). Side question: the action button wiki states that the button name should not contain underscores after act_  but mine does and the sheet workers tied to them seems to catch the event fine, is the wiki outdated? The wiki isn't out of date, the warning just isn't specific enough. Regular action buttons will work just fine with an underscore in the name. However, an action button in a repeating section will fail if the button's name has an underscore in it. The reason it's generally best practice to not use underscores in action button names at all is so that you have a consistent naming schema for your action buttons, attributes, and roll buttons. My personal naming schema is: Attributes: snake_case, full words unless a short form has near universal acceptance. e.g. str_md would be bad, but strength_mod is fine. Roll buttons: snake_case, full words unless a short form has near universal acceptance. Should be the same name as the attribute being rolled if possible. E.g. the strength attribute roll button would be just strength . (Exception for the naming scheme for the action button - roll button workaround linked above) Action Buttons: kebab-case, otherwise the same as roll buttons. Abilities : I'm facing the first big problem with the multitude of types and behaviors , especially for spells like abilities; in this cases how the other sheet devs approached this problem? Should I hard code everything in the sheet HTML file and hide them with CSS to be used and showed when needed ? Or there is the chance of creating a "compendium" in a separate file where entire classes and abilities are stored to be pulled in the sheet when needed? It is typically not recommended to put feats, spells, abilities, equipment, etc. directly in the character sheet. Aside from the legal issues of what is fair use vs. what is copyrighted, hard coding in feature text makes the character sheet extremely fragile and maintenance intensive and (perhaps more importantly in my opinion) prevents players from doing any sort of homebrew. Instead, the best way to do this is to make your ability and spell repeating sections as mini forms that users fill out with the details of their feature. They can then enter whatever details they want/need to and the sheet becomes much more future proof.
Dear Scott thanks for your answer, for the two first part I'll delve deeper in the link provided and try to implement it in my sheet. I'm actually adopting the snake_case for attr_ types; I'll adopt the kebab-case for the act_ types since I have repeating sections in my sheet and the last thing I want is to have an extra headcache wondering why a JS worker fails to comply in those section. For the last part maybe I need to be more specific and elaborate futher,  I guess the compendium option is out of the possibilities, if so then: First and foremost I do not plan to share or publish my sheet to the general public, it's just to make our game berable and don't go back and forth from the pdf sheets to the broswer. With this calrified allow me to borrow some of your time to explain the general structure of class and abilities in our game system so I can have a confirmation that I can apply your approach:  There are N fixed classes in the game. All classes have 5 fixed abilities that a player can choose, some are single levels others may let a player invest levels in them. Classes grants passive extra abilities and extra stats once acquired first time only. Most beahviour are standard and related to the level a player invested in that ability, others may be more complex and outliners. At most a player can invest 10 level in single class as total beetwen the abilities, so a player may not take them all. So I need to abstract abilities , spell and special abilities behavior and traslate those in single HTML forms/section/elemtn that a player must fill in order to use them; all within a repeating section for each type : one for class, one for abilties, one for spells and one for special abilties since repeating section are not able to nest into each others. My initial tought was to automate all this process: 1) A player picks a class  2) The custom sheets fills itself all the section of that class with abilities and spells 3) The player just needs to press a button to show a ability in chat. But if this is not possibile for our custom sheet enviroment I guess hardcoding everything is out of question and I should rely on manual input by the player. I hope that I got your suggestion clear and square.   Thanks for your time.
1675730110
GiGs
Pro
Sheet Author
API Scripter
If you custom sheet is for your own system, I suggest putting everything in the sheet, so you can maximise its usefulness. Aso if it's just for your own group's use and not for general use, go wild - hardcode whatever you want in the sheet if it makes the job easier. Regarding Compendium: since there are no custom compendiums (yet), hardcoding everything you can in the sheet is a good idea. I want to make this button avaiabile in the macro bar The sheet has no way to control this. Any button you create on the sheet can be dragged to macro bar by players, but the sheet can't do that automatically.
1675780957

Edited 1675781012
Thanks for your answer Gig, maybe at this point I'll consider both designs and mix them where I need them the most, maybe where abilities are too complicated to be abstracted as scott said.
1675808886
GiGs
Pro
Sheet Author
API Scripter
Go ahead! Since the sheet is for your private group, you can do whatever you want.