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 adding traits and feats

August 29 (4 years ago)

Edited August 29 (4 years ago)

I have a game system I've been working on for a few years and just recently started working with html/css/script/api. Honestly not sure if I'm in the right place to post this but while creating the character sheet, I've run into a few snags. How can I add class features and race traits once they are selected so the sheet can update on its own?

There's a few other side mechanics I'm trying to implement into the coding like:

-exp system for class level up and profession leveling

-(already mentioned  racial traits and class features when they are selected.)

-Is it needed to add each piece of equipment (armor/jewelry/weapons) that are class restricted?

These are the main issues I'm trying to figure out. Any help is greatly appreciated.


My objective in creating this character sheet for my game is so the players have minimal work to put into creating their characters. 

August 30 (4 years ago)
GiGs
Pro
Sheet Author
API Scripter


For future reference, this kind of question is best asked in the character sheet forum.

To your question:

Devildog said:

How can I add class features and race traits once they are selected so the sheet can update on its own?

I'm not 100% sure what you are asking here.

If you are asking if you can dynamically add new options in play, that isnt possible on roll20. Dropdowns on sheets cannot have their list of options updated dynamically. They have to be all programmed in at design time.

If you are asking if you can have a set of dropdowns, each with a preset list of options, and when players select one , it causes attributes to be updated with new values - that is definitely possible. It's best done through the sheet worker system, which is a limited form of event-driven javascript.

We'd need more specifics to describe how to do it, but look at the wiki under building character sheets, and sheet workers, to learn the basics.

-Is it needed to add each piece of equipment (armor/jewelry/weapons) that are class restricted?

I dont understand this question either, sorry! But if you want specific equipment to have specific effects, you need to program those effects into the sheet worker system.


August 30 (4 years ago)

Edited August 30 (4 years ago)

I do apologize for posting in the wrong area. With all this coding going to several different places like making it a script format or turning it into a macro or even coding it in sheet worker has gotten me confused as a beginner lol. I will keep this noted though and address things properly in the appropriate channels.


As for the presets for the classes and races., it seems like what I'm asking for will be doable via sheet worker. Trying to make it to where when choosing the class and race from a drop down menu (which I already have installed in) how can I go about setting the bonuses those individual queries give when selected? I.E.=I choose the Ranger who's primary stat is Dexterity and +x ability. Ranger can only equip light and medium armor and can only wield certain weapons. Then I choose the Elf race which would give say a +x stat, +x ability, movement of x ft and can only carry x amount of lbs before str mod.


This can kinda fall in line with class features and race traits as far as coding I believe. Maybe make it to where the item auto calculates to base stat and attack/defense mod?