Hello again, I'm approaching a critical part of my cutsom sheet dev, cutsom roll parsing for my game logic. After reading the wiki about custom rolls and messing around in the sandbox I cannot get a grip of some logic in the flow of the function, so taking the main example from the wiki: <button type="action" name="act_test">Click me</button>
<rolltemplate class="sheet-rolltemplate-test">
<div class="sheet-template-container">
<h1>{{name}}</h1>
<div class="sheet-results">
<h4>Result = {{roll1}}</h4>
<h4>Custom Result = {{computed::roll1}}</h4>
</div>
</div>
</rolltemplate>
<script type="text/worker">
on('clicked:test', (info) => {
startRoll("&{template:test} {{name=Test}} {{roll1=[[1d20]]}}", (results) => {
const total = results.results.roll1.result
const computed = total % 4;
finishRoll(
results.rollId,
{
roll1: computed
}
);
});
});
</script> I want to understand the logic behind thie finishRoll function 2nd argument and it's relation in the roll template HTML. Let's start with statement from the wiki, it says: To use the custom computed results in your roll templates, replace the roll names in the template with computed::< rollname > Okay clear, then in the example I see that in the finishRoll function the JS object property passed has : roll1:computed Now I'm assuming that the function takes a JS object which keys are: finishRoll(rollID, {
rollname: value,...
}); Where the rollname key is one of the rollname i choose to use after the computed string in the html. But when I go to modify the rollname with one different from roll1 it does not work anymore, in the sense that I get no result in the final HTML. So the rollaname is tied to any property name I used before in the HTML template? If this is the case then I did not notice where it's written in the wiki. Thanks for the attention; and let me say that I'm having a blast working with this sheet codes, the amount of work behind all this is monumental, kudos to the devs at roll20 and to all the peapole who wrote the wiki and help here on the forum, you guys rock.