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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Macro help] skill check and storing variable/strings?

January 22 (9 years ago)

Edited January 22 (9 years ago)
[resolved]
I want to make a macro (3.5) to draw up skills from a character sheet, without needing to make all the skills separately, or pull up the character sheet for everything.
Is there anyway to ask for part of a macro, or nest commands to do so?
Here's what I tried, which didn't work: @{bob|?{skill}check} I tried asking for a variable, before trying to put it in, but I couldn't get it to store anything.
using bob for the character sheet name
You can't nest an attribute call like that, unfortunately.  After prompting you for text,  It would only return the text you entered, not further process the text as part of an attribute call.

What I generally do for PF and 5e is create "groupings" of skills.  ie:  I create a macro that displays all Knowledge Checks(arcana, nature, etc) , another one that shows all Physical Checks (climb, swim, acrobatics, ride, etc), and so on.    I typically bundle them all under a Drop-Down query so I have a single button for all skill checks and choose the grouping from a list, but that's probably more ambitious than you're looking for at this stage.


January 22 (9 years ago)

Edited January 22 (9 years ago)

Daniel W. said:hr

Here's what I tried, which didn't work: @{bob|?{skill}check}

The order of operations dictates that Attribute calls must be parsed before Roll Queries.

The Shaped Character Sheet for D&D 5E has a built in Roll Query macro for ability checks; you may be able to adapt it.
January 22 (9 years ago)
Diana P
Pro
Sheet Author
Saving throws:
&{template:DnD35StdRoll}{{name=@{selected|character_name} }} {{saveflag=true}} ?{Which resistance?|Fortitude ,{{subtags=braces against the attack}} {{check=Fortitude check:}} {{checkroll= [[1d20 + [[@{selected|fortitude}]] ]]}} {{notes=@{selected|fortitudenote} }}|Reflex ,{{subtags=tries to dodge}} {{check=Reflex check:}} {{checkroll= [[1d20 + [[@{selected|reflex}]] ]]}} {{notes=@{selected|reflexnote} }}|Will ,{{subtags=tries to resist}} {{check=Will check:}} {{checkroll= [[1d20 + [[@{selected|will}]] ]]}} {{notes=@{selected|willnote} }} }

Ability stat checks:
&{template:DnD35StdRoll} {{abilityflag=true}} {{name=@{selected|character_name} }} {{check=}} {{checkroll= ?{Which Stat?|Strength,Strength check: [[1d20 + [[@{selected|str-mod}]] ]] |Dexterity,Dexterity check: [[1d20 + [[@{selected|dex-mod}]] ]] |Constitution,Constitution check: [[1d20 + [[@{selected|con-mod}]] ]] |Intelligence,Intelligence check: [[1d20 + [[@{selected|int-mod}]] ]] |Wisdom,Wisdom check: [[1d20 + [[@{selected|wis-mod}]] ]] |Charisma,Charisma check: [[1d20 + [[@{selected|cha-mod}]] ]] } }}

