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

Can I use the data from in other places lika a drop box?

Hi guys, me again... ;o) I'm still struggling with building my first ever character sheet. I have a section where players can add new skills by adding a new line via the <fieldset> function. So far, so good. I thought it would be convenient to link those skills to pieces of equipment. Let's say, I have a Ranged Combat skill and a Melee skill. Now I want to make a roll for the weapon where the right skill bonus is added. I'd thought I'd have a dropdown with all the fighting skills to choose from, so the roll button knows what bonuses to add to the roll. Is there a way to access all those added lines and have them in a dropdown list to choose from on another part of the sheet? Probably not without API or scripts, I guess...
1562942755
GiGs
Pro
Sheet Author
API Scripter
If you have a fixed list of weapon skills, it is easy - you can use a select element. <select name="attr_weapon_score">     <option value="0">(Select One)</option>     <option value="@{sword}">Sword</option>     <option value="@{axe}">Axe</option>     <option value="@{hammer}">Hammer</option> </select> In this example, the @{weapon_score} attribute will have the score of the relevant weapon skill. Does that help?
1562943028

Edited 1562943129
Unfortunately not, I want to choose from a list of skills that has been created by a fieldset-section of the sheet. The players ar able to name the skills themselves. Think of Shadowrun: You have a firearms-skill, a concentration on pistols and a specialisation an a Ares Predator. So there is actually 3 skills made from one. These skills are completely different for each character, some might not even have a specialisation or concentration. Maybe not even a firearms skill. Now I want a dropdown that lets me choose from these three, who were created by the +Add-Button.
1562943635
GiGs
Pro
Sheet Author
API Scripter
That's much more complicated. In non-roll20 websites, it would be fairly easy, but the restrictions roll20 has placed on what we can do (for sensible security reasons among others) make it very difficult. I think someone (maybe Jakob?) has posted a method, so it might be possible. If you find it, post back and let us know! It does seem like something we should be able to do.
1562947846

Edited 1562948135
Do you mean this post?: Link to post. You can use getSectionIDs: getSectionIDs('repeating_foo', idArray => { log(idArray.length); // logs number of repeating rows within repeating_foo }); Tbh, I don't even know where this belongs, JavaScript maybe?
1562951970
GiGs
Pro
Sheet Author
API Scripter
No, that just counts up how many rows there in a sheet worker. You cant directly do what you're asking with a sheet worker-  sheet workers dont have access to the sheet layout. It needs to be a CSS-based solution (though sheet workers may help out in creating the attributes used). 
1562953728
GiGs
Pro
Sheet Author
API Scripter
I found a comment by Jakob at the end of this thread:&nbsp; <a href="https://app.roll20.net/forum/post/5073351/drop-down-menu-taking-names-and-values-from-repeating-rows" rel="nofollow">https://app.roll20.net/forum/post/5073351/drop-down-menu-taking-names-and-values-from-repeating-rows</a> But he does say it would be quite tricky.&nbsp;
Yeah, just like I thought... Damn! :o(
1562968828
GiGs
Pro
Sheet Author
API Scripter
One thing you can do is let people enter the name in text, and use a sheet worker to match it with the list in the repeating section. If it's correctly spelled, and the result exists, it can return the value. Entering the text is a bit clunky. Honestly the easiest method is just to include a number input and let players enter their skill value. Or maybe have the weapon details in the same repeating section as the skills.
1562969311

Edited 1562969363
The thing is, I want all the values to change at the same time. Let's say, you have Firearms at level 4. So you get a bonus of 4 on all weapons you use the Firearm skill for. Now you spend XP to raise Firearms to level 5. That would actually mean, you'd have to check the whole sheet for that bonus and change all values manually. This is destined to go wrong at some point! But yeah, maybe I'm a bit spoiled by using the official D&amp;D 5E sheet first, with Charactermancer and all. Pure luxury! No wonder I want that for my players in Shadowrun too, right?
1562974199
GiGs
Pro
Sheet Author
API Scripter
Oh, don't worry, I feel your pain. It would be nice to be able to handle this. The D&amp;D5e sheet doesnt have to deal with skill or attack values in repeating sections (or if they do, the author needs to share how they did it!).
No, D&amp;D5E does not have that problem. In places, you can add stuff, like attacks, but that doesn't have any impact on other sheet sextions, afaik.