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

Add skill to repeating weapons using SetAttr

I'm trying to add weapons to the Call of Cthulhu 7E character sheet using SetAttr. !setattr --name Daphne Giroust --repeating_weapons_-CREATE_weaponname|Browning HP-35 9mm --repeating_weapons_-CREATE_weaponskill|firearms_handgun --repeating_weapons_-CREATE_weaponrange|15 --repeating_weapons_-CREATE_weaponattacks|1(3) --repeating_weapons_-CREATE_weaponammo|8 --repeating_weapons_-CREATE_weaponmalf|99 This command works fine, except for the weaponskill, which does not get updated. The fieldset is defined as follows: <fieldset class="repeating_weapons"> <table style="width:100%"> <tr> <td style="width:30%"><input style="width:100%;text-align:center" type="text" name="attr_weaponname"/></td> <td style="width:6%"> <button class='old-roll' type='roll' value='&{template:coc-attack} {{name=@{weaponname}}} {{success=[[@{weaponskill}]]}} {{hard=[[floor(@{weaponskill}/2)]]}} {{extreme=[[floor(@{weaponskill}/5)]]}} {{malf=@{weaponmalf}}} {{roll1=[[1d100]]}} {{roll2=[[1d100]]}} {{roll3=[[1d100]]}} {{damage=[[@{weapondamage}@{weapondb}]]}}' name='roll_weaponskill_check' /> <button class='new-roll' type='roll' value='&{template:coc-attack-1} {{name=@{weaponname}}} {{success=[[@{weaponskill}]]}} {{hard=[[floor(@{weaponskill}/2)]]}} {{extreme=[[floor(@{weaponskill}/5)]]}} {{malf=@{weaponmalf}}} {{roll1=[[1d100]]}} {{damage=[[@{weapondamage}@{weapondb}]]}}' name='roll_weaponskill_check' /> </td> <td style="width:16%"> <select style="width:100%" name="attr_weaponskill"> <option value="@{fighting_brawl}" data-i18n="Fighting(Brawl)">Fighting(Brawl)</option> <option value="@{firearms_handgun}" data-i18n="Firarms(HG)">Firarms(HG)</option> <option value="@{firearms_rifle}" data-i18n="Firarms(R/S)">Firarms(R/S)</option> <option value="@{throw}" data-i18n="Throw">Throw</option> <option value="@{dodge}" data-i18n="dodge-z">Dodge</option> <option value="@{otherskill1}" data-i18n="Other Skill #1">Other Skill #1</option> <option value="@{otherskill2}" data-i18n="Other Skill #2">Other Skill #2</option> <option value="@{otherskill3}" data-i18n="Other Skill #3">Other Skill #3</option> <option value="@{otherskill4}" data-i18n="Other Skill #4">Other Skill #4</option> <option value="@{otherskill5}" data-i18n="Other Skill #5">Other Skill #5</option> <option value="@{otherskill6}" data-i18n="Other Skill #6">Other Skill #6</option> <option value="@{repeating_skills_$0_skill}" data-i18n="Other Skill #7">Other Skill #7</option> <option value="@{repeating_skills_$1_skill}" data-i18n="Other Skill #8">Other Skill #8</option> <option value="@{repeating_skills_$2_skill}" data-i18n="Other Skill #9">Other Skill #9</option> <option value="@{repeating_skills_$3_skill}" data-i18n="Other Skill #10">Other Skill #10</option> </select> </td> <td style="width:8%"><input style="width:100%;text-align:right;" type="text" name="attr_weapondamage"/></td> <td style="width:8%"> <select style="width:100%;text-align:left;" name="attr_weapondb"> <option value="+0">+0</option> <option value="+round((@{damage_bonus})/2)">+½db</option> <option value="+@{damage_bonus}">+db</option> </select> </td> <td style="width:8%"><input style="width:100%;text-align:center;" type="text" name="attr_weaponrange"/></td> <td style="width:8%"><input style="width:100%;text-align:center;" type="text" name="attr_weaponattacks"/></td> <td style="width:10%"><input style="width:100%;text-align:center;" type="text" name="attr_weaponammo"/></td> <td style="width:6%"><input style="width:100%;text-align:center;" type="text" name="attr_weaponmalf"/></td> </tr> </table> </fieldset> What value do I put in for the  --repeating_weapons_-CREATE_weaponskill|  piece?
1672818747

Edited 1672818869
Oosh
Sheet Author
API Scripter
I think you want exactly what's in the value attribute of the <option> tag - @{firearms_handguns} This will need to be escaped though, so it isn't parsed before CSA gets hold of it. I can't remember if CSA has its own escapes for those, but normal escaping should work - try this: @{firearms_handguns}
1672826818
GiGs
Pro
Sheet Author
API Scripter
I think CSA has its own alternate characters (like # instead of |) to bypass escaping issues. You'd have to check the help because I don't remember the details.
That didn't work either. I tried each of the following, but the skill does not change. !setattr --name Daphne Giroust --repeating_weapons_-CREATE_weaponname|Browning HP-35 9mm --repeating_weapons_-CREATE_weaponskill|@{firearms_handguns} --repeating_weapons_-CREATE_weaponrange|15 --repeating_weapons_-CREATE_weaponattacks|1(3) --repeating_weapons_-CREATE_weaponammo|8 --repeating_weapons_-CREATE_weaponmalf|99 !setattr --name Daphne Giroust --repeating_weapons_-CREATE_weaponname|Browning HP-35 9mm --repeating_weapons_-CREATE_weaponskill|'\at{firearms_handgun}' --repeating_weapons_-CREATE_weaponrange|15 --repeating_weapons_-CREATE_weaponattacks|1(3) --repeating_weapons_-CREATE_weaponammo|8 --repeating_weapons_-CREATE_weaponmalf|99 I'm having the same issue with range for thrown things. !setattr --name Daphne Giroust --repeating_weapons_-CREATE_weaponname|Hand Grenade(2) --repeating_weapons_-CREATE_weaponskill|"\at{throw}" --repeating_weapons_-CREATE_weaponrange|'\at{selected\|STR}/5)" + --repeating_weapons_-CREATE_weaponattacks|1/2 --repeating_weapons_-CREATE_weaponmalf|99 !setattr --name Daphne Giroust --repeating_weapons_-CREATE_weaponname|Hand Grenade(2) --repeating_weapons_-CREATE_weaponskill|@{throw} --repeating_weapons_-CREATE_weaponrange|'\at{selected\|STR}/5)" + --repeating_weapons_-CREATE_weaponattacks|1/2 --repeating_weapons_-CREATE_weaponmalf|99 Any further suggestions?