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

Help with Character with HTML Character Sheet building

Can Someone please help me with fixing some problems in the Character-Sheet. Some functions doesn't work and I don't know how I build a tab (I'm no programmer). Best would be, if we can talk in Teamspeak. Please send me a message if someone has the time. My native language is german.
1587902532
Andreas J.
Forum Champion
Sheet Author
Translator
The wiki have examples how to make tabs: <a href="https://wiki.roll20.net/CSS_Wizardry#Tabs" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Tabs</a>
Found the mistake with the tab, but the other problems still there.
1587908326
GiGs
Pro
Sheet Author
API Scripter
People cant help you unless you post the parts of the code that aren't working, and telling us how its supposed to work.
Sorry I totally forgot.&nbsp; the first issue is the calculation of the attributes don't work I took it from the original sheet&nbsp; <a href="https://github.com/Roll20/roll20-character-sheets/tree/master/Mongoose_Traveller2e" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/tree/master/Mongoose_Traveller2e</a> The second issue is one button don't work&nbsp; Even if I don't change anything it doesn't work, both of them. For the last, I want to make my I own tab and need some help to create it. I want it look like that I hope someone can help me.
I think the mistake is around here, that the calculation isn't working but I don't know how to fix it Can someone please help
Has anybody an idea? Nobody who can help?
1588638214
GiGs
Pro
Sheet Author
API Scripter
It would be easier to respond if you posted code snippets in text, not screenshots. For your first pair of screenshots, I'm not seeing any reason they wouldnt work. I'd write them differently, but the version you have looks like it should work. But I cant test it since its a screenshot. It's also complete - the second worker in the screenshot doesnt show how it ends. The second question, the pic with all the screenshots: you say a button doesnt work, but dont explain what you man by that. There are no buttons there. Is something supposed to happen when you click a checkbox? If so, what?&nbsp; Regarding your tabs - I cant help you there. You'd need to print up some prototype html and CSS for that section, then we could point out what needs to be done.
1588686484

Edited 1588686642
The only problem now is with the calculation. The other doesn't matter right now. So I thought that too, it should work but I don't know why. Like posted it starts like this &lt; script &nbsp; type = "text/worker" &gt; //&nbsp;Humanity&nbsp;Loss /*&nbsp;----&nbsp;BEGIN:&nbsp;TheAaronSheet.js&nbsp;----&nbsp;*/ //&nbsp;Github:&nbsp;&nbsp;&nbsp; <a href="https://github.com/shdwjk/TheAaronSheet/blob/master/TheAaronSheet.js" rel="nofollow">https://github.com/shdwjk/TheAaronSheet/blob/master/TheAaronSheet.js</a> //&nbsp;By:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;Aaron,&nbsp;Arcane&nbsp;Scriptomancer //&nbsp;Kontakt:&nbsp;&nbsp; <a href="https://app.roll20.net/users/104025/the-aaron" rel="nofollow">https://app.roll20.net/users/104025/the-aaron</a> var&nbsp;TAS&nbsp;=&nbsp;TAS&nbsp;||&nbsp;(function(){ &nbsp;&nbsp;&nbsp;&nbsp;'use&nbsp;strict'; &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;version&nbsp;=&nbsp;'0.2.3', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastUpdate&nbsp;=&nbsp;1457098056, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loggingSettings&nbsp;=&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug:&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'debug', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title:&nbsp;&nbsp;&nbsp;'DEBUG', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color:&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgLabel:&nbsp;'#7732A2', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label:&nbsp;&nbsp;&nbsp;'#F2EF40', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bgText:&nbsp;&nbsp;'#FFFEB7', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text:&nbsp;&nbsp;&nbsp;&nbsp;'#7732A2' the Calculation looks like this &nbsp;&nbsp;&nbsp;&nbsp;//Stärke on("change:calc-Stärke&nbsp;sheet:opened",&nbsp;function()&nbsp;{ &nbsp;getAttrs(['calc-Stärke'],&nbsp;function(value)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(value['calc-Stärke']&nbsp;&lt;=&nbsp;0)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mod-Stärke':&nbsp;-3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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if&nbsp;(value['calc-Stärke']&nbsp;==&nbsp;14)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mod-Stärke':&nbsp;&nbsp;2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if&nbsp;(value['calc-Stärke']&nbsp;&gt;=&nbsp;15)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mod-Stärke':&nbsp;&nbsp;3 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;}); I only changed from the original strenght to Stärke nothing more and even in the original it didnt't work only in the implemented Sheet from Roll20 The End looks like this. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tactics2:&nbsp;0, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Raumanzug:&nbsp;0, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); &lt;/ script &gt; So from what I learned so far, everything is like it should be, but I can't figure out why it doesn't work T-T If you want the full HTML <a href="https://github.com/Roll20/roll20-character-sheets/tree/master/Mongoose_Traveller2e" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/tree/master/Mongoose_Traveller2e</a> How did you wrote it, maybe I can make like you did. I hope it is better now. Sorry for troubling you and thanks for helping. (Sorry for my bad english)
1588721737
GiGs
Pro
Sheet Author
API Scripter
I have an idea why it's not working. I on("change:calc-Stärke&nbsp;sheet:opened",&nbsp;function()&nbsp;{ &nbsp;getAttrs(['calc-Stärke'],&nbsp;function(value)&nbsp;{ I'm not sure how well javascript and roll20 handle non-English characters in attribute names. The on-change line must have all lower case letters, so the above should be on("change:calc-stärke&nbsp;sheet:opened",&nbsp;function()&nbsp;{ &nbsp;getAttrs(['calc-Stärke'],&nbsp;function(value)&nbsp;{ Give that a try.&nbsp; Note that roll20 recommends using all lower case for attribute names to avoid issues like this. If its still doesnt work, the issue might be the&nbsp;ä, but I think it should handle that. By the way, this is how I would rewrite that sheet worker: on("change:calc-stärke&nbsp;sheet:opened",&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;getAttrs(['calc-Stärke'],&nbsp;function&nbsp;(value)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;score&nbsp;=&nbsp;parseInt(value['calc-Stärke'])&nbsp;||&nbsp;0; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;mod&nbsp;=&nbsp;Math.max(0,&nbsp;Math.floor(score/3)&nbsp;-2); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'mod-Stärke':&nbsp;mod &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;}); }); Since the modifier goes up by 1 for every 3 stat points, we can calculate the modifier by simply dividing by 3. If you have a lot of stats you can handle them all in one go with a worker like this: const&nbsp;stats&nbsp;=&nbsp;['Stärke']; stats.forEach(stat&nbsp;=&gt;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;on(`change:calc-${stat.toLowerCase()}&nbsp;sheet:opened`,&nbsp;function&nbsp;()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getAttrs([`calc-${stat}`],&nbsp;function&nbsp;(value)&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;score&nbsp;=&nbsp;parseInt(value[`calc-${stat}`])&nbsp;||&nbsp;0; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;mod&nbsp;=&nbsp;Math.max(0,&nbsp;Math.floor(score/3)&nbsp;-2); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setAttrs({ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[`mod-${stat}`]:&nbsp;mod &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;}); }); This assumes all stats have calc- at the start, and mod- &nbsp;at the start of their modifier name. You add extra stats my changing this line const&nbsp;stats&nbsp;=&nbsp;['Stärke']; Just add the bit after calc- for each attribute in there, like const&nbsp;stats&nbsp;=&nbsp;['Stärke', 'Dexterity', 'Intellect', 'Education'];
1588736116
GiGs
Pro
Sheet Author
API Scripter
For the record, I've just committed updates for both mongoose traveller sheets to streamline their sheet workers. You can see the code here:&nbsp; <a href="https://github.com/G-G-G/roll20-character-sheets/blob/m-traveller-1e/Mongoose_Traveller/MongooseTraveller.html" rel="nofollow">https://github.com/G-G-G/roll20-character-sheets/blob/m-traveller-1e/Mongoose_Traveller/MongooseTraveller.html</a> This reduced ~2200 lines of code to 60 (counting spaces and comments!).
Thank you so much. I use your sheet and change it for my use. I'm so happy. Thank you, thank you aaaaand thank you.
1588897682
GiGs
Pro
Sheet Author
API Scripter
hehe, you're welcome. I cant take the credit for the sheets - they were made by Coal Powered Puppet originally. I just streamlined the sheet workers.
1588898777

Edited 1588898799
Andreas J.
Forum Champion
Sheet Author
Translator
2200 lines down to 60, is a pretty dope optimization
1588901157
GiGs
Pro
Sheet Author
API Scripter
Andreas J. said: 2200 lines down to 60, is a pretty dope optimization And more importantly, they are transferrable to other sheets that use the same techniques, requiring you to only change 3 lines. I have seen a lot of sheets using the same techniques for laying out skills, or calculating stat mods, so its handy to have decent examples to crib from.