Knowledge checks:
/w gm &{template:DnD35StdRoll} {{checkroll= ?{Which skill?|Knowledge (Arcana), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Arcana)* check: [[1d20 + [[@{knowarcana}]] ]] |Knowledge (Engineering), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Engineering)* check: [[1d20 + [[@{knowengineer}]] ]] |Knowledge (Dungeoneering), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Dungeoneering)* check: [[1d20 + [[@{knowdungeon}]]; ]] |Knowledge (Geography), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Geography)* check: [[1d20 + [[@{knowgeography}]] ]] |Knowledge (History), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (History)* check: [[1d20 + [[@{knowhistory}]] ]] |Knowledge (Local), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Local)* check: [[1d20 + [[@{knowlocal}]] ]] |Knowledge (Nature), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Nature)* check: [[1d20 + [[@{knownature}]] ]] |Knowledge (Nobility), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Nobility)* check: [[1d20 + [[@{knownobility}]] ]] |Knowledge (Religion), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (Religion)* check: [[1d20 + [[@{knowreligion}]] ]] |Knowledge (The Planes), [Knowledge](http://www.dandwiki.com/wiki/SRD:Knowledge_Skill ) (The Planes)* check: [[1d20 + [[@{knowplanes}]] ]] } }} {{skillflag=true}} {{name=@{selected|character_name}}} {{check= }}

Other skill checks: (this is a long one)
?{Which skill?|Appraise,/w gm &{template:DnD35StdRoll} {{checkroll=[Appraise](http://www.dandwiki.com/wiki/SRD:Appraise_Skill ) check: [[1d20 + [[@{appraise}]] ]] }} |Balance,&{template:DnD35StdRoll} {{checkroll=[Balance](http://www.dandwiki.com/wiki/SRD:Balance_Skill ) check: [[1d20 + [[@{balance}]] ]] }} |Bluff,/w gm &{template:DnD35StdRoll} {{checkroll=[Bluff](http://www.dandwiki.com/wiki/SRD:Bluff_Skill ) check: [[1d20 + [[@{bluff}]] ]] }} |Climb,&{template:DnD35StdRoll} {{checkroll=[Climb](http://www.dandwiki.com/wiki/SRD:Climb_Skill ) check: [[1d20 + [[@{climb}]] ]] }} |Concentration,/w gm &{template:DnD35StdRoll} {{checkroll=[Concentration](http://www.dandwiki.com/wiki/SRD:Concentration_Skill ) check: [[1d20 + [[@{concentration}]] ]] }} |Craft (@{craft1name}),&{template:DnD35StdRoll} {{checkroll=[Craft](http://www.dandwiki.com/wiki/SRD:Craft_Skill ) (@{craft1name}) check: [[1d20 + [[@{craft1}]] +(?{Artisan's Tools? |Masterwork,1 |No,-1 |Normal,0 }*2)[Tool Circumstance Bonus] ]] }} |Craft (@{craft2name}),&{template:DnD35StdRoll} {{checkroll=[Craft](http://www.dandwiki.com/wiki/SRD:Craft_Skill ) (@{craft2name}) check: [[1d20 + [[@{craft2}]] +(?{Artisan's Tools? |Masterwork,1 |No,-1 |Normal,0 }*2)[Tool Circumstance Bonus] ]] }} |Craft (@{craft3name}),&{template:DnD35StdRoll} {{checkroll=[Craft](http://www.dandwiki.com/wiki/SRD:Craft_Skill ) (@{craft3name}) check: [[1d20 + [[@{craft3}]] +(?{Artisan's Tools? |Masterwork,1 |No,-1 |Normal,0 }*2)[Tool Circumstance Bonus] ]] }} |Decipher Script,/w gm &{template:DnD35StdRoll} {{checkroll=[Decipher Script*](http://www.dandwiki.com/wiki/SRD:Decipher_Script_Skill ) check: [[1d20 + @{decipherscript} ]]}}  {{notes=If fail, [[1d20 + @{wis-mod} ]] vs dc5 to avoid drawing a false conclusion.}} |Diplomacy,/w gm &{template:DnD35StdRoll} {{checkroll=[Diplomacy](http://www.dandwiki.com/wiki/SRD:Diplomacy_Skill ) check: [[1d20 + [[@{diplomacy}]] ]] }} |Disable Device,/w gm &{template:DnD35StdRoll} {{checkroll=[Disable Device*](http://www.dandwiki.com/wiki/SRD:Disable_Device_Skill ) check: [[1d20 + [[@{disabledevice}]] ]] }} |Disguise,/w gm &{template:DnD35StdRoll} {{checkroll=[Disguise](http://www.dandwiki.com/wiki/SRD:Disguise_Skill ) check: [[1d20 + [[@{disguise}]] ]] }} |Escape Artist,&{template:DnD35StdRoll} {{checkroll=[Escape Artist](http://www.dandwiki.com/wiki/SRD:Escape_Artist_Skill ) check: [[1d20 + [[@{escapeartist}]] ]] }} |Forgery,/w gm &{template:DnD35StdRoll} {{checkroll=[Forgery](http://www.dandwiki.com/wiki/SRD:Forgery_Skill ) check: [[1d20 + [[@{forgery}]] ]] }} |Gather Information,/w gm &{template:DnD35StdRoll} {{checkroll=[Gather Information](http://www.dandwiki.com/wiki/SRD:Gather_Information_Skill ) check: [[1d20 + [[@{gatherinformation}]] ]] }} |Handle Animal,&{template:DnD35StdRoll} {{checkroll=[Handle Animal*](http://www.dandwiki.com/wiki/SRD:Handle_Animal_Skill ) check: [[1d20 + [[@{handleanimal}]] ]] }} |Heal,/w gm &{template:DnD35StdRoll} {{checkroll=[Heal](http://www.dandwiki.com/wiki/SRD:Heal_Skill ) check: [[1d20 + [[@{heal}]] +(?{Healer's Kit? |No,0 |Yes,1}*2)[Healer's Kit Circumstance Bonus] ]] }} |Hide,/w gm &{template:DnD35StdRoll} {{checkroll=[Hide](http://www.dandwiki.com/wiki/SRD:Hide_Skill ) check: [[1d20 + [[@{hide}]] ]] }} |Intimidate,/w gm &{template:DnD35StdRoll} {{checkroll=[Intimidate](http://www.dandwiki.com/wiki/SRD:Intimidate_Skill ) check: [[1d20 + [[@{intimidate}]] ]] }} |Jump,&{template:DnD35StdRoll} {{checkroll=[Jump](http://www.dandwiki.com/wiki/SRD:Jump_Skill ) check: [[1d20 + [[@{jump}]] ]] }} |Listen,/w gm &{template:DnD35StdRoll} {{checkroll=[Listen](http://www.dandwiki.com/wiki/SRD:Listen_Skill ) check: [[1d20 + [[@{listen}]] ]] }} |Move Silently,/w gm &{template:DnD35StdRoll} {{checkroll=[Move Silently](http://www.dandwiki.com/wiki/SRD:Move_Silently_Skill ) check: [[1d20 + [[@{movesilent}]] ]] }} |Open Lock,/w gm &{template:DnD35StdRoll} {{checkroll=[Open Lock*](http://www.dandwiki.com/wiki/SRD:Open_Lock_Skill ) check: [[1d20 + [[@{openlock}]] +(?{Thieves' Tools?|No,-1 |Normal,0 |Masterwork,1}*2))[Tool Circumstance Bonus] ]] }} |Perform (@{perform1name}),&{template:DnD35StdRoll} {{checkroll=[Perform](http://www.dandwiki.com/wiki/SRD:Perform_Skill ) (@{perform1name}) check: [[1d20 + [[@{perform1}]] +(?{Masterwork Instrument? |No,0 |Yes,1}*2)[Instrument Circumstance Bonus] ]] }} |Perform (@{perform2name}),&{template:DnD35StdRoll} {{checkroll=[Perform](http://www.dandwiki.com/wiki/SRD:Perform_Skill ) (@{perform2name}) check: [[1d20 + [[@{perform2}]] +(?{Masterwork Instrument? |No,0 |Yes,1}*2)[Instrument Circumstance Bonus] ]] }} |Perform (@{perform3name}),&{template:DnD35StdRoll} {{checkroll=[Perform](http://www.dandwiki.com/wiki/SRD:Perform_Skill ) (@{perform2name}) check: [[1d20 + [[@{perform3}]] +(?{Masterwork Instrument? |No,0 |Yes,1}*2)[Instrument Circumstance Bonus] ]] }} |Profession (@{profession1name}),&{template:DnD35StdRoll} {{checkroll=[Profession](http://www.dandwiki.com/wiki/SRD:Profession_Skill ) (@{profession1name})* check: [[1d20 + [[@{profession1}]] ]] }} |Profession (@{profession2name}),&{template:DnD35StdRoll} {{checkroll=[Profession](http://www.dandwiki.com/wiki/SRD:Profession_Skill ) (@{profession2name})* check: [[1d20 + [[@{profession2}]] ]] }} |Profession (@{profession3name}),&{template:DnD35StdRoll} {{checkroll=[Profession](http://www.dandwiki.com/wiki/SRD:Profession_Skill ) (@{profession3name})* check: [[1d20 + [[@{profession3}]] ]] }} |Ride,&{template:DnD35StdRoll} {{checkroll=[Ride](http://www.dandwiki.com/wiki/SRD:Ride_Skill ) check: [[1d20 + [[@{ride}]] ]] }} |Search,/w gm &{template:DnD35StdRoll} {{checkroll=[Search](http://www.dandwiki.com/wiki/SRD:Search_Skill ) check: [[1d20 + [[@{search}]] ]] }} |Sleight of Hand,/w gm &{template:DnD35StdRoll} {{checkroll=[Sleight of Hand*](http://www.dandwiki.com/wiki/SRD:Sleight_of_Hand_Skill ) check: [[1d20 + [[@{sleightofhand}]] ]] }} |Spellcraft,/w gm &{template:DnD35StdRoll} {{checkroll=[Spellcraft*](http://www.dandwiki.com/wiki/SRD:Spellcraft_Skill ) check: [[1d20 + [[@{spellcraft}]] ]] }} |Spot,/w gm &{template:DnD35StdRoll} {{checkroll=[Spot](http://www.dandwiki.com/wiki/SRD:Spot_Skill ) check: [[1d20 + [[@{spot}]] ]] }} |Survival,&{template:DnD35StdRoll} {{checkroll=Survival check: [[1d20 + [[@{survival}]] ]] }} |Swim,&{template:DnD35StdRoll} {{checkroll=[Swim](http://www.dandwiki.com/wiki/SRD:Swim_Skill ) check: [[1d20 + [[@{swim}]] ]] }} |Tumble,&{template:DnD35StdRoll} {{checkroll=[Tumble*](http://www.dandwiki.com/wiki/SRD:Tumble_Skill ) check: [[1d20 + [[@{tumble}]] ]] }} |Use Magic Device,/w gm &{template:DnD35StdRoll} {{checkroll=[Use Magic Device*](http://www.dandwiki.com/wiki/SRD:Use_Magic_Device_Skill ) check: [[1d20 + [[@{usemagicdevice}]] ]] }} |Use Rope,/w gm &{template:DnD35StdRoll} {{checkroll=[Use Rope](http://www.dandwiki.com/wiki/SRD:Use_Rope_Skill ) check: [[1d20 + [[@{userope}]] ]] }} } {{skillflag=true}} {{name=@{selected|character_name}}} {{check= }}

The first 4 slots of the attacks (you'll have to continue copy/pasting and adjusting attack slots if you need more; add to the {{notes= }&125; section if you want notes about something for that weapon. ):
&{template:DnD35Attack} {{pcflag=true}} {{fullattackflag=[[?{Full Attack?|No, 0d1|Yes, d1}]]}} {{name=@{character_name}}} ?{Flank|No, 0|Yes, 1} ?{Other Attack Bonus|0} ?{Other Damage Bonus|0} {{fumbleroll=**Fumble:[[d20]]**}} ?{Which weapon? |@{weapon1name}, {{subtags=swings a @{weapon1name} }} {{attack1=A1:[[@{weapon1attackcalc|max} ]] }} {{critconfirm1=Crit?:[[@{weapon1attackcalc|max} ]] }} {{damage1=D1:[[@{weapon1damage|max} ]] }} {{critdmg1=+[[@{weapon1damage|max} ]] }} {{attack2=A2:[[@{weapon1attackcalc|max}-5 ]] }} {{critconfirm2=Crit?:[[@{weapon1attackcalc|max}-5 ]] }} {{damage2=D2:[[@{weapon1damage|max} ]] }} {{critdmg2=+[[@{weapon1damage|max} ]] }} {{notes= }} |@{weapon2name}, {{subtags=swings a @{weapon2name} }} {{attack1=A1:[[@{weapon2attackcalc|max} ]] }} {{critconfirm1=Crit?:[[@{weapon2attackcalc|max} ]] }} {{damage1=D1:[[@{weapon2damage|max} ]] }} {{critdmg1=+[[@{weapon2damage|max}]] }} {{attack2=A2:[[@{weapon2attackcalc|max}-5]] }} {{critconfirm2=Crit?:[[@{weapon2attackcalc|max}-5]] }} {{damage2=D2:[[@{weapon2damage|max} ]] }} {{critdmg2=+[[@{weapon1damage|max}]] }} {{notes= }} |@{weapon3name}, {{subtags=swings a @{weapon3name} }} {{attack1=A1:[[@{weapon3attackcalc|max} ]] }} {{critconfirm1=Crit?:[[@{weapon3attackcalc|max} ]] }} {{damage1=D1:[[@{weapon3damage|max} ]] }} {{critdmg1=+[[@{weapon3damage|max}]] }} {{attack2=A2:[[@{weapon3attackcalc|max}-5 ]] }} {{critconfirm2=Crit?:[[@{weapon3attackcalc|max}-5]] }} {{damage2=D2:[[@{weapon3damage|max}]] }} {{critdmg2=+[[@{weapon3damage|max}]] }} {{notes= }} |@{weapon4name}, {{subtags=swings a @{weapon4name} }} {{attack1=A1:[[@{weapon4attackcalc|max}]] }} {{critconfirm1=Crit?:[[@{weapon4attackcalc|max}]] }} {{damage1=D1:[[@{weapon4damage|max}]] }} {{critdmg1=+[[@{weapon4damage|max} ]] }} {{attack2=A2:[[@{weapon4attackcalc|max}-5]] }} {{critconfirm2=Crit?:[[@{weapon4attackcalc|max}-5]] }} {{damage2=D2:[[@{weapon4damage|max}]] }} {{critdmg2=+[[@{weapon4damage|max} ]] }} {{notes= }} }

You can also do spells, but it's a bit more difficult since you basically need to recreate them entirely in the macro and you have to keep on top of substituting the commas etc for html entities (or re-write to remove such) to get them to work.  Here's a Choose a Cure Spell macro:
&{template:DnD35StdRoll} {{spellflag=true}} {{name=@{character_name} }} {{check=**@{target|token_name}** receives }}  ?{Which Cure? |Moderate, {{subtags=casts [Cure Moderate Wounds](http://www.dandwiki.com/wiki/SRD:Cure_Moderate_Wounds ). }} {{checkroll= [[2d8+[[{@{casterlevel},10}dh1]] ]] heath. }} |Minor, {{subtags=casts [Cure Minor Wounds](http://www.dandwiki.com/wiki/Cure_minor_wounds ). }} {{checkroll= [[1d1]] heath.  }} |Light, {{subtags=casts [Cure Light Wounds](http://www.dandwiki.com/wiki/SRD:Cure_Light_Wounds ). }} {{checkroll= [[1d8+[[{@{casterlevel},5}dh1]] ]] heath. }} |Serious, {{subtags=casts [Cure Serious Wounds](http://www.dandwiki.com/wiki/SRD:Cure_Serious_Wounds ). }} {{checkroll= [[3d8 +[[{@{casterlevel},15}dh1]] ]] heath.  }} |Critical, {{subtags=casts [Cure Critical Wounds](http://www.dandwiki.com/wiki/SRD:Cure_Critical_Wounds ). }} {{checkroll= [[4d8 +[[{@{casterlevel},20}dh1]] ]] heath.  }} } {{notes=Undead creatures take damage instead of gaining healing; DC [[10+5 +[[@{wis-mod}]] ]] Will save for half damage; caster level check = [[1d20+@{casterlevel}+@{spellpen}]] vs spell resistance. }}

The bit gotchas are the fact that you have to substitute html entities (&amp) for things like &, }, commas, and a few other symbols to keep the query from breaking.  See more: https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries

January 22 (9 years ago)
Diana P
Pro
Sheet Author
Oh.  And I forgot to mention, save these as Character Sheet Abilities.  Otherwise you'll need to add a selected| or target| to each of the attribute calls.

Hope that helps.

Diana P said:

Oh.  And I forgot to mention, save these as Character Sheet Abilities.  Otherwise you'll need to add a selected| or target| to each of the attribute calls.

Hope that helps.

Thank you!
January 22 (9 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
Here you go Daniel, the wiki will tell you all you need to know.
Ziechael said:
Here you go Daniel, the wiki will tell you all you need to know.
If you were referring to my last post; thanks, but I just figured it out myself :D, I just misunderstood what he meant by abilities.
January 23 (9 years ago)
Hi Daniel W. since you changed this to resolved above, I will go ahead and close the thread. Thanks!