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

ScriptCards: Create Attributes?

1707995010
Essen
Pro
Marketplace Creator
Howdy. I've been using ChatSetAttr to add attributes to characters, but it seems to only do about 5 at a time, and I'm iterating on NPC/monsters where there are multiples, so bleed1, bleed2, etc. Is there any way to use ScriptCards to add more attributes at once? I'm not sure what causes that limit of 5, but I know ScriptCards has it's own command engine.
To answer your question, yes you can create multiple attributes with ScriptCards.  ScriptCards object modification  allows for multiple attributes to be created. --!a:[*S:character_id]|!attr1:val1|!attr2:val2|!attr3:val3 The before the attribute names will say create the attribute if doesn't exist since the default will update only existing attributes. As for the first part, I'm surprised you are having that issue with ChatSetAttr. Granted it's been a while since I've run my game setup scripts but they all ran fine last time and created more than 5 attributes. I am not certain what would cause ChatSetAttr to have issues with 5. Out of curiosity, want to post the ChatSetAttr you are using? Perhaps there is something else going on.
1708032118
Essen
Pro
Marketplace Creator
Whatever limit there is seems to intermittent, it's not always 5, but around there. I don't know why. The version I'm using is the "Latest" from the dropdown.  The command itself is: !setattr --sel --scourge|0 !setattr --sel --scourge_mult|1 !setattr --sel --scourge_chk1|0 !setattr --sel --scourge_chk2|0 !setattr --sel --scourge_chk3|0 !setattr --sel --scourge_chk4|0 !setattr --sel --scourge_chk5|0 !setattr --sel --scourge_chk6|0 !setattr --sel --scourge_chk7|0 !setattr --sel --scourge_chk8|0 !setattr --sel --scourge_chk9|0 !setattr --sel --scourge_chk10|0 !setattr --sel --scourge_chk11|0 !setattr --sel --scourge_chk12|0 !setattr --sel --scourge_chk13|0 !setattr --sel --scourge_chk14|0 !setattr --sel --scourge_chk15|0 !setattr --sel --bleed|0 !setattr --sel --bleed_mult|1 !setattr --sel --bleed_chk1|0 !setattr --sel --bleed_chk2|0 !setattr --sel --bleed_chk3|0 !setattr --sel --bleed_chk4|0 !setattr --sel --bleed_chk5|0 !setattr --sel --bleed_chk6|0 !setattr --sel --bleed_chk7|0 !setattr --sel --bleed_chk8|0 !setattr --sel --bleed_chk9|0 !setattr --sel --bleed_chk10|0 !setattr --sel --bleed_chk11|0 !setattr --sel --bleed_chk12|0 !setattr --sel --bleed_chk13|0 !setattr --sel --bleed_chk14|0 !setattr --sel --bleed_chk15|0 Nothing especially crazy, just a lot of them. I ran it once now and it worked great, then the second time it only did the first 7. No errors in the chat or the console.
Hmm I wonder if it's because you are making individual calls. I nest all the attributes into a single call like so: !setattr {{ --sel --scourge|0 --scourge_mult|1 --scourge_chk1|0 --scourge_chk2|0 --scourge_chk3|0 --scourge_chk4|0 --scourge_chk5|0 --scourge_chk6|0 --scourge_chk7|0 --scourge_chk8|0 --scourge_chk9|0 --scourge_chk10|0 --scourge_chk11|0 --scourge_chk12|0 --scourge_chk13|0 --scourge_chk14|0 --scourge_chk15|0 --bleed|0 --bleed_mult|1 --bleed_chk1|0 --bleed_chk2|0 --bleed_chk3|0 --bleed_chk4|0 --bleed_chk5|0 --bleed_chk6|0 --bleed_chk7|0 --bleed_chk8|0 --bleed_chk9|0 --bleed_chk10|0 --bleed_chk11|0 --bleed_chk12|0 --bleed_chk13|0 --bleed_chk14|0 --bleed_chk15|0 }} I wonder if that would work better for you. If not, then a ScriptCard can be used as well.
1708032743

Edited 1708039176
vÍnce
Pro
Sheet Author
I believe there is an old api bug that you might experiencing... More info and a solution from Tim ; <a href="https://app.roll20.net/forum/post/9837419/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/9837419/slug%7D</a> Use ZeroFrame Batching; now has the ability to "batch-up" multiple command lines so that they are interpreted as a single command. This not only side-steps the&nbsp; dropped-lines bug , it&nbsp; presents new opportunities for roll re-use across what would have been separate command lines.
1708034249

Edited 1708034261
Essen
Pro
Marketplace Creator
I also have these... !setattr --sel --attrstart|@{ !setattr --sel --scourge_chk|@{selected|scourge_chk !setattr --sel --tgt_scourge|@{target|scourge_chk !setattr --sel --bleed_chk|@{selected|bleed_chk !setattr --sel --tgt_bleed|@{target|bleed_chk When I run them, the part after each pipe is in the "max value" box. Any way to make these work with this? I'm fine with keeping this two different macros, I'm just curious.
1708034298
Essen
Pro
Marketplace Creator
vÍnce said: I believe there is an old api bug that you might experiencing... More info and a solution from Tim ; <a href="https://app.roll20.net/forum/post/9837419/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/9837419/slug%7D</a> Ah, okay. Thanks for the info!
1708036685
GiGs
Pro
Sheet Author
API Scripter
vÍnce said: I believe there is an old api bug that you might experiencing... More info and a solution from Tim ; <a href="https://app.roll20.net/forum/post/9837419/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/9837419/slug%7D</a> What's the solution, Vince? I only see a description of the problem there?
1708039060

Edited 1708039114
vÍnce
Pro
Sheet Author
My bad; Use ZeroFrame Batching; now has the ability to "batch-up" multiple command lines so that they are interpreted as a single command. This not only side-steps the&nbsp; dropped-lines bug , it&nbsp; presents new opportunities for roll re-use across what would have been separate command lines. <a href="https://app.roll20.net/forum/permalink/11327759/" rel="nofollow">https://app.roll20.net/forum/permalink/11327759/</a>
1708039396
GiGs
Pro
Sheet Author
API Scripter
Thanks!