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

Using ChatSetAttr with a rollable table

1651309914

Edited 1651319155
Morning all, Hoping someone might be able to give me some advice. I've been trying to get a character sheet attribute to populate with the result of a rollable table. I thought this would be pretty straightforward using the ChatSetAttr script with this command: !setattr --sel --Attribute_Name|[[1t[Table_Name]]] but this behaves oddly. It either returns the first item in the table, or nothing at all. Anyone know what I'm doing wrong? Or a better way to acheive the same thing? Edited to add: So after further experimentation it seems that the above command actually works fine. The problem I'm having is nothing to do with the rollable table. It crops up whenever I put more than three !setattr commands in a single macro. These macros will sometimes work fine, but other times will skip one of more of the commands.
1651330979
GiGs
Pro
Sheet Author
API Scripter
There is a known issue that sometimes using multiple script commands in the same macro causes a problem. It's a fairly new bug, but no sign of a fix for it yet. If you are calling multiple setAttrs commands, you might be able to combine them into a single command. There's a syntax for doing that.
GiGs said: If you are calling multiple setAttrs commands, you might be able to combine them into a single command. There's a syntax for doing that. Thanks - combining them all in one command actually works fine.
1651399316

Edited 1651406000
While I have a thread up, maybe someone can point out what schoolboy error I'm making here. I cannot get chatsetattr to copy a value from one attribute to another. For example !setattr --sel --Wounds|%WoundsStart% does not pull the value from the WoundsStart attribute, but just tries to input the text into the attribute, percentage signs and all. I was wondering if it's a quirk of the character sheet I'm using, but the same thing happens whatever sheet or attributes I try. Eg: Any ideas what I'm doing wrong? Edit: Solved! I'm an idiot. I had an older version of the script loaded to the game, from before this functionality was added.