Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Custom Roll Parsing

From Roll20 Wiki

Revision as of 15:08, 20 September 2021 by Andreas J. (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main Article: Building Character Sheets


Custom Roll Parsing (CRP) is a new capability for character sheets can now combine the functionality of roll buttons and action buttons to allow for a new custom roll parsing. It was release July 13th, 2021.


Parts

Currently you can only display computed values in the first 10 fields that are sent in the macro.


Example:

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

Forum threads

See Also