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

Sheet roll with number of dice as sheet carac, + texts

1414682525

Edited 1414682554
tontione
Pro
Sheet Author
Hello, i'm trying to make my first custom character sheet (Pendragon). i would like to make a sheet roll buton for rolling damages. the number of d6 is a sheet carac. (DEG), calculated from others caracs. Here is my code : < input type="number" name="attr_DEG" value="round((@{FOR}+@{TAI})/6)" disabled="true" > < button type='roll' name='roll_TestAttack2' value='/roll @{DEG}d6' > the result is : Could not determine result type of: [{"type":"M","expr":"round((17+10)/6)"},{"type":"C","text":"d6"}] i think it's a syntax issue, but i don't understand how to write it. Second question : how can i add some text as title to the result, something like " damages made by charactername:" ?
1414687510
tontione
Pro
Sheet Author
It seems the problem is because DEG is a calculated value (round((@{FOR}+@{TAI})/6)) , because if i change it for TAI, it works ! Is it a workaround for this ?
1414690255
Finderski
Pro
Sheet Author
Compendium Curator
I believe you could do something like: /roll [[@{DEG}]]d6 And if you wanted to give it a some sort of something to stand out, you could do: /me rolls Damage and gets: [[@{DEG}d6]]! Alternatively, could also just do: /me rolls damage and gets:\n/r [[@{DEG}]]d6 I may have the slash wrong in front of the n, you may need to use /n - I can't remember. I think those should work, though.
1414701999

Edited 1414702033
Lithl
Pro
Sheet Author
API Scripter
The problem is that you cannot use functions (such as round ) in the expression for the number of dice. however, the number of dice is automatically rounded already. You could do this: <input type="hidden" name="attr_DEG-dice" value="((@{FOR} + @{TAI}) / 6)" disabled="true"/> <input type="number" name="attr_DEG" value="round(@{DEG-dice})" disabled="true"/> <button type="roll" name="roll_TestAttack1" value="/me rolls [[@{DEG-dice}d6]]">with inline</button> <button type="roll" name="roll_TestAttack2" value="/roll @{DEG-dice}d6">without inline</button>
1414706184
tontione
Pro
Sheet Author
Thanks a lot Brian, perfect answer ! :)
1414768910
tontione
Pro
Sheet Author
GV, your idea doesn't work : it seems that /r is not understood after \n, it's displayed as text : /r 4.5d6 So i still don't know how to display text before the roll. In macros you just write one order per line, but how to do this into a roll 'value' property !?
1414781866

Edited 1414781916
Lithl
Pro
Sheet Author
API Scripter
\n is the correct character to use to separate lines in a roll button. I'm not certain why \n/r didn't work for you. Could you share the roll button you're trying to use? Maybe something else is causing the problem.
1414796562
tontione
Pro
Sheet Author
found it : just one space between \n and /r ! Thanks again. :)