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

Questions about existing character sheet and dice rolls

Not sure this will be API, but not sure macros can handle it.  So my players and I were thinking of running some old school Marvel Superheroes (FASERIP).  I know there is a character sheet.  That sheet has roll buttons associated with the attributes.  Sarah A.  created an API (not sure if it is still supported) to produce in chat the results based on the combat chart. I sent a message to Sarah A. asking if she is still supporting her API, however if there is an easy way to go about changing it for my needs... So here are my two questions: 1.  I would like to two things to her script (if she is no longer supporting it)     A:  instead of the script using an random integer 1-100.  I would prefer that it gets the results from % dice roll in game.     B:  The API returns "1-10" for a stun when the result is in the white area of the chart.  This is correct, however, it would be nice to have it roll a d10 and present the result in chat rather than the chart result. 2.  How does one change the roll macro on a sheet?  Currently the MSH character sheet has a roll button for each attribute.  It rolls the dice and presents the results in chat.  I would like to find a way to have it use the above mentioned API so that it then returns the result of the roll.  I am fine with it rolling and then presenting or by changing the character sheet itself (although this is the least of the options I would like). Any suggestions?
1623164397
timmaugh
Pro
API Scripter
Making the change to the script doesn't sound like a huge lift. Both items you mention should be manageable (though the 'B' option would require more information/explanation to make sure the outcome matched what you were looking for). Changing the sheet is a little out of my wheelhouse, but as I understand things, you'd have to edit the sheet, yourself, then sub in your sheet to be used in the game you're running. Character Sheet gurus probably can tell you better the steps, there. I only wanted to point out that if you are already getting scripts involved, you could just forego the built-in buttons. You could have a button that generated a chat menu with a button for each attribute that runs Sarah's script with appropriate flags. Instead of having to have the character sheet open all the time, just click the button to get the menu, then run the appropriate attribute's associated call. An appropriate attribute's associated assignment as attuned against all available arcanery. *ahem* =D
test to check code tags [code] /* this is a test */ [/code]
Yes.&nbsp; I have no problems bypassing the roll buttons on the sheet unless I can not instead find a better way.&nbsp;&nbsp; I am thinking that a macro with a drop down to perform an attribute check could be written to include the command lines to fire off the script. so for option B: not sure how to post code here....hmmm. anyway.&nbsp; Sarah A.&nbsp; API can be found here: &nbsp;&nbsp;&nbsp;&nbsp; <a href="https://github.com/madartiste/roll20-api-scripts/blob/master/Universal%20Table%20Roller/Universal%20Table%20Roller.js" rel="nofollow">https://github.com/madartiste/roll20-api-scripts/blob/master/Universal%20Table%20Roller/Universal%20Table%20Roller.js</a> The code returns a white result and that is presented in chat as 1-10.&nbsp; It is the number of rounds someone is stunned for that result.&nbsp; I am thinking an IF statement checking if the results to be presented = 1-10 then roll d10 in game and present results in chat as part of the API result. the roll dice versus random integer&nbsp; here is the code: &nbsp; &nbsp; /* SETUP DICE ROLL AND GET MESSAGE CONTENT */ &nbsp; &nbsp; &nbsp; &nbsp; var rollNum = randomInteger(100);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var msgContent = msg.content; &nbsp; &nbsp; &nbsp; &nbsp; var input = msgContent.toLowerCase().split(" "); how would I change that to tell the API to roll %dice in game and capture the results in the rollNum variable? Thanks
1623169737
timmaugh
Pro
API Scripter
OK... now that I see the script and can put your question in context, I think that when you say "roll in game" you are talking about seeing the animated dice bounce around the screen. That seems to be the only thing that you're missing (since the randomInteger(100) function will return the same range and probabilities). Those won't work for a message sent to the API. There is a bit of a complicated way to have a script watch normal chat messages and store the value of a roll if the message content matched given parameters (like $[[0]]). That would make it *possible* to do things like having abilities like: [[1d100]] !ut everything else You would see the dice bounce around the screen, UT would have caught the d100 roll, and then it could test if there was a variable for the rollvalue (that is, a caught die roll), and generate a random number if there isn't. Your chat output would see the inline roll hit first, then the UT output. It would take a significant rewrite of the script to make it work, giving it a proper closure, though, so... is that what you're looking for? (BTW, code blocks are in the upper left button of the formatting/style bar available when you're entering/editing the content of a post. The dropdown has various styles, with one of them being "code".)
Thanks for the info on code blocks.&nbsp; Yea! Yeah sounds like you understand what I want.&nbsp; I know players like to see dice bounce around.&nbsp; Technically we could live without it.&nbsp; I mean we all lived with not using computers for decades so...... So I will check with the players once we play our first session.&nbsp; If they just have to have dice bounce AND Sarah A. is not still supporting the code, maybe a re-write will be needed.&nbsp;&nbsp; What about replacing the 1-10?&nbsp; Same issue I would think.&nbsp;&nbsp; Is there a way for a API to be written that checks chat for the message format this API uses to report its results and have that look for the white result 1-10 and have it roll a d10?&nbsp; That might work.&nbsp; Course my lazy b$tt could just roll the die.
1623170566
timmaugh
Pro
API Scripter
That part is the harder part... it sounds like you always need to roll the d100 in this system, so you could (with a moderate amount of chat-output-intrusion) manage to roll that every time. The d10 is a "if this outcome is generated, then roll this" roll, which would be coming from API... so, there again, if you're looking for the animated dice, that won't work. If it is just that the script isn't giving you an actual number between 1 and 10 and you want it to be more specific (generating a random number), then we could figure that out, sure.
yeah this part of the request is really more about giving the GM (me) a result rather than the animation.&nbsp; This actually saves a step in combat.&nbsp; It is the only place in the results where there is a variable as such all other results are final.&nbsp;&nbsp; So there is not a way to look at the chat and see a message format that says "the moon is made of cheese" and if that happens have API produce a return of 1-10 or macro roll a dice?&nbsp; I just want to be sure we are clear on what I am thinking.
1623171788
timmaugh
Pro
API Scripter
Check out&nbsp; Custom Roll Listener ... I think that might fit the bill for what you want to do.