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 .
×
Create a free account

[Script] PublicSheet — public read-only versions of character sheets

1521912020

Edited 1526840430
Jakob
Sheet Author
API Scripter
Sales voice:  Do you think it's annoying that you cannot give players read-only access to character sheets? So do I! This is a script to help out with that problem. It will create (for characters of your choice) public copies of the sheets that mirror the private ones. A non-GM player will only see one version (either the public one, or the private one, if they control the character). Any changes on the private sheets will be propagated to the public ones, while any changes to the public sheets will be reversed. Usage:  enter "!publicsheet" in chat. The rest should be self-explanatory. Code:  Github . Config options By default, the public version of a character will be named "(Public) NAME ", but you can adjust that by entering "!publicsheet config publicname X " in chat, where X is the new naming convention. All-caps NAME in X is replaced by the character name. Enter "!publicsheet config unsynced LIST" to define a list of non-synchronized attributes (for tabs and such). LIST should be a comma-separated list of attribute names that will be ignored by the script. "!publicsheet config onlyshowcontrolled [on|off]" will either show, or not show, NPCs in the default query for adding characters (probably makes it easier to handle for huge games).
1521912687
The Aaron
Pro
API Scripter
Neato!
1521913026
vÍnce
Pro
Sheet Author
API scripting to the rescue.   Awesome Jakob.
1521926647
Kirsty
Pro
Sheet Author
Very cool, Jakob!
1522068241
Jakob
Sheet Author
API Scripter
I've seen some weird errors about the maximum call stack size being exceeded, but I can't really track them down reliably and they don't seem to appear too often, so I think it basically works. Will be submitting it to One-click.
1522075786
GiGs
Pro
Sheet Author
API Scripter
Great idea! It's just silly that we still dont have the ability to view other player's character sheets, now that the feature has become so central to roll20's business model.
1522079839
Jakob
Sheet Author
API Scripter
G G said: Great idea! It's just silly that we still dont have the ability to view other player's character sheets, now that the feature has become so central to roll20's business model. Very silly. It'd also be much more resource-friendly to implement from their side, I have no idea why this hasn't been done yet (probably some hacky legacy code being in the way).
1522087759
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Is there a suggestion for this anywhere in the suggestion forum?
1522092381
GiGs
Pro
Sheet Author
API Scripter
This seems to work - with a bit of a snag. If the character sheet has tabs or other visibility options based on an attribute, you are stuck with those options on the public sheet. For example, if you have a Skills tab, a Stats tab, and a Spells tab, and the private sheet is showing Skills, the public one wont change off Skills. So it would be a good idea to allow for a list of attributes that are allowed to change. This makes the script less user friendly, but scripters should be able to figure it out. A couple more suggestions: Sort the list of characters before adding them to the dropdown list. Finding a specific character is a pain with a lot of characters. Include a config option to limit list of characters to those with a controlledby value, so that the list is prefiltered (if the GM wanted to show some NPCs, they could add themselves as controller to NPcs to ensure they pop up - or not use this config option).  
1522095808
Jakob
Sheet Author
API Scripter
Thanks for the suggestions G G, those are all pretty easy to implement, I'll definitely add that.
1522096069
GiGs
Pro
Sheet Author
API Scripter
Great! I'm looking forward to using this script, I've really wanted my players to be able to see each others characters.
1522099148

Edited 1522101808
Dana Lexa
Sheet Author
It has been  suggested a  few times  before . I'd really like it to be implemented for real as well, while this is a cool script I already know it would interfere with another script I wrote myself that monitors changes in certain fields and might behave unexpectedly if there are duplicates being changed repeatedly.
1522099649
GiGs
Pro
Sheet Author
API Scripter
You have a duplicate link there, Author X. maybe you meant to include this one,  the most upvated version .
1522100299
Jakob
Sheet Author
API Scripter
I've updated to v1.1, which includes all suggestions.
1522100409
Jakob
Sheet Author
API Scripter
Author X said: It has been  suggested a  few times  before . I'd really like it to be implemented for real as well, while this is a cool script I already know it would interfere with another script I wrote myself that monitors changes in certain fields and might behave unexpectedly if there are duplicates being changed repeatedly. You could tell the other script to ignore certain characters! Object.values(state.PublicSheet.data) is an array containing the ids for all "duplicate" characters.
1522101152
GiGs
Pro
Sheet Author
API Scripter
It works perfectly. Thanks!
1522101369
GiGs
Pro
Sheet Author
API Scripter
If you change the display name from "(Public)" the sheets already created dont get their names updated. Manually recreating them isnt hard, but it would be smoother if the script changed their names.
1522101637
GiGs
Pro
Sheet Author
API Scripter
Also it seems if you do change the display name, any character sheets created after that just use the term as the full label. I changed Public to DISPLAY, and created 3 characters, and all were called excatly "DISPLAY" (no character name) I then changed it Display (sentence case) and got three characters named "Display" (again no character name). Is there a way to reset the state? Because I cant create identifiable characters now.
If I understand this correctly: All-caps NAME in X is replaced by the character name. You need to set the pattern to "DISPLAY NAME" to get "DISPLAY Actual Name"
1522102079
GiGs
Pro
Sheet Author
API Scripter
Aha, you're right. I didn't understand those instructions. It's working now. Thanks :)
1522102997

