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

[Pathfinder by Roll20 Sheet] Dropdown Skills macro that uses either ability or skill modifier for NPCs?

Hello all!  So I'm a big fan of dropdown macros for universal ability checks, skill checks and saving throws.  This works fine for Abilities and Saves, but I've run into a bit of a snag with the NPC version of the Pathfinder by Roll20 character sheet. The issue is that skill ability generated by the NPC sheet only works if there's a number in that box that includes the ability. It doesn't automatically include Dexterity in the calculation of Acrobatics for example.  So to use that skill as an example, if an NPC has no ranks or modifiers to Acrobatics beyond their DEX, the ability /r [[1d20+@{selected|acrobatics} is gonna come up with zero if there's a zero in the skill box, even if that NPC has a +5 Dex, let's say.  I'd really prefer not to have to input the Ability scores into every skill box of every NPC I create, and so I was wondering: Is there any magical macro language that can add EITHER an NPC's (in this case) DEX modifier OR its acrobatics modifier, whichever has a number in it? And, say, just one if they're equal?  Maybe there isn't, I have no coding skills or otherwise and haven't a conception of how complex this would be. Sorry in advance if it's a ludicrous idea! Best, T x
1592735505

Edited 1592735545
Oosh
Sheet Author
API Scripter
Using Acrobatics, try this one as an example: @{selected|whispertype} &{template:npc} {{name=^{acrobatics}}} {{type=skill}} {{showchar=@{selected|rollshowchar}}} {{charname=@{selected|character_name}}} {{roll=[[1d20+ [[{@{selected|dexterity_mod},@{selected|acrobatics}}kh1]] [MOD]+@{selected|rollmod_skill}[QUERY]]]}} {{abilitytype=@{selected|acrobatics_notes}}} Quickly tested it with an NPC with 3 Dex/0 Acro, then with 3 Dex/7Acro and it appears to apply the correct bonus. Is this what it should be doing? Does the "7 Acrobatics" on the NPC sheet give you the total, flat skill bonus, or does it still need Dex added on top?
That's amazing Oosh!  Yeah, the skill on the NPC sheet is the total bonus including the ability, so I think this works perfectly for my needs!  Can't thank you enough, what a great community. <3  T x
Hey all,  Coming back for a secondary piece of advice!  I took the roll code so generously provided by Oosh, and inserted it into my existing universal skill macro, but something in it seems to be a bit offm as the dropdown is coming up with an editable text box instead...anyone mind having a butchers and seeing if they can spot what's wrong with it? Again, can't stress enough that I'm basically copying and pasting, I do NOT know what I'm doing XD @{selected|whispertype} &{template:default} {{name=Skill Check}} {{?{Choose a Skill<br>(* training not required)| *Acrobatics, Acrobatics = [[1d20 + [[{@{selected|dexterity_mod},@{selected|acrobatics}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Appraise, Appraise=[[1d20+ [[{@{selected|intelligence_mod},@{selected|appraise}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Bluff, Bluff=[[1d20+ [[{@{selected|charisma_mod},@{selected|bluff}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Climb, Climb=[[1d20+ [[{@{selected|strength_mod},@{selected|climb}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Craft, Craft=[[1d20+ [[{@{selected|intelligence_mod},@{selected|craft}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Diplomacy, Diplomacy=[[1d20+ [[{@{selected|charisma_mod},@{selected|diplomacy}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Disable Device, Disable Device=[[1d20+ [[{@{selected|dexterity_mod},@{selected|disable_device}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Disguise, Disguise=[[1d20+ [[{@{selected|charisma_mod},@{selected|disguise}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Escape Artist, Escape Artist=[[1d20+ [[{@{selected|dexterity_mod},@{selected|escape_artist}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Fly, Fly=[[1d20+ [[{@{selected|dexterity_mod},@{selected|fly}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Handle Animal, Handle Animal=[[1d20+ [[{@{selected|wisdom_mod},@{selected|handle_animal}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Heal, Heal=[[1d20+ [[{@{selected|wisdom_mod},@{selected|heal}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Intimidate, Intimidate=[[1d20+ [[{@{selected|charisma_mod},@{selected|intimidate}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Arcana, Knowledge Arcana=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_arcana}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Dungeoneering, Knowledge Dungeoneering=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_dungeoneering}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Engineering, Knowledge Engineering=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_engineering}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Geography, Knowledge Geography=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_geography}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge History, Knowledge History=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_history}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Local, Knowledge Local=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_local}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Nature, Knowledge Nature=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_nature}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Nobility, Knowledge Nobility=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_nobility}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Planes, Knowledge Planes=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_planes}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Knowledge Religion, Knowledge Religion=[[1d20+ [[{@{selected|intelligence_mod},@{selected|knowledge_religion}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Linguistics, Linguistics=[[1d20+ [[{@{selected|intelligence_mod},@{selected|linguistics}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Perception, Perception=[[1d20+ [[{@{selected|wisdom_mod},@{selected|perception}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Perform, Perform=[[1d20+ [[{@{selected|charisma_mod},@{selected|perform}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Profession, Profession=[[1d20+ [[{@{selected|intelligence_mod},@{selected|profession}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Ride, Ride=[[1d20+ [[{@{selected|dexterity_mod},@{selected|ride}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Sense Motive, Sense Motive=[[1d20+ [[{@{selected|wisdom_mod},@{selected|sense_motive}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Sleight of Hand, Sleight of Hand=[[1d20+ [[{@{selected|dexterity_mod},@{selected|sleight_of_hand}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Spellcraft, Spellcraft=[[1d20+ [[{@{selected|intelligence_mod},@{selected|spellcraft}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Stealth, Stealth=[[1d20+ [[{@{selected|dexterity_mod},@{selected|stealth}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Survival, Survival=[[1d20+ [[{@{selected|wisdom_mod},@{selected|survival}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] | *Swim, Swim=[[1d20+ [[{@{selected|strength_mod},@{selected|swim}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]] |  Use Magic Device, Use Magic Device=[[1d20+ [[{@{selected|charisma_mod},@{selected|use_magic_device}}kh1]][MOD]+@{selected|rollmod_skill}[QUERY]]]}}}   T x
1592855556
GiGs
Pro
Sheet Author
API Scripter
That will need html entity replacements, as described here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> If youre lucky, copying it out into notepad, doing a find and replace on the whole thing (terms below), should fix it: Find: }}kh1 Replace: }&amp;#125;kh1 Bear in mind, if this works, it's best to save it as an ability on a character sheet. If you save it as a Macro, and ever &nbsp;reopen it, all the html entities will be removed, and you''ll have to do the replace again.
1592855677
GiGs
Pro
Sheet Author
API Scripter
Oh, you also need to replace commas inside the kh function, so Find: _mod},@{selected Replace: _mod}&amp;#44;@{selected
1592855771
GiGs
Pro
Sheet Author
API Scripter
There's some weird syntax in there - all the &amp;nbsp;* for instance. What purpose do they serve? You can probably remove them.
Thank you GiGs! I’ve no idea what the odd syntax means, it was simply in the macro I had copied; I’ll get rid of it and action your other advice tomorrow and post an update on the results.&nbsp; Appreciate your response, T x
1592867416
GiGs
Pro
Sheet Author
API Scripter
Good luck :)
It's worked! The only outlier now is when an NPC has a negative skill modifier, and frankly I don't see that coming up enough for me to worry about it in this macro.&nbsp; Thanks to everyone who helped with this! Means a lot, and means I can now create NPCs knowing I can call up their skills effortlessly. Brilliant. ^_^ T x
1592909940
Oosh
Sheet Author
API Scripter
Nice one, you survived the HTML replacement hazing ritual!