I apologize if this is answered somewhere in the R20 documentation or forums, but I can't find it. I have a custom character sheet. In that sheet, I have a missile attack roll button inside a repeating section that sends its repeating item roll data to a roll template. Pretty standard, nothing fancy (see below). When the attack roll button is clicked, I want ammo to be auto deducted from a field within the repeating item. I understand how the !ammo API script works and am able to wire it up to my repeating row ammo field. I can call the API from a roll button value attribute, but I can't seem to "combine" the API call with the roll template information. Here are two buttons (each inside the repeating section) that each work fine - I want to combine the functionality so I don't have to take any additional, manual action to deduct the ammo: <button type='roll' class='rollbutton' value='!ammo @{selected|character_id} repeating_missile_$0_missile_ammo -1 arrow' name='roll_missile_test'> Test</button>
<button type='roll' class='rollbutton' value='@{whispertoggle} &{template:custom} {{title=@{banner_missile} **Missile Attack Throw**}} {{subtitle=@{character_title} @{selected|token_name}}} {{color=red}} {{Attack/Weapon=@{missile_name}}} {{Target=[[@{attack_throw}+(?{Target AC|0}[target AC])]]}} {{Roll=[[1d20+@{dex_mod}[dex]+@{missile_bonus}[wpn]+?{Range|Short,0|Medium,-2|Long,-5}[range]+@{class_damage_bonus_missile}[class]+@{fss_missile}[fss]-@{fatigue}[fatigue]+(?{Modifier|0}[mod])]]}} {{damage=[[{@{missile_damage}+(@{missile_is_thrown}*@{damage_attr})+(@{class_damage_bonus_missile}[class])-@{fatigue}[fatigue], 0d1+1}k1]]}} {{effects=@{missile_effects}}}' name='roll_missile_attack'> Attack</button> If I can't do what I'm asking, is there any way to do this through a sheet worker function via an action button? Or some other approach that results in, "player clicks button = roll attack and deduct ammo"?