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

Checking to see if a character has a skill

Howdy all, I have a character sheet that uses a repeating section for skills. Is there a way to check to see if a character has a certain skill (say Jumping)? If he does, I want to use the skill level associated with the skill, and if he does not, I want to use his DEX score instead. Could this be done using API? If so, would I have to write my own search function to see if the skill exists for the character or does such a function already exist? Thanks! Scott
1520223221
The Aaron
Pro
API Scripter
That's a somewhat complicated question.  You can definitely find if a given character has a given field in a repeating section with the name "Jumping", and then find the corresponding value for that skill in another field of the same row.  Doing that requires knowing the name of the repeating section, then searching all the attributes for that character with a name like (assuming the repeating section is named "skills" and the skill name is named "skill_name") the regular expression: /repeating_skills_.*_skill_name/ :where the value is "Jumping", then taking the part matched by the .* in the middle and using it to construct the name of the attribute with the score (say "repeating_skills_-jz131as423_skill_score") and getting it's value. The possibly more complicated part is what you do with it then.  You'll have it in the API, but you won't be able to just use it in a macro like you could with @{selected|skill_name}.  You'd need to have whatever formula and logic you want applied in the API, and then some sort of output as a result.
Thanks Aaron! I figured it would take a bit of programming, but I just wanted to make sure it was doable before I jumped into the coding. Scott