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 .
×

Defining abilities in the charsheet html.

Hi, I would like to create a set of predefined abilities in the html of the char sheet such that when folks use the sheet, the abilities are pre-populated and can be used by players very much like macros. I am looking for pointers to existing sheets so I can look at the example and build my own.  Thank you.
1509638280
Natha
KS Backer
Sheet Author
API Scripter
You'll have to use buttons (type="rolls", value="(your roll)") to do something close to abilities. See&nbsp; <a href="https://wiki.roll20.net/Building_Character_Sheets#" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets#</a>... For example :&nbsp; &lt;button type='roll' value='/roll 1d20 + @{Bluff}' name='roll_BluffCheck'&gt;&lt;/button&gt;
I see. How about I specify something like pc_custom_action (I do not know the technical term for it), that way the user can create a ability manually and call @{selected|pc_custom_action}. In the char sheet html the pc_custom_action is set to the macro code that needs to be executed. Basically, I want to setup a method where a player clicks on the token, hits the ability button and that in turn executes the macro, because the macro code is defined in the sheet and "pc_custom_action" is a simple way to reference it. I am trying to reduce the need for players to open the character sheet to execute commands, and at the same time remove the need to maintain a separate document defining all the helpful macros for PC activities. I am sorry if I am not being clear.
Essentially you would want an attribute textbox to hold the macro code (pc_custom_ability_rollcontent) and the button would use this attribute for it's value. &lt;textarea name="attr_pc_custom_ability_rollcontent"&gt;&lt;/textarea&gt; &lt;button type="roll" name="roll_pc_custom_ability" value="@{pc_custom_ability_rollcontent}"&gt; A problem with this would be making it a token action. I am not aware of a way to specify a button on the character sheet as a token action without adding a character ability to directly call the roll. So you would still need to add a character ability to each player to call this roll; at which point it seems pointless since you could just as easily put the macro code in the character ability as the pc_custom_ability_rollcontent attribute.
Kyle, thank you for giving me the example. Setting up the textarea as you suggested, will it be visible on the char sheet to the players? Yes, you are correct that "you would still need to add a character ability to each player to call this roll". As you all have said there does not seem to be a way to create a pre-defined ability from the html of the char sheet. However, consider this scenario. 1) I create a sheet for new RPG game out there. 2) One specific action in the RPG requires multiple user inputs like number of d20 to be rolled, selecting attributes that matter to the roll, selecting abilities that matter to this roll, and in turn those attributes and abilities will set the target number that defines if the roll is successful or not. 3) This is neatly encoded in html of the char sheet using button type roll and setting&nbsp;value=........ representing code that runs #2. 4) Next some players request that they would like to execute those rolls from the token rather than opening the char sheet each time. This is where abilities come in. 5) So I instruct them on how to setup abilities in the char sheet and copy the content of value="......." into the abilities section. #5 is where things start to break cos the roll formula is complex with } | and, symbols being replaced by html code. Plus writing a readme on how to use the char sheet and setup useful macros/abilities becomes cumbersome as the roll formula is unwieldy. With your suggestion the ability now just has to call&nbsp;@{selected|pc_custom_ability_rollcontent} as opposed to copying an extremely long roll formula. I hope this clarifies why I am pursuing this course of action. If you all feel I missing something fundamental please let me know. Suggestions are always appreciated.
1509644692

Edited 1509644833
Lithl
Pro
Sheet Author
API Scripter
Kyle G. said: A problem with this would be making it a token action. I am not aware of a way to specify a button on the character sheet as a token action without adding a character ability to directly call the roll. Adding class="token_action" &nbsp;(or maybe it was tokenaction, I forget) to the button will make it a token action. Sheet authors don't generally do it, because if the sheet has token action roll buttons, it's impossible for the users to remove those token actions.
Brian said: Kyle G. said: A problem with this would be making it a token action. I am not aware of a way to specify a button on the character sheet as a token action without adding a character ability to directly call the roll. Adding class="token_action" &nbsp;(or maybe it was tokenaction, I forget) to the button will make it a token action. Sheet authors don't generally do it, because if the sheet has token action roll buttons, it's impossible for the users to remove those token actions. Ooh that's awesome! I haven't gotten in to custom character sheets yet and mainly work in the API, but that really gets ideas flowing if I do.
1509710276
Finderski
Pro
Sheet Author
Compendium Curator
Kyle G. said: Brian said: Kyle G. said: A problem with this would be making it a token action. I am not aware of a way to specify a button on the character sheet as a token action without adding a character ability to directly call the roll. Adding class="token_action" &nbsp;(or maybe it was tokenaction, I forget) to the button will make it a token action. Sheet authors don't generally do it, because if the sheet has token action roll buttons, it's impossible for the users to remove those token actions. Ooh that's awesome! I haven't gotten in to custom character sheets yet and mainly work in the API, but that really gets ideas flowing if I do. Just keep in mind what Brian said...those token actions can't be unselected if they are coded in the character sheet and they don't appear on the Attributes and Abilities tab to unselect either. &nbsp;Additionally, they show up, even if the button is hidden. &nbsp;AND....you can't rename them either, so...there are complications with them all around. &nbsp;
Yes, you are right. I went with Kyle G. first suggestion, with a slight tweak. &lt;input type="hidden" name="attr_pc_control_task_ability" value="roll_formula"&gt; Then I manually created an ability and added the code&nbsp; @{selected|pc_control_task_ability} I will define all the roll formulas the game need in the sheet, and on the README page I can give short instructions on how to call these formulas&nbsp; from abilities without worrying about user error. My roll formula have nesting and requires character escaping as defined in,&nbsp; Macro (troubleshooting) . Thanks for all the help guys. I have no more questions.