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 and Powercards

This works !setattr --charid @{selected|character_id} --ac|[[13 + @{selected|dexterity_mod}]] --silent But this doesn’t:- !power {{   --name|@{character_name} casts Mage Armour   --leftsub|1st Level Abjuration^^Range: Self   --AC 13 + Dexterity Bonus|@{selected|dexterity_mod} = [[ 13 + @{selected|dexterity_mod} ]]   --soundfx|_audio,play,nomenu|Summoning Chant   --api_setattr| _charid @{selected|character_id} _ac|[[13 + @{selected|dexterity_mod}]] _silent   --api_modattr| _charid @{selected|character_id} _lvl1_slots_expended|-1 _silent   --api_token-mod| _ids @{selected|token_id} _set statusmarkers|magearmour }} What am I doing wrong?
1615912678
Andreas J.
Forum Champion
Sheet Author
Translator
IIRC the "selected" info isnt transferred between the APIs. Check out SelectManager API if it can patch that up.
1615913843

Edited 1615913877
JCRP
Pro
Thank you for the tip about SelectManager. I don't think what is selected is the problem though. I think the problem is the specific syntax because it does set the attribute but it sets it as $[[1]] instead of the sum of 13 and the dex mod. I have tried some variations with brackets and the best I've managed is "13+2" it doesn't seem to resolve the sum...
  --api_setattr|_charid @{selected|character_id} _ac|[[13 + @{selected|dexterity_mod}]] _silent  remove the space between the  | and the _
Already tried that. Doesn't work unfortunately. I wonder if it's becuase the double square brackets require a dice roll to resolve? I'm going to try: --api_setattr|_charid @{selected|character_id} _ac|[[ 1d0 + 13 + @{selected|dexterity_mod}]] _silent
Nope. That didn't work either. I think setattr wants just a number.
1615921906
Andreas J.
Forum Champion
Sheet Author
Translator
Can you make the thing work without the selected part, instead targeting a name?
This works (apparently only intermittently!) !power {{  --name|@{character_name} casts Mage Armour  --leftsub|1st Level Abjuration^^Range: Self  --AC 13 + Dexterity Bonus|@{selected|dexterity_mod} = [[ 13 + @{selected|dexterity_mod} ]]  --soundfx|_audio,play,nomenu|Summoning Chant  --api_setattr*1|_charid @{selected|character_id} _ac|15 _silent  --api_modattr*2| _charid @{selected|character_id} _lvl1_slots_expended|-1 _silent  --api_token-mod*3|_ids @{selected|token_id} _set statusmarkers|magearmour }} I think the problem is the pipe in @{selected|dexterity_mod} after ac|... Maybe I can set it by use of a string
Like this... !power {{   --name|@{character_name} casts Mage Armour   --leftsub|1st Level Abjuration^^Range: Self   --AC 13 + Dexterity Bonus|@{selected|dexterity_mod} = [[ [$ac] 1d0 + 13 + @{selected|dexterity_mod} ]]   --soundfx|_audio,play,nomenu|Summoning Chant   --api_setattr1|_charid @{selected|character_id} _ac|^ac _silent   --api_modattr2| _charid @{selected|character_id} _lvl1_slots_expended|-1 _silent   --api_token-mod3|_ids @{selected|token_id} _set statusmarkers|magearmour }} Normal 0 false false false EN-GB X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;}
Nope :( Oh well. The below works anyway. I just don't understand why I can't get it to work  as part of the powercard. !power {{     --name|@{character_name} casts Mage Armour     --leftsub|1st Level Abjuration^^Range: Self     --AC 13 + Dexterity Bonus|@{selected|dexterity_mod} = [[ [$ac] 1d0 + 13 + @{selected|dexterity_mod} ]]     --soundfx|_audio,play,nomenu|Summoning Chant     --api_modattr| _charid @{selected|character_id} _lvl1_slots_expended|-1 _silent     --api_token-mod|_ids @{selected|token_id} _set statusmarkers|magearmour }} !setattr --charid @{selected|character_id} --ac|[[13 + @{selected|dexterity_mod}]] --silent Normal 0 false false false EN-GB X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;}