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

chatsetattr don't work with ability button

Hello everyone, I'm sorry if this matter has been brought earlier, but I'm struggling with this for hours and I didn't found my answer anywhere. At first, I tried to use chatsetattr inside a query, but the "|" was causing some issues because the querry considered it as a new choice. So I tried to use ability command buttons to stack my abilities. Used individually each ability woks fine with chatsetattr but when I use a button, the script is not working. for example, this is Ability1 : " &{template:default} {{name=@{selected|character_name} punches}} !modbattr --name Name1 --Initiative|{{Initiative = [[-2]]}}!!! {{hit [[@{selected|Hand}]] = dmg [[@{selected|Hand|max}*@{selected|Strengh}]]}} " work fine and reduce the Initiative attribute by 2, but if I use : " [Ability1](~selected|Ability1) ", everything goes well except that the Initiative attribute isn't lowered. I assume something is wrong with the syntax, maybe the "~" but I can't find the problem. Please, somebody help me.
1563125061
GiGs
Pro
Sheet Author
API Scripter
chatsetattr supports using the # character in place of | to avoid roll query problems. Try going back to your original approach but using # instead of | in the chjatsetattr call.
I already tried with : " ?{Attaque? |  Ability1, &{template:default} {{name=@{selected|character_name} punches}} !modbattr --name Name1 --Initiative#{{Initiative = [[-2]]}}!!! | Ability2,  &{template:default}  {{ [ ...]  } }  }" but it doesn't work, I only have 1 choice and when I try it, it only write the code for the Ability2 as plain text.  I also tried to replace "|" by " | " and "#" by " # " but it didn't work either.
No just replace the | with #
1563136688
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
xavier d. said: I already tried with : " ?{Attaque? |  Ability1, &{template:default} {{name=@{selected|character_name} punches}} !modbattr --name Name1 --Initiative#{{Initiative = [[-2]]}}!!! | Ability2,  &{template:default}  {{ [ ...]  } }  }" but it doesn't work, I only have 1 choice and when I try it, it only write the code for the Ability2 as plain text.  I also tried to replace "|" by " | " and "#" by " # " but it didn't work either. Your problem is a missed set of closing curly braces: ?{Attaque? |  Ability1, &{template:default} {{name=@{selected|character_name} punches}} !modbattr --name Name1 --Initiative#{{Initiative = [[-2]] }} !!! | Ability2, &{template:default} {{ [...] }} 
Thank you so much! It worked!