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

How do i make an attack macro for the 5e ogl sheet that auto levels with the sheet?

Having a problem changing all the macros in my game everytime someone levels up. Is there a way to make at least make the attack and damage macros level up with the player?
Here is the macro i am currently using for a 5th level ranger for his longsword. @{Alwyn Taleraed |wtype}&{template:atkdmg} {{mod=+5}} {{rname=Longsword}} {{r1=[[@{Alwyn Taleraed |d20}cs>20 + 3[STR] + 3[PROF]]]}} @{Alwyn Taleraed |rtype}cs>20 + 3[STR] + 3[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 3[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=Slashing }} {{crit1=[[2d8[CRIT]]]}} {{crit2=[[1d10[CRIT]]]}} 0 {{desc=}}   {{spelllevel=}} {{innate=}} {{globalattack=@{Alwyn Taleraed |global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Alwyn Taleraed |global_damage_mod_type}}} ammo= @{Alwyn Taleraed |charname_output}
1536547468
Tetsuo
Forum Champion
You can use @{strength_mod} and @{pb} to pull those numbers from the sheet on roll, instead of putting numbers in the macro itself
Thanks Frank but the plan is to use this macro for all character classes and monsters.
1536551929
Tetsuo
Forum Champion
For players, you simply replace @{strength_mod} with whatever attribute you want to use for hits and damage. @{pb} will pull the proficiency bonus for being a certain level, as long as the referring sheet has the level filled out. Those will both level up with the player. For monsters, they don't have a level, but you can use  %{selected|repeating_npcaction_$0_npc_action}  to call the first action on the sheet. Likewise,  %{selected|repeating_npcaction_$1_npc_action}  will call the 2nd action listed on the sheet. Since monsters don't level up, theres no scaling to add to their attack rolls
Are they check boxes on the sheet somewhere? If so how reliable would this be when they update the sheets in the future. I have had to do too much work to fix my game in the past with new updates to the sheet.
1536559743
Tetsuo
Forum Champion
Both things mentioned will persist through sheet updates since they are a core part of how the sheet works. 
I would love to see if this works but i don't know where to find what you are talking about on the character sheet
1536663158
Mik Holmes
Pro
Marketplace Creator
I think he means, in your macro, change the text that says:  3[STR] + 3[PROF] to: @{strength_mod} + @{pb}
1536668215
Tetsuo
Forum Champion
That’s exactly what I mean Mik. Sorry for not being clear :D By default, any macro on the sheet will scale with level in regards to proficiency bonus. If you’re looking to write custom macros, @{pb} will call the current bonus from the sheet based on what the level field says, and @{ability_mod} will call the appropriate ability modifier from the sheet. For example 1d20+@{pb}+@{strength_mod} will roll a d20 and add the modifiers based on what’s on the sheet. You’ll never need to replace those modifiers, as they’ll change as the sheet changes. 
So @{strength_mod} will use whatever ability is used for the character class say dexterity for the ranger when using a bow or do i need to put @{ability_mod} instead in order for it to use the right ability from the sheet?
Remember i said i wanted this to be as universal as possible so i can write one custom macro for all.
@{Alwyn Taleraed |wtype}&{template:atkdmg} {{mod=+5}} {{rname=Longsword}} {{r1=[[@{Alwyn Taleraed |d20}cs>20 + @{strength_mod} + @{pb} ]]}} @{Alwyn Taleraed |rtype}cs>20 + @{strength_mod} + @{pb} ]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + @{strength_mod} ]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=Slashing }} {{crit1=[[2d8[CRIT]]]}} {{crit2=[[1d10[CRIT]]]}} 0 {{desc=}}   {{spelllevel=}} {{innate=}} {{globalattack=@{Alwyn Taleraed |global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Alwyn Taleraed |global_damage_mod_type}}} ammo= @{Alwyn Taleraed |charname_output} Here is the new code and it isn't working says  TypeError: Cannot read property 'substring' of undefined
1536703377

Edited 1536703468
Tetsuo
Forum Champion
Replace @{pb} with @{Alwyn Taleraed |pb} and likewise for strength mod. @{strength_mod} will pull the strength mod. If you need the dex mod, you would need to replace it with @{dexterity_mod}. I highly recommend reading up on the basics of building macros.&nbsp; <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a>
1536703420

Edited 1536703654
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm not terribly familiar with the OGL sheet, but it looks like you at least need to delete the space after the character name but before the pipe in all instances. You are also unlikely to be able to write one macro that does every possible attack for every character and monster. When you say this, do you mean a template for every attack, that can have the variables re-written each time you write it (character name, attack name, etc.)? That sounds like infinitely more work than writing a handful of generic macros that read values from a character sheet. For instance, Franky's macro above: %{selected|repeating_npcaction_$0_npc_action} will work for whatever monster you have selected. One macro, on a button, and you are done for all monsters. There are ways you could expand this to call each action in turn.
Thanks Keith for the explanation. I will settle for one attack macro for just the PC's then. I tried the formula above and it works but i can't tell what bonuses are what from hovering over the die roll. With my players this is extremely important.