
Quick context
I'm a player in a D&D 3.5e campaign, and I'm working on a bespoke Google Sheet for my character. I've done stats. Now I'm working on combat actions (rolls). For every available action I want to generate a Roll20 macro inside the sheet that I can just copy/paste into chat.
Motivation (feel free to skip)
Some of those actions have a number of 'stages'. Like for a trip attack with the Improved Trip feat, the stages are as follows:
- Roll an attack against AC;
- On success, roll a contested strength check for tripping the opponent;
- On success, roll another attack against AC;
- On success, roll for damage.
The Problem
I'd like to reveal those combat stages gradually by pressing a button to move onto the next stage each time. I believe this should be possible if only I can figure out which HTML entities to replace, right? :-) That's where I'm stuck.
I've decided to start with a simple example, just to understand what's going on here.
The following roll template works fine. It creates a button which, when clicked, rolls a d20.
&{template:DnD35StdRoll} {{name=Eldric Stormwind}} {{notes=[Button](! /r 1d20)}}
Now the following roll template doesn't work. It's supposed to show a button which pops up a second roll template with its own button, which rolls a d20.
&{template:DnD35StdRoll} {{name=Eldric Stormwind}} {{notes=[Button 1](! &{template:DnD35StdRoll} {{name=Eldric Stormwind }} {{notes=[Button 2](!
/r 1d20 ) }} ) }}
It doesn't even render the first button properly. And I tried a number of variations. I can't figure it out.
In principle I'm not afraid of many recursive levels of HTML entity replacement, because Google Sheets allows me to write some Javascript code to automate that stuff. The problem is, I don't even understand in principle what I'm doing wrong.
Help!
Thanks in advance! :-)