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

[Script] ChatSetAttr

I'm trying to combo a drop down ability with ChatSetAttr. Here is what I'm doing. I have the first Ability set as such: ?{Breach|Computer,%{Mr.Macro|computer_breach}|Engine, %{Mr.Macro|engine_breach}|Weapon,%{Mr.Macro|weapons_breach}|Structure,%{Mr.Macro|structure_breach}|Sensors,%{Mr.Macro|sensors_breach}|Communications,%{Mr.Macro|communications_breach}} This will allow me to choose what ability I want to kick off.  I'm doing this for the same of not having multiple buttons for the various attributes I'm trying to change. An example of the ability that is being targeted is the following: !setattr --sel --mod --computer_breach|?{Add or Subtract Breach|0} It seems as though for some reason !setattr isn't seeing this coming from the other ability as a number.  The error I'm getting is: Errors Attribute computer_breach is not number-valued for character USS Saturn. Attribute left unchanged. Any help is appreciated.
1537927755

Edited 1537927845
What sheet/game system are you using? It looks like the value in the computer_breach attribute is not a number. This could mean anything from it being text, to it being empty, to it having a space in front of a number. If you select the character's token on the tabletop and type @{selected|computer_breach} and hit Enter in the chat, what comes back?
They are definitely numerical attributes. But I agree that's what the script seems to think for whatever reason.
1537987559
GiGs
Pro
Sheet Author
API Scripter
If you have an Ability like this: ?{Breach|Computer,%{Mr.Macro|computer_breach}|Engine, %{Mr.Macro|engine_breach}|Weapon,%{Mr.Macro|weapons_breach}|Structure,%{Mr.Macro|structure_breach}|Sensors,%{Mr.Macro|sensors_breach}|Communications,%{Mr.Macro|communications_breach}} And this is calling multiple other Abilities, you are almost certainly hitting the nested html entities problem . The only way to fix this, would be to rewrite the above macro, and remove all ability calls, replace them with the content of those abilities, and then edit the final ability to replace whichever html entities you need to replace. It's not a ChatSetAttr problem, its a macro parsing issue. The Ability is improperly constructed so the wrong values are being sent to ChatSetAttr.