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

Need Help with Weird Knowledge Macro

I'm trying to set up a macro, not sure if its doable in roll 20. (System is pathfinder, using the community roll 20 sheets for what that's worth) Basically, when a player is faced with a creature, I want to ask them to make an "identify roll." This roll would be a d20, but then each knowledge skill would be added to that same roll. So say the person had a +1 to Arcana, +2 to Dungeoneering, +3 to Engineering, etc. etc, and they rolled a 10. The table would display "Arcana = 11, Dungeoneering = 12, Engineering = 13," etc. etc. The purpose of this is so they player knows if they rolled well or not, but isn't given a hint as to what type of creature it is. Right now I just use a macro where it rolls every single knowledge and puts them in a table (image attached below, W is my placeholder for a sheet name) which is alright, but I'd prefer that instead of rolling for each knowledge, 1 roll is made and the roll is modified for each knowledge type. Any help would be amazing, thanks
1577832092
Ziechael
Forum Champion
Sheet Author
API Scripter
Without using the API you are best off having the table start with a flat d20 roll as the base, then have each section as you have now but without the d20 roll in it, and put a + before the inline attribute call so that some basic mental arithmetic is needed but the mystery remains. Effectively: Knowledge Roll [[1d20]] Arcana: +[[@{arcana}]] Dungeoneering: +[[@{dungeoneering}]] etc etc
1577832150
Kraynic
Pro
Sheet Author
Due to not being able to store a value (dice roll) and use it in multiple independent calculations, this isn't possible through a macro.  It is probably possible through the api, though I'm not sure if there are any that already exist that do this.
1577832582

Edited 1577833013
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Put in a dropdown query with one result: ?{Roll|0} then whenever you need to reference the results, use: ...{{Arcana=[[?{Roll}+@{W|Knoweledge-Arcana}]]}}... They will have to input the d20 result manually (but only once), since  ?{Roll}  returns whatever was returned for the first use of the dropdown query, and if that was a dice expression, it will use the expression each time, giving random results.
Yeah I don't even know where to search under API's for this, but oh well. @Ziechael your solution should work (And if I'm being honest, it'll probably be good for my god awful mental math to get some practice) Thanks 'yall
@Keithcurtis that will probably work for me, I'll have to try it out to see if that's something that works for my players. Thanks!
1577836798
GiGs
Pro
Sheet Author
API Scripter
This would be a pretty easy task for a custom script, especially since you are using the default roll template which simplifies formatting. I could whip this up for you. How do you plan to identify the character that is using the script? Hardcoded names, using selected or target, or a preset list of character names? Your macro is using /w gm; is this just for your use, or do the players get to see the results?
1577869089

Edited 1577869128
GiGs
Pro
Sheet Author
API Scripter
At the bottom of this post is a (very) quick and dirty script to output a players roll for a group of skills.  Call it with a macro like this: !groupskills @{selected|character_id} Knowledges [[1d20]] Arcana|Knowledge-Arcana Dungeoneering|Knowledge-Dungeoneering History|Knowledge-History !wgroupskills @{Frodo|character_id} Knowledge-Skills  [[1d20]] Arcana|Knowledge-Arcana Dungeoneering|Knowledge-Dungeoneering History|Knowledge-History It is in the format !scriptname characterID HEADER roll [List of Skills] !groupskills or !wgroupskills: start with one of these. If wgroupskills , it will whisper to the person who triggered the macro. characterid:  this can be gained with selected, target, or by name, and is the character whose skills you want to test. HEADER:  a title for the output. It will automatically start with character name, and then this text.     If you want to use more than one word, replace any spaces with dashes as in the second example above. On output, those dashes will be replaced with spaces. Roll:  the roll you want to compare every skill to.  Skill List:  a list of skills each of which has two parts: the label you want to see in the output, and the attribute name on the character sheet that contains its value. Separate these with a pipe (|).     You can include any number of skills.  IMPORTANT:  this script has no error checking, so make sure you enter everything in the order above, separated by spaces. on('ready', () => { 'use strict'; const getRoll = (rolls, n) => (rolls && n < rolls.length) ? rolls[n].results.total : 0; on('chat:message', (msg) => { if (msg.type == 'api' && (msg.content.startsWith('!groupskills') || msg.content.startsWith('!wgroupskills'))) { const who=(getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname'); const whisper = msg.content.startsWith('!wgroupskills') ? `/w ${who} ` : ''; let args = msg.content.split(/\s+/); args.shift(); const targetid = args.shift(); const header = args.shift().replace(/-/gi,' '); const roll = +getRoll(msg.inlinerolls, 0) || 0; args.shift(); let skills = []; args.forEach(which => { let skill = which.split('|'); skills.push(`{{${skill[0]}=${roll + getAttrByName(targetid,skill[1],'current')}}}`); }); const output = `${whisper}&{template:default} {{name=${getAttrByName(targetid,'character_name','current')} ${header}}} {{Roll=${roll}}} ${skills.join(' ')}`; sendChat('Skill Group', output); } else { return; } }); });
Oh god sorry CiG I didn't get the notification! The way I would intend on using this would be to have players each create their own macro to post it. I would say "Ok roll an identify check" and each of them could just click the macro quick bar and it would post it in chat for everyone to see. Ideally I would also have a set of macros so I could do hidden identify checks just whispered to me, but that's not as necessary. I'm awful with coding so I'll get back to you if this works, thank you so much for your effort!