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

[Help] Group roll "in-sheet" possible?

1451252880
vÍnce
Pro
Sheet Author
Is it possible to use Grouped Rolls( <a href="https://wiki.roll20.net/Dice_Reference#Grouping_Ro" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Grouping_Ro</a>... ) within a sheet's attribute value? &nbsp; ie value="({1,@{level}}kh1)" &nbsp;results in an incorrect value of "11" I know this works when sent to chat, but how about as the value of an attribute within the sheet?&nbsp; Thanks
1451257624
Finderski
Plus
Sheet Author
Compendium Curator
Do you want the attribute field to show the result of the calculation, or just store that text there, so it can be used in a dice roll by calling that attribute? If the former, I don't believe that's possible. &nbsp;If the latter, that should be possible...I think...not sure why it wouldn't be possible, anyway.
1451259409

Edited 1451259502
vÍnce
Pro
Sheet Author
We have quite a few "macro-text" fields on the PF sheet that allow a user to edit what is executed on the roll and as expected anything that works in chat works within the macro-text field/attribute as well. &nbsp;There are other fields/attributes that are used to provide the value for another field. &nbsp;These fields/attributes are the ones I'm asking about. &nbsp;Sadly, its looks like you can't use these advanced dice/roll features outside of chat... even though there isn't an actual "roll" necesssary to get the value;-(
Could you, perhaps, make use of sheet workers to emulate grouped rolls?
1451265327
vÍnce
Pro
Sheet Author
Corin S. said: Could you, perhaps, make use of sheet workers to emulate grouped rolls? Good point Corin. &nbsp;I keep forgetting that we now have access to js. &nbsp; I'm quickly coming to the realization that sheet authors(at least for me) that do not know js are going to be extremely disadvantaged as we move forward on Roll20...
1451416950
Ziechael
Forum Champion
Sheet Author
API Scripter
But that is what The Aaron is for isn't it? Seriously though, that guy will gladly take time out of his day to teach you anything you want to know :)
1451418715
vÍnce
Pro
Sheet Author
It's actually a good thing Ziechael. &nbsp;It's forcing me to learn a "pinch" more js. &nbsp;Just enough to mess things up mind you, then let an expert(Aaron, Brian, Stephen, etc.) save the day. &nbsp;;-P
1451419495

Edited 1451419506
vÍnce
Pro
Sheet Author
NEW FOCUS( thanks Corin ): Is it possible to handle grouping rolls from a macro-text field/attribute using sheet workers? ({1,@{level}}kh1)) isn't "really" a roll, just a comparison. Or is there a different js-friendly method that a user could input that would work?
<a href="http://www.w3schools.com/jsref/jsref_min.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_min.asp</a> <a href="http://www.w3schools.com/jsref/jsref_max.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_max.asp</a>
1451422881
chris b.
Pro
Sheet Author
API Scripter
Yes the sheet allows us to use min(x,y) and max(x,y) in the sheetworker parsed code, but not kh1 and kl1, but it's the same, users would have to simply change it. That was a major code I did, i can't believe you missed it! &nbsp; *insert crying emoji* But i was pretty sure it kh1 and kl1 worked in other fields as well, which we still want to have working so we don't have to race to update all those fields. example: &lt;input name="attr_fromfield" type="text" value="{1,2}kh1" /&gt; &lt;br&gt; &lt;input name="attr_tofield" type="text" value="@{fromfield}" disabled /&gt; I am reasonably sure the to field would display &nbsp;"2" , but now it just displays "121", concatenating all the numbers in the string. I don't know when this broke.
1451424901
vÍnce
Pro
Sheet Author
chris b. said: Yes the sheet allows us to use min(x,y) and max(x,y) in the sheetworker parsed code, but not kh1 and kl1, but it's the same, users would have to simply change it. That was a major code I did, i can't believe you missed it! &nbsp; *insert crying emoji* But i was pretty sure it kh1 and kl1 worked in other fields as well, which we still want to have working so we don't have to race to update all those fields. example: &lt;input name="attr_fromfield" type="text" value="{1,2}kh1" /&gt; &lt;br&gt; &lt;input name="attr_tofield" type="text" value="@{fromfield}" disabled /&gt; I am reasonably sure the to field would display &nbsp;"2" , but now it just displays "121", concatenating all the numbers in the string. I don't know when this broke. You're code is impressive Chris... stop crying. &nbsp;lol I guess it's the last part that is really the problem. Is this a bug, or by design? &nbsp;Solutions?
1451456839

Edited 1451456869
Corin S.
Sheet Author
While I am by no means experienced on the subject, based on problems I've had in the past, it sounds like surrounding the numbers from the string in parseInts could solve the issue. They might be string objects atm.