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 .
×

Generic Macro for NPC mobs

1429768604

Edited 1429770884
Hello, This may be easy but I'm having a hell of a time with it. What I want to do is set up a single macro for all attacks. So I have my attributes listed: HP 26/26 AC 18 BAB 3 Strength 15 Dexterity 12 Constitution 11 Intelligence 9 Wisdom 13 Charisma 7 Weapon_attackbns 2 Weapon_DMG 1d6+3 --------------------------------------------------------------- I want to be able to select the token attacking, say with what weapon (pulled from the Char sheet when i scroll over says weapon1name), then the target and then roll for hit to AC, then roll for damage I think I'm in the neighborhood but can't get over the hump. /emas @{selected|token_name} attacks @{target|token_name} with a {target|token_name} @{selected|token_name} hits vs AC [[1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] or lower for [[@selected|Weapon_DMG]] points Getting SYNTAX error now do i need to turn this into a string? something like: [[name=@{selected|token_name}]] [[attack=1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] [[dmg=@selected|Weapon_DMG}]] [[weapon={target|token_name}]] [[target=@{target|token_name}]] /emas @name attacks @target with their @weapon @name hits vs AC - @attack or lower for @dmg What am I missing here? Thanks in advance
1429769693
Diana P
Pro
Sheet Author
if that's exactly as written, possibly try /emas instead of /esas since the latter does not exist. also, you probably need the selected| in the rest of your attribute calls. ie @{selected|weapon1name} , @{selected|BAB}, etc. Calling the attributes without using selected only works if you're rolling/using a button off of the character sheet.
1429769909

Edited 1429770107
Diana P. said: if that's exactly as written, possibly try /emas instead of /esas since the latter does not exist. also, you probably need the selected| in the rest of your attribute calls. ie @{selected|weapon1name} , @{selected|BAB}, etc. Calling the attributes without using selected only works if you're rolling/using a button off of the character sheet. Thanks the esas was a typo Edited my OP. now getting a SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "@" found.
1429771829
Diana P
Pro
Sheet Author
The damage attribute needs to be [[@{selected|Weapon_DMG}]] instead of [[@selected|Weapon_DMG]] and attacks @{target|token_name} with a {target|token_name} is really attacks @{target|token_name} with a @{selected|weapon1name} , I assume. Not entirely certain what you mean by a string, however.
1429806245

Edited 1429806263
ok thanks for the help, but still getting the Syntax error [[@{selected|token_name}]] attacks @{target|token_name} with a @{selected|weapon1name} [[@{selected|token_name}]] hits vs AC [[1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] or lower for [[@{selected|Weapon_DMG}]] It may help me if you could give me the macro in its entirety as you would write it. I assume it has to do with the brackets
1429809494
Diana P
Pro
Sheet Author
Ok. First off, the square brackets [[ ]] are used to call an inline roll (or to calculate values). You were getting the syntax error because when you put the token name inside the inline-roll call, the computer really doesn't know what you are wanting to roll or calculate. the @{ something } basically just tells the computer to substitute what is in the attribute something for that call. so /emas @{selected|token_name} attacks @{target|token_name} with a @{selected|weapon1name} @{selected|token_name} hits vs AC [[1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] or lower for [[@{selected|Weapon_DMG}]] works for me and gives me the name of the attacker, the name of the victim, the attacker's weapon name, and the ac it hits and damage done. Wiki references used: Macros - <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> Dice rolls - <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a>
Why are you rolling the characters name? remove the double square brackets when you are refering to strings, only use them when you want the value to be parsed by the roll engine. @{selected|token_name} attacks for [[@{selected|Weapon_DMG}
1429810071
Diana P
Pro
Sheet Author
If you want to get a little fancier, you can use the default roll template and your attack would look like: &{template:default} {{name=@{selected|token_name} attacks @{target|token_name} with a @{selected|weapon1name} }} {{hitting AC =[[1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] or lower}} {{damage= [[@{selected|Weapon_DMG}]] }} Basically this macro puts the name (attacker attacks victim with weapon) in a purple field and then lists below pairs of values, in this case hitting AC = XX or lower damage = XX and encloses them all in a nice box so it is easy to determine what goes with what. this could be whispered to the GM: /w gm &{template:default} {{name=@{selected|token_name} attacks @{target|token_name} with a @{selected|weapon1name} }} {{hitting AC =[[1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] or lower}} {{damage= [[@{selected|Weapon_DMG}]] }} if the GM did not wish the players to be able to see the attack. Wiki reference: <a href="https://wiki.roll20.net/Roll_Templates" rel="nofollow">https://wiki.roll20.net/Roll_Templates</a>
Thanks.. very good. Is there a way to pull the AC of the target to see if it hits autmaclly?
1429812198
Diana P
Pro
Sheet Author
Yes You have to make sure that each 'victim' has an AC attribute and could substitute [[{d20+@{selected|BAB}+@{selected|Weapon_attackbns}}&gt;@{target|AC}]] for the attack roll. That calculation will be a 1 if the attack roll is greater than or equal to the target's AC and will be a zero if it is lesser than the target's AC. If you want to see what the attack roll was, you will need to mouse over the number. I also tend to change the wording so it reads something like "hits [[{d20+@{selected|BAB}+@{selected|Weapon_attackbns}}&gt;@{target|AC}]] time for xxxxxx damage" You could also just show the AC of the defender next to your attack [[1d20+@{selected|BAB}+@{selected|Weapon_attackbns}]] or lower vs target AC: @{target|AC}
1429812249

Edited 1429812328
{ 1d20+15 - @{target|AC} }&gt;0 Assumes the target is linked to a character sheet with "AC" defined as an attribute { 1d20+15 - @{target|bar3} }&gt;0 Assumes the target has their AC recorded in bar3 of the token I use the roll - target &gt; 0 method instead of Roll &gt; target because the Success rolls tend to have issues with math on the right-side.
For anyone else, I Just wanted you to know I have modified the above answers and created one that automatically pulls the weapon name. it calculates hits based on basic attack bonus, weapon bonus and enhancement and an optional modifier. (say flank or attack of opportunity). then it calculates damage on specialize and enhancement bonus. &{template:default} {{name=@{selected|token_name} attacks @{target|token_name} with a @{selected|weapon1name} }} {{hitting AC =[[1d20+?{Modifier}+@{selected|bab}+@{selected|weapon1focus}+{selected|weapon1enh}]] or lower}} {{damage= [[@{selected|weapon1specialize}+{selected|weapon1enh}]] }} Target AC: @{target|bar3}
Mark G. said: { 1d20+15 - @{target|AC} }&gt;0 Assumes the target is linked to a character sheet with "AC" defined as an attribute { 1d20+15 - @{target|bar3} }&gt;0 Assumes the target has their AC recorded in bar3 of the token I use the roll - target &gt; 0 method instead of Roll &gt; target because the Success rolls tend to have issues with math on the right-side. Guess I don't know what's the +15 for in your equation?
Just an arbitrary attack bonus for example.