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

Palladium Megaverse API/Sheet help request

Good morning everyone, I am seeking some assistance with trying to call (extract?) skill attributes from my players character sheets to use in my API power cards. I'm not particularly skilled or knowledgeable when it comes to API scripting so any assistance at a layman level of instruction would be greatly appreciated.  I tried to identify a solution myself using videos on youtube as well as inspecting the  code for the macro already imbedded into the sheet, but have come up more confused than when I started. Generally I want to take the value entered in the character's skill box (which can change as the character levels up) and insert that information into my Power card. 
1605657027

Edited 1605657082
Kraynic
Pro
Sheet Author
Ok, the first thing is that an attribute in a repeating section always has 3 parts with each part being separated by an underscore: 1. the repeating section label (from the html) 2. the row id 3. the specific attribute name for the field that you want. For the first part, you are looking at @{repeating_skillocc, @{repeating_skillelective, and @{repeating_skillsecondary There are 2 ways to go about the second.  You can just go for a row number.  $0 would be the first row, since it starts counting from zero.  Your 12th skill in one section would be $11 for the row number.  The downfall of this method is that if something gets deleted or reordered up the list, it changes the row number of everything falling after.  The other way is to get the row id, which will require you to inspect the sheet.  You see that big string labeled data-reprowid?  That is the specific row id that was generated when the row is created.  If you use that, it will still look for the same row no matter where it gets moved in the list, since that is a unique identifier. The third is the specific attribute for the field holding the number you want to retrieve.  In this case it is skill_rating} This leaves you with an attribute of @{repeating_skillocc_$0_skill_rating} for the skill rating of the first row of the OCC skill list. Or you replace the $0 with the row id (which includes the little leading dash), looking something like @{repeating_skillocc_-MMJ2mtZ70212Swf3YkD_skill_rating} for the one you have highlighted.  I may not have it all typed in right, since it is hard to see. The easiest way to get the unique ID is to drag the roll button to the quick macro bar, but that sheet was written before that existed and wasn't written to accommodate that feature. Edit:  For anything Power Cards specific, you may want to post in the active thread for that script if you don't get answer here.
1605659952
timmaugh
Pro
API Scripter
Check out my XRay script ... part of the InsertArg package. Once installed, run !xray. Start walking your character sheet. (InsertArg is huge and has a learning curve. XRay is super simple.) Let me know if it helps, or if you need help!
Thank you both very much! Using the information you both provided and !xray I was able to get it running. Again my thanks :D