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

a basic question about building sheets, rolls based on drop down choice

I'm pretty new to all this and trying to build a sheet for a system where magic is limited and there are only a few spells, I was planning on listing all the spells in a drop down menu and having a "cast" button next to it, but there's a couple of things I want to add in too the attack's roll gets buffed or debuffed depending on alignment which is a set of checkboxes, is there a way I can put a button next to the dropdown menu that checks the attributes of both alignment and the selected spell and then does an output roll based on those? Bare in mind I don't want to do a popup dropdown menu as a part of the roll I would rather this all be handled in the sheet so you get one nice clean output. example spell dropdown is currently set as holy light click the cast button, it checks the spell in the dropdown as holy light then it checks, is good alignment checkbox ticked? yes? then output roll to 4d10>4, if not then it does 4d10>5 instead
1595686239
Kraynic
Pro
Sheet Author
Does alignment get used as a value for anything else?  You could have alignment set up as a drop down select with a value that can be called as an attribute.  Then you would just write your macro as 4d10>@{alignment}  or something similar.
Kraynic said: Does alignment get used as a value for anything else?  You could have alignment set up as a drop down select with a value that can be called as an attribute.  Then you would just write your macro as 4d10>@{alignment}  or something similar. I mean I guess, is there any way of making it so that the text displays the actual alignment and in the background it generates a variable that I could then reference elsewhere? otherwise saying "alignment of 1" just doesn't really make much sense... I've seen people say there's no such thing as if statements in this system but surely there has to be otherwise how would the OGL sheet use checkboxes? because checkboxes in themselves are conditionals, "if checked add profmod to dexsave else add nothing" surely there's got to be some way we can do that.
1595688995

Edited 1595689020
Kraynic
Pro
Sheet Author
Yeah, what is displayed in the select doesn't have to be the value that it sets as the sheet attribute.  One of my sheets uses this method to set attack type modifiers for weapon fire. <select class="aim-type parchment" name="attr_aiming" /> <option value="-6" title="Spray Primary Target, -6">Spray</option> <option value="0" title="Wild, no bonus" selected="selected">Wild</option> <option value="1" title="Burst, +1">Burst</option> <option value="3" title="Aimed, +3">Aimed</option> <option value="4" title="Aimed Revolver, +4">Aimed R</option> <option value="5" title="Aimed with Sniper, +5">Aimed S</option> </select> The attribute is aiming, and is called by @{aiming} in the roll button macro.  The value is what gets plugged in for that attribute when the macro is run.  What is shown in the dropdown is what is right before </option>.  When you mouse over an item on the list, it will display the title value. If you want to go with a checkbox or radio button setup, you can do that.  If you set up something with alignment itself, then you can use the value in any macro anywhere on the sheet without having to have multiple checkboxes/radio buttons that need to be set.  Just use that attribute in the macros, and it is already set as soon as someone chooses their alignment.
1595689873
Andreas J.
Forum Champion
Sheet Author
Translator
You should really take and read <a href="https://wiki.roll20.net/Building_Character_Sheets" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets</a> and get a grasp of the basics, and look at the character sheet example, it helps to know the core building blocks when doing things. There is a long section named Storing User Data that details many of the common methods, including an example of dropdown menu , similar to what Kraynic just showed.
1595691165

Edited 1595691438
Kraynic said: Yeah, what is displayed in the select doesn't have to be the value that it sets as the sheet attribute.&nbsp; One of my sheets uses this method to set attack type modifiers for weapon fire. &lt;select class="aim-type parchment" name="attr_aiming" /&gt; &lt;option value="-6" title="Spray Primary Target, -6"&gt;Spray&lt;/option&gt; &lt;option value="0" title="Wild, no bonus" selected="selected"&gt;Wild&lt;/option&gt; &lt;option value="1" title="Burst, +1"&gt;Burst&lt;/option&gt; &lt;option value="3" title="Aimed, +3"&gt;Aimed&lt;/option&gt; &lt;option value="4" title="Aimed Revolver, +4"&gt;Aimed R&lt;/option&gt; &lt;option value="5" title="Aimed with Sniper, +5"&gt;Aimed S&lt;/option&gt; &lt;/select&gt; The attribute is aiming, and is called by @{aiming} in the roll button macro.&nbsp; The value is what gets plugged in for that attribute when the macro is run.&nbsp; What is shown in the dropdown is what is right before &lt;/option&gt;.&nbsp; When you mouse over an item on the list, it will display the title value. If you want to go with a checkbox or radio button setup, you can do that.&nbsp; If you set up something with alignment itself, then you can use the value in any macro anywhere on the sheet without having to have multiple checkboxes/radio buttons that need to be set.&nbsp; Just use that attribute in the macros, and it is already set as soon as someone chooses their alignment. ok thankyou so much this is what I've been looking for, this makes more sense now, question though can the value be anything or can it only be integers? Andreas J. said: You should really take and read <a href="https://wiki.roll20.net/Building_Character_Sheets" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets</a> and get a grasp of the basics, and look at the character sheet example, it helps to know the core building blocks when doing things. There is a long section named Storing User Data that details many of the common methods, including an example of dropdown menu , similar to what Kraynic just showed. I have tried reading that wiki, unfortunately a lot of it doesn't make sense to me, it's an unfortunate side effect of having a kinesthetic learning style, I don't learn much by reading large blocks of text, my main learning style is doing things step by step through experimentation and asking direct questions to get what I need to know and fleshing it out from there. Unfortunately this means I end up asking things that to some would seem simple but to me require explanation.&nbsp;
1595692944

Edited 1595693332
Andreas J.
Forum Champion
Sheet Author
Translator
ok thankyou so much this is what I've been looking for, this makes more sense now, question though can the value be anything or can it only be integers? The value can be anything. I have tried reading that wiki, unfortunately a lot of it doesn't make sense to me, it's an unfortunate side effect of having a kinesthetic learning style, I don't learn much by reading large blocks of text, my main learning style is doing things step by step through experimentation and asking direct questions to get what I need to know and fleshing it out from there. Unfortunately this means I end up asking things that to some would seem simple but to me require explanation. Yeah, everyone have their learning style, but with programming it's pretty useful or in advanced situations, crucial to be able to read documentation. As it currently exists, those examples and explanations are much more readadable to the average person and isn't written in a strict "technical documentation"-style. I still encourage to each time go and try read sections that seems relevant before asking someone, and when you hear the explanation, go again and read it, and you have a much easier time understanding it. You could use this to become better at reading documentation, and expand the horizon on how you are able to read new things. I don't learn much by reading large blocks of text, Can you point to a section on the main page that include large blocks of text? To me the page is long for sure, but everything is split up in short sentences and bullet points, and snippets of code, and any longer piece of text is written in natural language to describe what's going on rather than technical language. On another point, I think it might do you good if you check the source code of any simpler character sheet(no, don't look at the D&amp;D 5E sheet) that you're very familiar with, knowing how to use the sheet from before and then "looking under the hood" could give you a few heureka-moments regarding how charcter sheets are made and structured.