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

Live PC Dashboard / Landing Page

BLUF : A script to update text, tokens, and other content based on character attributes. This allows for a PC "dashboard" on any page and/or a live landing page. Problem We're playing Torchbearer and not using tactical features (i.e. moving minis around a grid) of Roll20. However it's helpful to have a list of character Beliefs, Goals, and Conditions at the top of the adventure map. This allows the players to collaborate in working towards Beliefs and Goals and to monitor and manage their conditions. It also helps me ensure I'm challenging their Beliefs and Goals during the session. I initially planned on managing the dashboard manually, updating text fields and condition tokens (GMLayer &lt;-&gt; ObjectLayer) through the UI. However Torchbearer places a lot of emphasis on player master of the rules and I was concerned about micro-managing their character content. Plus, that's a lot of extra work on top of running the game. I searched for an existing script that would update arbitrary page content based on arbitrary fields on the character sheet, but didn't find anything. Solution I hacked together (in the quick and dirty sense of the word) a script that monitors changes on the character sheet. When it gets a change event, it attempts to match a corresponding text field or token and update it accordingly. Key Techniques Set font family to unknown value to get mono-spaced width (Thank you&nbsp; Stephen S.) Create text field with ControlledBy corresponding to each player (done manually during initial development&nbsp;, will likely create a simple script to generate these as-needed) Use "B:" and "G:" as standard starting text for Belief and Goal text fields, respectively. Combined with the previous bullet, this allows the script to only update the appropriate Belief or Goal text field for the character that was updated. Bonus is that it will do so across all pages, so this is re-usable from page to page. Lots of trial and error on text field positioning. "Left" and "Width" properties don't function as expected (good thread on this in the forums), BUT, by calculating the approximate width of the field, I can keep it mostly left aligned. I used 3.2 * length + offset as my formula. It mostly works. Tokens were much easier to code up as they get a condition name (e.g. "angry") and are easy to change the "ControlledBy" manually when initially placing on the dashboard. The script simply moves them between GMLayer and ObjectLayer to indicate if the character has the condition or not. Wish List More robust support for text fields would be awesome (precise control over size and position, ability to modify "ControlledBy" from R20 UI) Still Researching Does the Handout object allow text formatting via API? If yes, I might duplicate the dashboard in a Handout so that players can pop it out and keep it on a 2nd screen if they want. But, this would require ability to set Handout text to include table layout for readability. I've seen the "decode" functionality for Handout text, but no corresponding "encode". Or am I overthinking and it's just markdown or something? Up Next Build one of those swanky landing pages that all the kids are using. Leverage this script to make various parts of the page reflect live content from our game (e.g. Character Belief, Goal, Conditions, other stuff?). Visuals The dashboard (not all fields are currently wired up - conditions for first field and all of third field were live here) Character sheet conditions: Character sheet Belief and Goal: Script I created a public Gist to share my script. First time doing this, so let me know if I botched something. <a href="https://gist.github.com/ebrandeis/6a320eee3461bf62ac55b190563728d6" rel="nofollow">https://gist.github.com/ebrandeis/6a320eee3461bf62ac55b190563728d6</a>
1589816166
The Aaron
Roll20 Production Team
API Scripter
Nice work!&nbsp; Something to be aware of is that scripts making changes will not trigger change:attribute &nbsp;events.&nbsp; There are ways around that, and most popular scripts for changing those things (TokenMod, ChatSetAttr) support a way of handling it.&nbsp; I can point you toward supporting them in your script tonight.
Thank you! Also, thank you for all the groundwork you've done in script development!
1589825686
Gold
Forum Champion
Love it. Would like to have something like this in my game(s), only trouble is all the set-up.