
Hi there, I have a Pro account and am trying to write a character
sheet. One thing that is giving me trouble is the ability / skill
rolls. I need to be able to roll d100, compare it to the ability / skill and
either show fail or the difference between them. That part is easy (ish). Where
I fall down is that I want to be able to show the actual roll. So far I have:- <label>&nbsp;&nbsp;Strength
</label>&nbsp;&nbsp;<input type="number"
name='attr_strength' class='sheet-short'> <button class='old-roll'
type='roll' name='roll_testattack' value=' &{template:mine} {{name=Strength Attribute Check}}
{{character=@{charactername}}} {{theroll=[[@{strength}-1d100]]}}
{{starget=@{strength}}}'> and the template <rolltemplate
class="sheet-rolltemplate-mine"> <div class="sheet-wrapper"> <div
class="sheet-border"> <table> <tr> <td
class="subheader">{{name}}</td> </tr> </table> &nbsp; <table> <tr> <div
class="big">Character: {{character}}</div> </tr> <tr> <div
class="small-win">Target: {{starget}}</div> </tr> <tr> <div
class="small-win">theroll: {{theroll}}</div> </tr> <tr>
{{#rollGreater() theroll-1}} <div
class="small-win">Attack Margin: {{theroll}}</div>
{{/rollGreater() theroll-1}} </tr> <tr>
{{#rollLess() roll1 0}} <div
class="small-fail">Result: FAIL </div>
{{/rollLess() roll1 0}} </tr> </table> </div> </div> </rolltemplate> This works exactly as expected but, the players will want
to know the actual dice roll (“how many did I fail by?” etc.) So, I changed the roll to be <button
class='old-roll' type='roll' name='roll_testattack' value=' &{template:chill} {{name=Strength
Attribute Check}} {{character=@{charactername}}}
{{roll1=[[@{strength}]]-[[1d100]]}} {{theroll=$[[1]]}}
{{starget=@{strength}}}'> theroll is now what I need but now, roll1 gives text NOT
a value. So, I tried using MathOps (and the associated Zeroframe)
API scripts changing the button to <button
class='old-roll' type='roll' name='roll_testattack' value='! &{template:chill} {{name=Strength
Attribute Check}} {{character=@{charactername}}}
{{roll1=[[@{strength}]]-[[1d100]]}} {{theroll=$[[1]]}} {{theresult={& math
$[[0]]-$[[1]]}}} {{starget=@{strength}}} {&simple}'> Which gives a blank “theresult” – I have tried moving the
! adding the \ “delayer” and moving the brackets around, all to no avail L - I either get text or
nothing. I then tried !The result of 2+2 is {&math 2+2} in the
chat window and got nothing at all! Is there something wrong with the API script or am I
missing something? All this is occurring in the sandbox P.S. Sorry for the long post :(