Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
A third party outage is causing loading issues for a select number of games. Reach out to our Help Center if you're affected!
Create a free account

Custom Sheets "GM Only" Fields, we've all wanted them, they don't exist, here's a work around. [Tutorial]

A little background info (skip to the "----" to get right into the tutorial) : So in a custom game I've been playing and helping out with the development of, there came a need for GM only stat modification. One particular type of entity in the game was able to directly and permanently sap a stat of it's target to gain points to use toward its-own abilities, GM only fields as you know do not exist but we didn't want players to be able to modify this field at all. In the next season we are removing as many possible ways for a player to mess up their character sheet and allowing a LOT more of the races in the universe to be accessible to the players. In the previous season we had 5 races available, and had each one hard-coded into the sheet, however the universe itself has currently 56 known races (there used to be over 200, this game has been running pen-and-paper for over 30 years on the same time-line. A lot of war and genocide has reduced the number significantly.) To open the universe up to the players on roll20 we used the GM only field I designed to be able to add people's racial abilities, racial base stats, and other things that cannot change after character creation (maximum potential in their respective school of "magic" for instance) So here's what one part of the character sheet looks like normally, what the players always see: and here's the GM fields: There are others on other tabs but let's get into the tutorial -------------------------------------------------------------------------------- First you'll need a checkbox. Do not give it a name like attr_gmwhatever otherwise when you check or uncheck it, it will save and players will be able to see the fields, and give it an accesskey (in this example 'k' <input type=checkbox class="sheet-gmCheck" accesskey='k' value="1"> don't set it to display:none; as if you do, the accesskey will not work, instead set it to position:absolute, and z-index: -9999; so it falls behind even the background .charsheet .sheet-gmCheck {     position: absolute fixed;     left: 250px;     top: 110px;     height: 1px;     width: 1px;     opacity: 0;     z-index: -99999; } Feel free to change left and top to make sure it falls behind something else like a logo if you don't have a background image to block the mouse. Next add a class such as "sheet-GmOnly" to all fields that should not be seen by players, these SHOULD have attr_ names, as they do need to save, then set up a little CSS Selector for when gmCheck is checked to make it fade in and out (opacity is used for fading, if you don't want the fanciness just stick with the visible tag): .charsheet div.sheet-gmOnly {     visibility: hidden;     opacity: 0;     max-height:0;     overflow: hidden;     margin-left: 20px; } .charsheet .sheet-gmCheck:checked ~ .sheet-gmOnly {     visibility: visible;     opacity: 1;     transition: opacity 0.5s linear 0s;     overflow: auto;    } and bing, bang, boom you have "GM Only" Fields as long as your players don't have a reason to hit alt+k (or whatever your accesskey is) Bad part: if players looking to cheat know html and FIND the gm check (which may be reason enough to give your classes more obfuscated names) they will be able to hit alt+k just like you can to get them to appear for them, so if you suspect a player be sure to check those fields! Enjoy your more control over sheets! -Nodvick
1551271380

Edited 1551271467
GiGs
Pro
Sheet Author
API Scripter
That's very interesting. Even if I never do anything like that, you just exposed me to the accesskey function which I can see being very handy. i like the idea of being able to use that to bring up configuration screens, or conditional views - even ones players do have access to.
oh I should note, in firefox it's shift+alt+accesskey it's alt+key in chrome*