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

I don't remember if this is possible yet but.. Can a repeated field be referenced too ?

So if I add an item to a repeating field. Can I reference to say, the third item created within an ability macro?
1427643017

Edited 1427643108
vÍnce
Pro
Sheet Author
Hi Saevar. Are you asking if this can be done using API scripting or just via an ability macro in general? Repeatable items are unique in that they haven't been created until a user adds them. For that reason, you can't reference a repeatable items button macro directly, but you can reference the individual attributes once they are created. You also cannot pull auto-calculated attributes from the repeatable item. So, if I wanted to get the weapon name of the 3rd weapon item ( #2 since repeatable items start at 0) I could use @{selected|repeating_weapon_2_WeaponName} This is just an example, your sheet or custom attributes will proabbaly be named differently. There's a suggestion for adding more features: Official support for repeating sections in character sheets Please add a comment and/or vote. :-) If I misunderstood your question, apologies. Cheers
Nope you understood it perfectly. That is basically what I referring too. #2 of a repeatable item etc. :)
1427647081
The Aaron
Pro
API Scripter
The API is capable of accessing the repeating attributes: { "name": "repeating_classresources_0_ClassResourceName", "current": "Luck", "max": "", "_id": "-JflG_fqeHvItT33TB9U", "_type": "attribute", "_characterid": "-Jh1tMI3qnsFKEV66BuA" } The names are constructible if you know what to look for in the sheets.
1429022195
Kryx
Pro
Sheet Author
API Scripter
Hey Aaron, Related question: I'm looking to break traits into a repeatable section on my 5e Shaped Sheet. Can I use the API to create X number of traits and put the text in them? For attributes I currently use: createObj('attribute', { name: name, current: currentVal, max: max, characterid: characterId }); If I set the name to the repeating name will it create them for me? Thanks!
1429022425
The Aaron
Pro
API Scripter
I'd be interested in knowing the answer to that question as well... ...which is to say I have no idea. I suspect it would work, but I've never tried it.