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 here.
×
×
Cookie Preferences
We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
I have a character sheet with a roll template of 4000 lines. My doubt is: Is better (and faster) to add some more lines ( ~ 1000) to adapt the roll to any situation, or would be better to duplicate the rolltemplate for different purposes?
I dont know personally which is best, and I'm curious to hear the answer. I suspect it'll be that whichever approach takes up the fewer lines is best. Your template is pretty huge. I wouldnt be surprised if it could be rewritten to be at least a bit shorter.
Yep, It sounds like you've got some optimizing to do to me. That roll template is two thirds as long as the html for the sheet itself of my Starfinder HUD (PC, NPC, and Starship combined), and is 4 times as long as all four of my roll templates put together (generic, attack, spells, starship). Heck, that's as long as the entirety of my sheetworkers. How long is your character sheet itself?
Rereading your question: "would be better to duplicate the rolltemplate for different purposes?" - if the template is 4000 lines long, you definitely dont want to duplicate the whole thing. I suggest posting the sheet's url, describing what the roll template is meant to do, and ask for suggestions on how to optimize it.
Depends on the game. I am not familiar with the effect of long lines of code have on roll templates, but I imagine long code means slower response time. On my sheets, I got some that only have a single roll template with extensive the helper functions, while other sheets- especially those I made while I still learning- have multiple toll templates. However, I never had 4 grand in code lines per template. My knee jerk reaction mirrors the others: trimming your template might be a good idea. But I don't know yer game. Most important: is it working? Is it slow when you use it? Does it look nice?
It is better to make smaller focussed rolltemplates so it is easier to not end up with 1000's of lines per roll template. It also makes it easier to find and change thigns for a specific type of roll. Elena S. made some nice rolltemplates for the AD&D2e simple sheet that are not so big. The compelte sheet with 7 roll templates, worker scripts and multiple tabs is only 3529 lines. ADnD 2e Simple Sheet - Wiki Maybe you must post the code for your template and what you trying to acheive.
The sheet responds well. During game, we're not experiencing any lags. This is the link to the sheet html . The bigger roll template start at line 1329 and end at line 5645. The rolltemplate is as big as this because I had to simulate a table roll, and either the html or the script worker could'nt did this. I used helper functions instead. It's working well. The bulk of the template is the simulation of the table roll, from line 1394 to line 5645. I think it is not lagging because it is all html and css, and it does not have a lot auto calculation fields. I was thinking in add some different layouts to the template depending on the kind of rolling (attack, magic, etc.), but this would implicate in duplicate the table roll.
It looks like its simulating a complex table with rows and columns? f I could see the table source I might be able to trim it down, but it runs the risk of making it a lot less readable than it is. If you want to add different layouts or situations, I'd definitely recommend not duplicating the entire table roll, but building those modifications into the existing template.
Wow a lot of result options making your rolltemplate very large. I think if it works and it is not slow to load then jsut add the additional features to it
AquaAlex said: Wow a lot of result options making your rolltemplate very large. I think if it works and it is not slow to load then jsut add the additional features to it Well, this and others answers solves my question! Thanks. G G said: It looks like its simulating a complex table with rows and columns? f I
could see the table source I might be able to trim it down, but it runs
the risk of making it a lot less readable than it is. I don't want to turn int less readable because someone may want to edit it later. But thanks.