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 here.
×
×
Cookie Preferences
We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
How can I make findObj to find a repeating section attribute by its row number, i.e. repeating_action_$0_damage? Just naively passing it as the name doesn't seem to find the right attribute.
If the repitems haven't been reordered, then the array returned by findObjs or filterObjs ought to be the order of the items. (Assuming you limit the result set to a single character, of course.) You may be able to use the callback parameter to sendChat to get the indexed value of a repeating item, as well.
It used to work like this before the API/Character sheet reworking : getAttrByName(originchar_id, "repeating_meleeweapons_$0_WeaponType"); (it still works with macros) A topic has been created in the Bug reports and technical issues : Can't access attributes of repeating section with getAttrByName and $X It still doesn't work, feel free to join the topic
It's not exactly my case, alas: I need findObjs, not getAttrByName, since I want to get the attribute object in order to modify the attribute. I'll post in the other thread anyway and see what kind of response I get.