Advertisement Create a free account

Help with ChatSetAttr Repeating Attributes

1557960903
I'm still pretty new to all this and trying to figure out a couple things. I'd like to make a set of macros that can add and remove buffs/conditions to the character associated with the selected token. So far, adding something is pretty easy: !setattr --sel --repeating_buff_-CREATE_name|Cover --repeating_buff_-CREATE_mods|2 to armor --repeating_buff_-CREATE_toggle|1 However, since I'm "creating" a new row rather than simply modifying a specific attribute I know will always be present, I can't figure out how to then remove or toggle the attribute since I don't know how to magically find/remember its row number or ID. I'm probably overlooking something super simple. Hopefully what I'm trying to achieve makes sense! Thanks all :)
1558020621

Edited 1558020632
Which game and character sheet are you using? I for example use the D&D 5e OLG sheet and don't recognise the term 'Buff' within the sheet - Is this a pathfinder or maybe 'shaped' sheet?
1558024940
keithcurtis
Forum Champion
API Scripter
That's what -CREATE does above. It is creating a new repeating field using ChatSetAttr.
1558027111
Vince
Pro
Sheet Author
keithcurtis said: That's what -CREATE does above. It is creating a new repeating field using ChatSetAttr. So you're saying ChatSetAttr can even create a repeating ability for a fieldset(repeating section) that doesn't even exist in the sheet's code?  I thought it would only create a new repeating attribute for a repeaitng section that has been coded into the sheet.  Mind blown. ;-)
1558032443
keithcurtis
Forum Champion
API Scripter
It's pretty darn powerful.
1558037757
Jakob
Pro
Sheet Author
API Scripter
Vince said: So you're saying ChatSetAttr can even create a repeating ability for a fieldset(repeating section) that doesn't even exist in the sheet's code?  I thought it would only create a new repeating attribute for a repeaitng section that has been coded into the sheet.  Mind blown. ;-) I mean, it can, but it's pretty pointless. It will just create a bunch of garbage attributes that cannot be used for anything sensible. As to the original question, I think what you would need would be a  way to write the repeating ID created by the -create into a field on the sheet. Then you could write the ID into a field like "cover_id" and then remove it later using @{cover_id}. This is not currently possible, but I can think about adding it at some point.
1558038415
Jakob said: As to the original question, I think what you would need would be a  way to write the repeating ID created by the -create into a field on the sheet. Then you could write the ID into a field like "cover_id" and then remove it later using @{cover_id}. This is not currently possible, but I can think about adding it at some point. Ya, that was something I kind of thought of as well but didn't see anything like a return variable or something.