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

I need help in creation of a new sheet.

So i'm currently working on a sheet for a game, and i've run into a problem of tedium.  <div class="sheet-Spellsprepared">               <div class="sheet-Spellsprepared"><input type="number" name="attr_max_spells1100" value=""/></div>               </div>               <div class="sheet-CheckboxSquareConc">                <input type="checkbox"><input type="checkbox">               </div>         <div class="sheet-listspells__cell"><input type='text' name="attr_mem_spells1100" value=""/></div> The above is an example of "1" line. And i've got 4 of these, in a collum, then i've got 4 more in a row, and then 9 more to complet a spell list Now the question i have is weather it is posible to substitute the "1100" with a code so i dont need to manually go and add one to them all, but it'll automatically just pick the next free number in a line. Or is the answere to scrap that shit, and use Repeating sections instead?
1655758162
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Either use repeating sections or switch to using PUG to generate your html. Pug allows you to iterate through arrays and objects to generate html code.
Scott C. said: Either use repeating sections or switch to using PUG to generate your html. Pug allows you to iterate through arrays and objects to generate html code. I dont fully understand how i'm suppose to make the code in PUG for it to then convert it into HTML. I'm only barely claudgning things together in an attempt to get things to work
1655762194
GiGs
Pro
Sheet Author
API Scripter
Personally I'd recommend Handlebars over PUG, specifically the app made for this forum (see the GUI app linked in this post ). The advantage of this method is you dont have to completely change the way you build and code sheets - you use the exact same method you are using now, but just alter the section you want to work on. But failing some kind of templating, you have two options: Repeating sections: they are great for a lot of things, and let you write one set of code that automatically gets expanded into hoever many sets are needed. Copy & Paste: if you just need to change the number 1100 in each section, this is easy - just copy it however many times you need and go in and manually change that nuber in each set. It looks like your code is perfect for a repeating section - you don't have to set up a fixed number ahead of time, and for characters who aren't spell users, no spae on the sheet up is taken up by a feature they aren't using.
1655763002
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Depending on what needs doing, handlebars may work, but it's quite a bit less powerful.
1655763314
GiGs
Pro
Sheet Author
API Scripter
Scott C. said: Depending on what needs doing, handlebars may work, but it's quite a bit less powerful. It's definitely less powerful, but easier to integrate with your workflow. That app mentioned above does also have some problem areas to work around (especially with rolltemplates, which use handlebars syntax so they don't coexist well), but none of that matters if you're just using it for duplicating bits of code here and there. For that, it's a very easy drop-in to your work.
Thanks for your input. I've decided to go with Repeating sections, though my Players will be annoyed at having to input their shit again, it's better than wasting Hours doing it the manuel way
1655841079
GiGs
Pro
Sheet Author
API Scripter
There original information will still be there on attributes & abilities tab, and if you have time before the next session, you can write a versioning sheet worker to seemlessly transfer the data from the old attributes to the sheet worker