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

D&D 3.5 Character Sheet - "repeating_skills"

I'm trying to add in a "shapeshift" skill for a lycanthrope character. I've succeeded in getting the skill listed in the "Other Skills" section but I cannot call these values from macros. If I use the macro button in the character sheet it works, but I wan't to have the skill check shown as a token action - and thus called from an "attributes and abilities" macro. I get errors when I use the following: repeating_skills_#_otherskill repeating_skills_#_shapeshift repeating_skills_0_shapeshift shapeshift The macro runs with a value of "3" when I use: repeating_skills_0_otherskill So I think the last one is more correct, but it is not actually using the correct value for the skill. It always uses a value of 3. What am I doing wrong?
1476583488
Diana P
Pro
Sheet Author
the # (or 0) is the row number, starting at zero, for the repeating set. Use $0 in that spot (so repeating_skills_$0_otherskill) for the first one, $1 (repeating_skills_$1_otherskill) for the second row, etc.
Thank you, Diana. I wasn't aware that I needed the "$" in my function, that's what I was missing. I'm curious about the rationale behind the "$" I haven't used it in any of my other macros. Is this something with the API or is it specific to the 3.5 Character sheet?
1476940723
vÍnce
Pro
Sheet Author
This was a change for all sheets. &nbsp;Not sure why the "$" was added specifically. &nbsp;However, the new repeating row syntax ( $X where X is a row number ) was added/changed as a precursor to adding unique id's for repeating rows that allowed some powerful new features that weren't possible with the previous function. &nbsp;ie rearranging repeating items, targeting specific repeating item attributes regardless of their row, drag/drop of repeating row buttons to the macro quick bar, the ability to do calculations on repeating item attributes, etc. &nbsp;wiki info:&nbsp; <a href="https://wiki.roll20.net/Macros#Referencing_Repeating_Attributes" rel="nofollow">https://wiki.roll20.net/Macros#Referencing_Repeating_Attributes</a>
1476941396

Edited 1476941719
Lithl
Pro
Sheet Author
API Scripter
Vince said: Not sure why the "$" was added specifically. Completely unfounded speculation: because it's the symbol used for&nbsp;the jQuery function. In my own code, for example, any objects which are intended to be jQuery objects are prefixed with $, eg: $(function() { var $numberFields = $('input[type=number]'), pageTitle = $('title').text(); // $numberFields is a jQuery object with all of the number inputs on the page // pageTitle is a string }); There are other libraries which make use of $ as a variable name, but jQuery is extremely &nbsp;common, and I'm pretty sure it is utilized on this site. ;)
1476941802
vÍnce
Pro
Sheet Author
I've been informed, but feel just as ignorant. Thanks Brian. ;-)
1476982873
Diana P
Pro
Sheet Author
Alex said: Thank you, Diana. I wasn't aware that I needed the "$" in my function, that's what I was missing. I'm curious about the rationale behind the "$" I haven't used it in any of my other macros. Is this something with the API or is it specific to the 3.5 Character sheet? As Vince and Brian have said, it's not specific to the 3.5 Sheet.&nbsp; Your other macros may be working because any repeating rows made prior to the change actually had row id's of 0, 1, 2, etc so macros which reference those would continue working correctly due to that being the correct row id for that row.&nbsp; New (since the change) row id's look more like KC0zCLum1Rq3V5wssyE&nbsp; (as shown in the Wiki page Vince linked). I tend to think of it now that the $ turns it into a pointer so $0 for the first (zeroth) row, etc.&nbsp;