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

Need help coding my first dynamic character sheet

Here it is &nbsp; <a href="https://codepen.io/Dayminkaynin/pen/XWmyEmR" rel="nofollow">https://codepen.io/Dayminkaynin/pen/XWmyEmR</a> The stats on the left are to be added to the skill ranks on the right. So far I have sight as a skill and need the ranks from it to be added to the Soul stat and that number to be in the box to the far right of the Sight skill row. This is the code I have in HTML &lt;td&gt;Perseption:&lt;/td&gt; &lt;td&gt;Sight:&lt;/td&gt; &lt;td&gt;&lt;input type="number" id="SightRanks" &gt;&lt;/td&gt; &lt;td&gt;&lt;input type="number" id="Sight" onchange="updateskills"();"&gt;&lt;/td&gt; This is the code in JS. var Soul = parseInt(document.getElementById("Soul").value); function updateskills() { // adds ranks to stats for skill scores var Soul = document.getElementById("Soul").value; var Sightranks = document.getElementById("Sightranks").value; document.getElementById("Sight").value = ((Soul + Sightranks); Any help. Thanks.
1589856214
GiGs
Pro
Sheet Author
API Scripter
You cant use&nbsp;getElementById on roll20, or any javascript except for the sheet worker system. Also do your character sheet testing in roll20, not external sites. Roll20 has some differences from making websites elsewhere, and you need ti test on roll20 when building a sheet. We have the sandbox feature now, which allows you to do the coding outside of roll20 and load it into roll20 in a flash. Finally, if you are planning to release the sheet for public use in roll20, dont use tables for layout, such sheets will not be accepted. Read this page:&nbsp; <a href="https://wiki.roll20.net/Building_Character_Sheets" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets</a>
I got the custom sheet sandbox but some how you have to upload the text into roll20. I don't see any way to edit in roll20.
1590025686
Finderski
Pro
Sheet Author
Compendium Curator
While in the sandbox you just click the HTML, CSS, and Translation buttons and navigate to your files. It'll load those to the sandbox. Once your sheet is good to go and ready to use in your game, in your new game under Game Settings select Custom Sheet, then copy/paste the text from each of those three files into the appropriate tab in the custom character sheet forms.
1590034226
GiGs
Pro
Sheet Author
API Scripter
To add to Finderski's comment, the big advantage of the sandbox is that you write your html and css in files outside of roll20, where you can take advantage of programmer friendly text editors like CS Code or Sublime Text. These give a lot of help for writing code to avoid syntax errors, and you can even use your files directly from your github folder.&nbsp; So you edit the files in place, use the HTML and CSS buttons to load them into the snadbox, and it works pretty near-instantly, so you can have a character sheet open, do some editing on the files, update them and see the character sheet immediately update with the changes. It makes editing sheets so much better.
Do I save the text to a pages file, and then upload that? I have code pen now. Can I copy that stuff to CS code or Sublime? Seems like a lot of making it then uploading it. Be nice to edit it right inside of Roll20.
1590109387
Kraynic
Pro
Sheet Author
Then just create a game, set the character sheet to "custom", and then write your code in the sheet editor on the game settings page.&nbsp; If you go that route, you should have the game open in another tab so you can save in the editor and then refresh the game tab to see the changes to the sheet live.
1590112028
Finderski
Pro
Sheet Author
Compendium Curator
To add onto what Kraynic mentioned...you don't want to trust the code preview tab in that route, because it's notoriously buggy, which is why it's recommended to the game open in a separate tab/window so you can refresh after saving your code.
Oh you mean before i launch the game? And then launch the game. I did it but i got this error. It wont let me launch the game.
1590169343
GiGs
Pro
Sheet Author
API Scripter
Are you using the custom sheet sandbox? If so, delete everything you've put in the Sheet.Json Editor &nbsp;. You dont need anything there while testing your sheet. If you aren't using a sandbox, i dont see how you'd get that message - you'll need to ocntact roll20 to fix it: <a href="mailto:team@roll20.net" rel="nofollow">team@roll20.net</a>.
Yes. The sand box. I’ll take it out.&nbsp;