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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Any Advice for Workflow When Designing Character Sheets?

1525666497

Edited 1525666578
I'm hoping for some advice on shortening my workflow cycle when testing new sheetworker code while designing character sheets. I'm a big fan of Visual Studio, so that's what I use. Unfortunately, Visual Studio doesn't recognize (or I don't know how to make it recognize) the <script type="text/worker"> HTML tag as introducing Javascript, resulting in it being treated as plaintext: So, I'm forced to edit my Javascript code in a separate .js file, and whenever I want to test it, I have to: Ctrl-A, Ctrl-C the Javascript code from the .js file Drag-select the "plaintext" code in the .html file proper (such a pain, honestly) Ctrl-V the new code in Ctrl-A, Ctrl-C the updated .html file Switch to my browser and the Campaign Settings tab Ctrl-A, Ctrl-V the new html code into the HTML tab of the character sheet Save Settings Wait for the settings to save Switch over to the API sandbox (i.e. the "Launch Game" window, in a separate tab) Reload it Wait for it to reload Open up a test character Select the character's sheet Test my changes I know, the above doesn't look like much. But having to do it a dozen times (or more) each hour is agonizingly tedious (particularly steps 2, 8 and 11). I would very much appreciate hearing any suggestions to smooth out my workflow; it will save me a little bit of time but an immense amount of energy! Very much appreciate your insights!
1525667237

Edited 1525667267
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Personally, I just code in the game settings page because I can't test the code outside of Roll20 anyways. My workflow looks like this: Write code Save Settings Wait for the settings to save Switch over to the API sandbox (i.e. the "Launch Game" window, in a separate tab) <--- I'm assuming here that you mean the VTT proper, not the API scripts page. Reload it Wait for it to reload Open up a test character Select the character's sheet Test my changes
That... makes a great deal of sense, lol.  Never occurred to me to write the code directly into the web UI, I guess I've always assumed the importance of having a local copy... but yeah, that'll shave a nice bit of time off.  Thank you!
1525671534
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Np. I do save a copy of my most recent stable code in a github repo (aside from the roll20 repo) to make sure that I have a backup in case my game gets borked, roll20 collapses, etc.
1525671754
GiGs
Pro
Sheet Author
API Scripter
I tend to write the first pass in visual studio code, especially the bulk of the html. But once I'm ready to test it, I do must of the editing in roll20, because of the need to regularly (and tediously) reload the campaign to find bugs between edits. I'd love some way for visual studio to recognise javascript within html. Maybe there's a plugin for that?
1525674776

Edited 1525674831
Jakob
Sheet Author
API Scripter
My "HTML" code is written in pug, so I just have an include command for a sheetworkers.js file + a build script to construct the sheet.html. So no need to select + replace the Javascript code, though I still have to copy stuff into the game settings page. I would never edit directly within the game settings, that would mean I'd have to write HTML directly *shudder*.
1525675799
GiGs
Pro
Sheet Author
API Scripter
Ryan, I just discovered while working in VS Code, that if you start a script block with  <script type="text/javascript">  instead of  <script type="text/worker">  it works properly. You just need to remember to change it back to worker when transferring it to roll20.
1525701906
vÍnce
Pro
Sheet Author
G G said: Ryan, I just discovered while working in VS Code, that if you start a script block with  <script type="text/javascript">  instead of  <script type="text/worker">  it works properly. You just need to remember to change it back to worker when transferring it to roll20. That's handy.