Rolltemplate Gotchas

In this post, we’ll look at all the little things that don’t deserve a full post. Thanks which can trip you up if you don’t know about them, and which might not be immediately obvious.

Keys and Values

Rolltemplates are made up of keys and values. The key is the left side of the =, and the value is the right side. When you type {{key}} in a rolltemplate, it shows the value. So, the key is a variable.

Anything you want to use in a rolltemplate must be a value with a defined key. If you have keys spelled exactly the same, the second one overwrites the first. keys must be unique.

The case of keys matters: {{Key= and {{key= are different keys. Likewise any spacing is part of the key, so {{ key= or {{key = are also different keys. Be careful!

You can have an empty key. For example sometimes a key is absent, and optional keys (those using {{#ke}} will properly treat as if it is absent. But you have {{key=}} the value is empty, but still exists, so {{#key}} will act as if the key does exist.

It’s common to set up a rolltemplate in 2 columns. The key-value lends itself naturally to having a title followed by a value. But you don’t need to do this.

As described earlier, you can have required keys, optional keys, and use allprops to account for keys not hardcoded into the rolltemplate. You should be careful about required keys = remember that they must always be included.

Logic Helpers

A common mistake (and one I often make) is to forget the () in the namers. So {{#rollGreater is bad, and {{#rollGreater() is good.

In roll20 dice, > means greater than or equal to, and < means less than or equal to. This is unusual behaviour. The Logic Helpers abserve normal mathemtical rules: rollGreater() does mean greater, and not equal to. The rollBetween() helper is an exception – it does include the lower and upper bound.

Bits & Bobs

  • A linebreak breaks the rolltemplate. The whole rolltempale must be on a single line.
  • As described earlier, Rollable Tables might not give desired results in a a rolltemplae. They show only the item entry, and not any image.
  • Many older rolltables use HTML tables gfor layout. You should avoid that.

Conclusion

In he next post, we’ll look at tweaking existing rolltemplaters, like the default rolltemplate. That will bring us to the end of this series on rolltemplates. I hope you find this useful.

Series Navigation<< Special Styles for RolltemplatesCustomizing the Default rolltemplate >>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.