Edited 1522103046
GiGs
Pro
Sheet Author
API Scripter
It looks like the whitelist of attributes (those that are allowed to change) isn't being saved. Once I restarted the sandbox, they were being ignored. I logged the state, and I don't see a reference for anything that would store those attributes. Also the onlyshowcontrolled might not be being saved. If I set it on, it works. Then if I restart the sandbox, it stops working. This is what the log looks like after a restarted sandbox, after I created an attribute whitelist, and set onlyshowcontrolled on.  "-=> PublicSheet v1.1 <=-" {"PublicSheet":{"data":{"-KcnSFWQ5CR0ICv2a8z6":"-L8ZLUkYVvLgsDnFA7VL","-KcnSDsYrk62ND-ZewDp":"-L8ZMIychFFZXtRlsBoK", "-L7oS41kIKs0m0lRAOD8":"-L8ZMKO6RajrPeLyzUki"},"globalconfigCache":{"lastsaved":0},"lastVersion":"1.0", "namePattern":"DISPLAY NAME","unsynced":[],"onlyShowControlled":false}} (line breaks added for readability)
1522103910
GiGs
Pro
Sheet Author
API Scripter
Another suggestion: set the public copies to be controlled by all automatically, or make that a config option.
1522104201

Edited 1522104480
Jakob
Sheet Author
API Scripter
Oh! I messed up the version upgrade code. It would work for a new install, but always reset these two for one upgraded from 1.0. Fixed now.
1522104792

Edited 1522115240
GiGs
Pro
Sheet Author
API Scripter
It looks like its fixed. yay :) Did you see my final suggestion, about making the new sheets automatically controlled by all? Edit:  Never mind, i see it does already. that's what I get for testing it out on a test campaign with no players.
1522591097
Jakob
Sheet Author
API Scripter
G G said: It looks like its fixed. yay :) Did you see my final suggestion, about making the new sheets automatically controlled by all? Edit:  Never mind, i see it does already. that's what I get for testing it out on a test campaign with no players. It actually does something a bit more complicated, in that it will make sure that a public sheet is visible to & controlled only by those who cannot control the private sheet. But there's an (undocumented, oops, but will be on the one-click) option that switches the public sheet to be visible and controlled by everyone instead.
1522622159
GiGs
Pro
Sheet Author
API Scripter
I noticed that after posting. It is neater. It did occur to me it could be an issue if, say, you start off with some players, then create the public sheets, then add some new players to your group. But it's pretty effortless to delete the sheets and recreate them with new owners. That said, i do like that there's an ALL option.
1526839678
GiGs
Pro
Sheet Author
API Scripter
My players have been getting great use out of this script. I just noticed a minor issue with this and other scripts. I use a couple of scripts to update character sheets in play (like marking wounds, and experience checks, and unchecking them). Since these stats are being altered by scripts, there aren't triggering events, which means the public sheet gradually gets out of sync (unless you manually enter something in the altered stats to update them). Does the script have a "refresh/force update/resync" function, and if not, could one be added?
1526880739
Jakob
Sheet Author
API Scripter
I don't think there's a "force update all" function, but in the menu that appears when you enter !publicsheet, there are "Force Sync" buttons for every character.
1526891355

Edited 1526891392
GiGs
Pro
Sheet Author
API Scripter
Well, now I feel silly! That worked :) Suggestion: a whispered chat message when you force sync, to let you know it did something. I do love this script. Thanks again for creating it.