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 .
×
May your rolls be chill this holiday season!
Create a free account

Savage Worlds Shotgun Macro

1605556554

Edited 1605556647
After scouring the internet and piecing together information, I think I put together a pretty solid set of macros for Shotguns in SWADE. The first macro is for a shooting skill roll, pulls the appropriate info from the character sheet, adds in the +2 bonus to hit for shotguns, and asks for any other modifiers. It also has the option to reroll, or roll for damage (which calls the damage macro). The damage macro has you select the target, asks for the range (the shotguns do different damage at different ranges), whether or not their was a raise on the shooting check, and then asks for any damage modifiers. It then calculates how many raises based on the target's toughness. It has worked pretty well so far, but I have a few questions. 1. I'm sure I could have the shooting macro ask for the range, and have that apply the appropriate modifiers to the shooting roll. The question is, can that range selection be passed to the damage roll so it doesn't have to ask for the range again?  2. I'll admit, I haven't really looked for this yet, but since I'm asking questions: Is it possible for the macro to ask for the target, and automatically calculate the range? 3. I started to apply the macro to other weapons, and realized I didn't take into account any possible armor piercing. Is there a way for the damage macro to check for armor, compare the AP to that armor, and adjust the damage accordingly? That might be asking for a lot, but worth a try. Thanks! Shotgun-Attack &{template:roll} {{trait=@{shootingname}}} {{source=Sawed-Off Shotgun}} @{rolltShooting} {{skill_roll=&{noerror} [[ @{shootingSkillRollFormula} + 2 [] ]]}} {{wild_die=[[ @{shootingWildDieFormula} + 2 [] ]]}}@{unshakeTemplate} {{notes=+2 To Hit, +4 Damage If Firing Both Barrells}} {{button=y}} {{ReRoll=[Re-Roll](~Shotgun-Attack)}} {{DmgRoll=[Roll Damage](~Shotgun-Damage) }} Shotgun-Damage &{template:damage} {{name=@{character_name}}} {{source=Sawed-off Shotgun }} {{dmg_rank=Shotgun Blast}} {{dmg_roll=[[ floor({?{Range |Short, [[3d6!!]] |Medium, [[2d6!!]] |Long, [[1d6!!]]}+ ?{Critical?|No, [[0]] |Yes, [[1d6!!]]}+?{Damage Modifiers |0}-@{target|Victim|Toughness}}/4)]] }} {{notes=+4 Damage If Firing Both Barrels}} {{button=y}} {{DmgRoll=[Re-Roll Damage](~Shotgun-Damage)}}
1605558800
GiGs
Pro
Sheet Author
API Scripter
For your first question: yes its possible, but it makes the query much harder to write (you might need to look up advanced roll queries on the wiki). If the range damage modifier can be easily calculated from the range attack modifier, then its easy to do. What are the range mods for attack and damage? For your second question ,range: it's not possible to do this with a macro. It is possible to do it with a custom API script, but very complex, and I havent seen anyone use that approach which is a good indicator of how tricky it is. For your third question, the answer is maybe  - it depends on how AP and armour work.
Range is pretty easy on SWADE. -2 at medium range, -4 at long range. Shotguns do 3d6 damage at short, 2d6 at medium and 1d6 at long range. Then there is also a +4 to damage if someone fires both double barrels at once on a  double barrel shotgun, but that can already be entered manually. If it can pass the range value to the damage attack, then don’t even need to worry about the second option. With Savage World it compares the damage to the targets toughness. The toughness is made up of the characters natural ability, and armor. Some weapons have AP which bypasses armor. So it probably first have to check if the target even has armor, then adjust for the weapons AP, and then calculate damage. I could see issues if i.e. the weapon has more AP than the targets armor value. Seems like it would be easier to just drop the part of the macro that automatically gets the targets toughness, and let the shooter enter the toughness manually.  Thanks for looking!
1605568584
GiGs
Pro
Sheet Author
API Scripter
You could have a query for range on your attack: -(?{Range|short,0|medium,1|long,2}*2) Notice here the subtract sign is before the query, and a *2 is after the query. That allows to do this on damage: (3-?{Range})d6
Oh nice! I’ll give that a try and let you know how it goes. 
1605569924
GiGs
Pro
Sheet Author
API Scripter
That said, I just noticed your damage roll is a separate macro called by a button. Unfortunately macros have no memory - once you finish a macro (print to chat), all query values in the macro are lost. You wont be able to use a single query for range on attak and damage unless you combine them into a single macro, or use a custom API script.
1605597075
Mike deBoston
Compendium Curator
Hi Marcos, Nice work. You can't have the shooting macro pass a value to the damage macro, but maybe you can have the 'shoot-shotgun' shooting macro finish with three links: damage: short - med - long . You put them outside the Roll template. This follows the usual click to shoot, click for damage pattern. Clicking a 2nd link (to me) is more convenient than handling a popup query in a dialog box. It's possible to have a macro read the toughness and AP of a target token, so it could calculate actual wounds for you. I wrote one as part of Deadlands Showdown at Sundown that worked pretty well, but it didn't take into account whether or not the target is shaken. Some people mark their character sheet, some don't, so it didn't seem worth it to me. My macro inputs Damage, AP damage, target Toughness and target Armor and calculates successes and raises.
1605605881

Edited 1605607033
Oosh
Sheet Author
API Scripter
Actually, you can pass a value to the damage roll, but it takes a bit of setup. There are a few ways: 1) API - use chatSetAttr or similar to set the value to an Attribute with the attack roll, then read it back from the damage roll 2) Free - use the turn tracker to store the value (probably needs cooperation from the DM, like a spare token to use as tracker storage) 3) Also free - use the API command button to pass the value through. Example: &{template:default} {{name=Attack Roll}} {{Roll=[[1d20 - ?{Range|Long,5|Medium,3|Short,0}[RANGE]]]}} {{[Roll Damage](~damage?{Range})}} This will create a button link to damage5 (long range damage roll), damage3 (med range damage roll) and damage0 (short range). Or if you want to get really silly, you could embed the entire damage roll (with passed-through values) into the button (all the math is made up): &{template:default} {{name=Attack Roll}} {{Roll=[[1d20 - ?{Range|Long,5|Medium,3|Short,0}[RANGE]]]}} {{[Roll Damage](!
/ooc &{template:default} {{name=Damage Roll}} {{Damage=[[2d6 - [[floor(?{Range}/2)]][RANGE]]]}})}}
Oh man, thanks for the replies. Haven't had a chance to work on the macro yet, but there are some good ideas here