ESSENTIAL Sheet Worker RULE

This is not a guideline. It is not a suggestion. It is a rule that you must ALWAYS carry out.

This is one piece of advice I have given that a surprising number of people are ignorant about, and that I sometimes get pushback on because of that ignorance which is exarcerbates by the way roll20 works. But it’s not a frivolous suggestion, it’s a requirement. If you don’t do this, you will regret it. If not now, later.

I’ve given a lot of Roll20 help over the years. Seriously, do a search on the Roll20 forums and wiki using my name (GiGs) and you probably won’t find anyone who has been more active. When it comes to character sheets, I know what I’m talking about.

There are people I’d defer to, but they are very few in number. So when I say, this is something you really must listen to, you really must listen.

Okay, what am I talking about?

Attributes on the Event Line MUST be in Lower-case

I really can’t emphasise this enough.

Let’s say create an attubute called StReNgTh. In HTML that might look like:

<input type="number" name="attr_StReNgTh" value="10">Code language: HTML, XML (xml)

When you watch that attribute for changes, always, always start the sheet worker like this:

on('change:strength',Code language: JavaScript (javascript)

Notice the attribute name in the HTML has upper case letters, but in the sheet worker it does not.

Roll20 has a funny relationship with attribute case, which could be discussed in another post, but for this post this is something you must do, always.

What Happens If You Ignore This RULE?

Roll20 has a weird glitch. Sometimes sheet workers will work if you use upper case letters. This is not reliable. But then, one day the sheet worker abruptly changes, and stops recognising upper case letters.

You recieve no warning about this. It just happens. So a sheet worker that has been working for days, months, even years suddenly stop working. And you have no idea why, and no indication what the issue is.

If you put some kind of check in the sheet worker (console.log is handy here), you’ll find that sheet worker is not being triggered, and may scratch your head wondering why.

This can be very frustrating. The fact that it can work for some time then suddenly stop encourages people to think or to argue that the problem must be something else. Don’t fall into that trap – just make sure that attributes on the event line are always in lower case. You will never have this issue.

Why Do People Not Do This?

It is mentioned in the the official documentation of sheet workers, but is not really given the importance it deserves. The documentation says this:

Note: All attribute names are lowercased in events. So even if you normally refer to an attribute as “Strength”, use “change:strength” in the event listener.

And that’s it. No explanation. No help for people who use upper case letters and everything seems to be working (for now). So people skip over it and don’t really pay attention, because it’s something they read that just isn’t rue. Their sheet workers work, after all.

I’ve seen this error occur many times, and a lot of people are just unaware of it, and when told about it, they often don’t appreciate just how important it is. After all, they use upper case letters and their workers are still working, so it can’t really be a problem. Can it?

Yes. yes, it can. Every time you use upper case letters in the event line it is a ticking time bomb. You won’t know when it will go off, and when it doesn’t, you have probably forgotten that this might be an issue so you don’t immediately think about it. You waste hours or days trying to find the issue, when the solution is simple – if you know it.

Final Comment

I really can’t over-emphasise the importance of this:

Attributes on the Event Line MUST be in Lower-case

Just do it. It’s very simple, and you never need think about it again.

Leave a Reply

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