- Guide to CSS – Styling a Character Sheet
- HTML – The Building Blocks
- Guide to the Guide
- Sheet Workers – Automating The Sheet
This page lists all posts for reading, using, and creating Sheet Workers on Roll20. Sheet workers are the way you build complex automation in a sheet (like calculating stat modifiers when stat changes).
All sheet workers are written in JavaScript. There are plenty of guides for JS on the web, but this guide is focused on the specific needs and gotchas related to Roll20 character sheets.
Core Sheet Worker Posts
There are often different ways to do the same thing in JavaScript – this series will focus on one approach for simplicity and ease of teaching. The Function Library post describes more general approaches (or maybe there’ll be a separate post added to illustrate the possible variety here).
- Anatomy of a Sheet WorkerHow to write a sheet worker, and what most sheet workers have in common.
- Variables – How to Name ThingsA guide to naming things in sheet workers.
- Arithmetic in Sheet WorkersAdding, subtracting, and other arithmetic.
- What If? in Sheet WorkersHow to analyse your code and manage code branching.
- Arrays and DropdownsCreate and use Arrays, which are extremely important.
- JavaScript ObjectsThe curious connection between getAttrs, setAttrs, and custom databases – JavaScript Object!
- Getting Loopy With JavaScriptIf you want to do the same thing over and over, you need a loop.
- Strings in Sheet WorkersIntroducing Strings, what they are and how to use them.
- Logging in the Browser ConsoleHow to use the browser console, and control what appears there.
- Strings, Arrays, and LoopsAn example of using different techniques to solve a problem – Strings, Loops, and Arrays.
- Undefined and Other Error ValuesAbout undefined and similar “unvariables”. Avoid them when you can.
- Asynchronicity and Things to Avoid With LoopsWhat does Asynchronicity mean and how does it affect you?
- Events, and watching AttributesWhen you click a button or change an attribute, here’s what happens.
- Changes and the eventInfo ObjectWhat is the eventInfo object, and what is it good for. Find out here.
- Action ButtonsAction Buttons are another way to launch sheet workers. Click the button to toggle buffs, show or hide tabs, and more.
- setAttrs and Saving AttributesSaving attributes isn’t always simple! more about that here.
- A Sheet Worker RepriseA quick overview of rules to follow and pitfalls to avoid
- Castle Falkenstein Design – Sheet WorkersThe last in a series of character sheet examples.
Other Posts
In time, I’ll add more sheet worker posts that aren’t a core part of the series. They’ll be indexed here.
- The Ternary Operator – The One-Line IfMy favourite feature of JavaScript is just as useful in Roll20.
- Template LiteralsWhat is a template literal? There are three types of quotation mark???
- Functions and the Fat ArrowWhat are functions? What is the fat arrow syntax? How they make code easier to write.
- Function LibraryReusing code saves a lot of typing and avoids typos. Here’s how to do it.
- The Perils of Sheet Worker FunctionsMany character sheets have functions. Here are the downsides.
- The Script Block and Identifying CharactersWhy are sheet workers built the way they are?
- My Sheet Worker Isn’t WorkingAn example of examining broken code to fix it, to show what a sheet worker needs.
- The ESSENTIAL Sheet Worker RULEThe biggest mistake Sheet Worker writers make…
- The Roll20 Sheet for Legends Never Die!Learn about the Roll20 sheet for Legends Never Die
- Action Buttons and the MacroBarYou can’t drag action buttons to the quick macro bar. Now you can!
- Everything About Numbers In A Sheet WorkerNumbers are sometimes more complicated than they appear.