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

hidden rolls from charsheet

Hi, I know this question was already asked for several times but I did not find any answer, that works with rolltemplates ... so here is the question: for some skills I would like to have the rolls done by the players but without showing them the result. Example is "psychology".  We frequently use it for "Does it seem to me, that he is saying the truth ?" - so that is use of "psychology" but of course they should not see the result. Of course I could do the roll - but - as you all know -players like to roll for themselves. so what I am asking for is a replacement of the inline "[[1d100]]" roll in the example, that is providing the same result, but without "throwing the dice" <tr>                     <td><input type="checkbox" name="attr_psychology_checkbox"></td>                     <td class="skill-label">Psychologie (10%)</td>                     <td><input class="skill-input" type="text" name="attr_psychology" value="10"/></td>                     <td><button type='roll' value='&{template:coc_hidden} {{name=Psychology Roll}} {{success=[[@{psychology}]]}} {{hard=[[floor(@{psychology}/2)]]}} {{extreme=[[floor(@{psychology}/5)]]}} {{ roll1=[[1d100]] }}' name='roll_psychology_check' /></td>                 </tr> thanks a lot. have fun and stay healthy ! Thomas
1586734915

Edited 1586735029
vÍnce
Pro
Sheet Author
I think you might consider using an API script.  !broll would work, but I don't think it can handle roll templates or inline rolls, so you would need to make a custom macro that uses !broll. maybe something like;   /em @{selected|character_name} is rolling a Psychology Roll... !broll 1d100 --Rolled vs !broll 1d0+@{selected|psychology} --Success !broll 1d0+floor(@{selected|psychology}/2) --Hard !broll 1d0+floor(@{selected|psychology}/5) --Extreme
Hi Vince, thanks for your answer and your suggestion - which I do not understand :) the !broll 1d0.... things are examples or for what are they meant ? I think I would have to test the result of the first roll against the other values which - as I thought - is not possible ? an API call (randomInteger(100)) is what I really would like to use but unfortunately I have no idea how to do it inside the html ???? has anybody any idea ? thanks in advance Thomas
1586788810

Edited 1586788841
vÍnce
Pro
Sheet Author
My example is how you "could use" an custom/external script to make a hidden roll similar to what you have on the sheet.  Is this a custom sheet where you have access to edit the sheet's code?
Yes, I can put in whatever i like ;)
Hi I now decided to go for action buttons on the character sheet. <td><button type="action" name="act_gsprobe">test</button></td> and listen to the events on .js on("clicked:gsprobe", function(obj) { sendChat("gm","gsprobe clicked"); }); on("change:attribute", function(obj) { sendChat("gm","attribute changed"); }); I put the on"change" in, to see if I am doing it right ... and this one fires whenever I change an attribute-fine. But I want to listen on the action button - and this event never fires up :( I tried with the leading act_ on the name and without but it still does not fire up this event. what am I doing wrong ?
1586796013

Edited 1586796039
GiGs
Pro
Sheet Author
API Scripter
action buttons cant send to chat, they can only change attributes. In a similar way, roll buttons cant change attributes, they can only send to chat.
Do I get it right, the event is triggered but I just don’t see the chat, because it’s „suppressed“ ?
1586803677
GiGs
Pro
Sheet Author
API Scripter
Suppressed isnt quite the right word. It's more like that functionality isnt available. You can test if an event is triggered by putting something like this in the worker: console.log('==== gsprobe event triggered ===='); if you have the browser console open (F12 to get to it on firefox and chrome, make sure console tab is selected), this message will be visible there. A lot of messages get posted there, the "====" in the above help your message stand out.
Hi GiGs said: Suppressed isnt quite the right word. It's more like that functionality isnt available. You can test if an event is triggered by putting something like this in the worker: console.log('==== gsprobe event triggered ===='); if you have the browser console open (F12 to get to it on firefox and chrome, make sure console tab is selected), this message will be visible there. on("clicked:gsprobe", function() {     console.log('==== gsprobe event triggered ===='); }); I just don't understand - I still do not get the event message (yes, I opened the browser console, saw a lot of messages - selected to see all console messages -> nothing) What am I doing wrong ?
1586959961
GiGs
Pro
Sheet Author
API Scripter
I just tested it just in case there was a syntax error I couldnt see, and it works fine for me. When you have code that should  work, but doesnt, there's usually another problem. This can be a sheet worker earlier in the script block that has bad syntax and breaks everything that follows it, for example. If you remove all other code from your script block, does it work? If it still doesnt work, can you post you entire html and css files on pastebin.com, or gist.github.com, and link them here?
Hi, I reduced my character sheet to this (really nothing else!): <button type="action" name="act_gsprobe">test</button> and my .js to this: on("clicked:gsprobe", function() {     console.log('==== gsprobe event triggered ===='); }); and still nothings fires up.
1587034597
Loki
Sheet Author
Hi, did you actually initialize the script-section? <button type="action" name="act_gsprobe">test</button> <script type="text/worker"> on("clicked:gsprobe", function() { console.log('==== gsprobe event triggered ===='); }); </script> This works fine on my empty sheet. Cheers!
AHHH thanks, now i got it .... when i put it in a seperate .js (script) file it doesn't come up. when I append it at the end of the .html inside the <script....> section it works !!!! great  now I will continue to build my "hidden roll"-logic ... and will post the solution as soon as it works. Thanks to all