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

HTML Calculation Question

1568394504

Edited 1568394552
Apologies ahead of time if this is the wrong place to post this, it's an inquiry about editing HTML code for character sheets which I don't believe is API.  But this goes to my next point which is I have absolutely 0 experience doing coding of any kind.  The tl;dr is that I've taken Arioch1973's Warhammer 4e character sheet code from pastebin and been modifying it for my own use as something of an experiment, trying to learn HTML as I went.  So far it's been pretty good, but there's a feature I'd like to add and have no idea how to go about doing it. Essentially, for roll calculations, I'd like the resulting output to display all the numbers in the calculation and not just the 'answer'.  I.E., if I'm rolling a 1d100 with a +22 stat and get a 65, I'd like it to show "22 + 65 = 87" and not just "87". This is the line so far, which just gives me a straight answer: <td style="text-align:left; width:8.3%"><button type="roll" name="roll_WS" value="&{template:wfrp4} {{title=Weapon Skill}} {{dice=[[ 1d100+?{Modifier?|0}+@{Current_WS} ]]}}"><label style="text-align:center">WS</label></button> Anyone got any ideas or am I in the wrong place entirely?
1568395146
GiGs
Pro
Sheet Author
API Scripter
I expect this thread will get moved to the character sheets forum. I think the only way you have to do this (without using an API script) would be to implement it in the rolltemplate. You'd need to modifiy the macro to something like value="&{template:wfrp4} {{title=Weapon Skill}} {{modifier=?{Modifier?|0}}} {{skill=@{Current_WS}}} {{dice=[[ 1d100+?{Modifier?}+@{Current_WS} ]]}}" Then in your roll template, you can include the modifier and skill in the output.
Thanks!  I'll give it a try.
1568395682
GiGs
Pro
Sheet Author
API Scripter
oh, i just realised i didnt answer exactly what you were asking. There's no way (outside the API) to display the roll separately, and use it in a calculation. 
Fair enough, I'll trundle on over to the api section and beg for help then.
1568396588
GiGs
Pro
Sheet Author
API Scripter
Power Cards is likely to be the solution there. It's a script that was designed to display output before rolltemplates exit and is more powerful than rolltemplates (but only usable by Pro subscribers).
I'll take a looksie at that one, thanks for the suggestion.   I take it with API, all it really means is just adding the API Script to your game and then inserting part of the API code into the HTML code?  I know this isn't really the place to ask but so long as I have your attention I'll abuse it.
1568398844

Edited 1568398859
Finderski
Pro
Sheet Author
Compendium Curator
Well...you could forego the roll template and inline roll and that would display what you want, but it wouldn't look as nice. <button type="roll" name="roll_WS" value="/r 1d100+?{Modifier?|0}+@{Current_WS}">
Closer, yes, but I'll dig around PowerCards a bit.  Thanks for the info all the same!