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

Can this macro be made to roll a targeted token's correct skill instead of manually typing it in?

1705566625

Edited 1705566993
&{template:default} {{name= **Trick Maneuver**}} {{Action:=Standard}} {{Description:=Trick the opponent into doing something stupid.}} {{Use:=**?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)}** opposed by target's better **Deception** or **Insight**}} {{--------------- = **--------------------**}} {{Die roll:=?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)} roll: [[1d20+?{Skill Rank|0}]]}} {{If succeeds:= Target takes the action you tricked them into doing.}} {{If fails by more than 1 degree:=You become vulnerable.}} The above is the macro as I have it for now.
1705570377
Gauss
Forum Champion
Hi Adran06,  Which character sheet are you using in your game? If you don't know the name please supply a screenshot. 
You could use @{selected|...} or @{target|...}. You need to know the correct Sheet Attributes to use here or else these won't work. Adran06 said: &{template:default} {{name= **Trick Maneuver**}} {{Action:=Standard}} {{Description:=Trick the opponent into doing something stupid.}} {{Use:=**?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)}** opposed by target's better **Deception** or **Insight**}} {{--------------- = **--------------------**}} {{Die roll:=?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)} roll: [[1d20+?{Skill Rank|0}]]}} {{If succeeds:= Target takes the action you tricked them into doing.}} {{If fails by more than 1 degree:=You become vulnerable.}} The above is the macro as I have it for now.
Mutants & Masterminds 3e. I know the attributes are the name of the skills. So one would be @{selected|deception}? This is what I have so far, but it's not working. &{template:default} {{name= **Demoralize Maneuver**}} {{Action:=Standard}} {{Description:=Trick the opponent into doing something stupid.}} {{Use:=**?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)}** opposed by target's better **Deception** or **Insight**}} {{--------------- = **--------------------**}} {{Die roll:=?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)} roll: ?{Trick Skill:| Deception,[[1d20+@{selected|deception}]]}} {{If succeeds:= Target takes the action you tricked them into doing.}} {{If fails by more than 1 degree:=You become vulnerable.}}
1705638960

Edited 1705638994
Okay, so after smacking my head into this mess, I finally got a version that works. &{template:default} {{name= **Demoralize Maneuver**}} {{Action:=Standard}} {{Description:=Trick the opponent into doing something stupid.}} {{Use:=**?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)}** opposed by target's better **Deception** or **Insight**}} {{--------------- = **--------------------**}} {{Die roll:=?{Trick Skill:| Deception,Deception| Agile Feint (Acrobatics),Agile Feint (acrobatics)} roll: ?{Roll:| Deception,[[1d20+@{selected|deception}]]| Acrobatics,[[1d20+@{selected|acrobatics}]]}}} {{If succeeds:= Target takes the action you tricked them into doing.}} {{If fails by more than 1 degree:=You become vulnerable.}} I wanted to only have to make 1 choice, but apparently it won't work that way.
1705663166
GiGs
Pro
Sheet Author
API Scripter
I am sure it can be done, but will porobablyneed HTML substututes. It's not clear to me what kind of roll you are trying to make. Can you describe the entirety of the roll without  mentioning Roll20. Describe it as if I'm a player at your table.
1705673788

Edited 1705673821
Hey GiGs, Mutants and Masterminds has an option to roll a Deception skill check in combat. You can use Deception as a standard action to mislead an  opponent in combat. Make a Deception check as a standard action opposed by the better of your target’s Deception or Insight. If your Deception check succeeds, the target is vulnerable against your next attack, until the end of  your next round But there is an Advantage called Agile Feint that will let you use your Acrobatics skill in place of Deception. So this macro seems to be to allow the player to choose between rolling a Deception skill check or an Acrobatics skill check. If Roll20 allowed substitution inside @{}'s then it could simply look like: {{Skill Used=?{Skill|Deception,deception|Agile Feint,acrobatics}}} {{Roll=[[1d20 + @{selected|?{Skill}}]]}} to reuse the skill choice but I remember the Roll query wiki specifically mentions you can't reuse a Roll query inside @{}'s.
1705681346

Edited 1705681398
it also outputs a table stating what the Trick action does, along with the roll, as a reminder of wtf you're actually doing. But yeah, what Joshua said. Right down to what I had tried to do also XD
1705682129
GiGs
Pro
Sheet Author
API Scripter
Yeah, you can't do that, but you can include more in a query. A query is just asking you what tes=xt ou wnat to output, and that text is placed wherever the query is. This means that (in theroy, there is a porblem) you can do this: {{Skill Used=?{Skill| Deception,Deception}} {{Roll=[[1d20 + @{selected|Deception}]]| Agile Feint,Acrobatics}} {{Roll=[[1d20 + @{selected|Deception}]] } }} Everything after the comma and before the next | is output from the query. BUT Roll20 queries respond badly to certain characters. The characters , | and } are used by the query itself, so if you want to include them in the output, you have to replace them with temporary charcters (html Entities) that don't work the same, but that Roll20 will replace with the proper characters. These are called HTML Entities, because HTML represents them as the characters they replace, but Roll2 macros dont. So you could do this {{Skill Used=?{Skill| Deception,Deception}} {{Roll=[[1d20 + @{selected|Deception}]]| Agile Feint,Acrobatics}} {{Roll=[[1d20 + @{selected|Deception}]] } }} Notice that the } after Deception and Acrobatics have each been replaced twice, thats because } is a HTML entity that replaces }. A problem with HTML Entities (apart from them looking ugly), is that every time you open a macro containing them, the macro is processed and those HTML entities are replaced by the character they represent. So that } will become }, and the macro will break because you need those } for it to work. The most common solution to this is to place the "macro" in an Ability on a character sheet. Abilities do not do that parsing. This leads to creating a character sheet that is just for the GM, called maybe Macros, where all these macro-like abilities are stored. In conclusion, rolltemplates require html entities. HTML entities are a pain to deal with and often lead to the creation of Macros character sheets. But when using HTML Entities, you can reduce multiple query calls to just one. By the way, the devs did have a solution for teh qay queries work, had some glitches with it, and completely abandoned it. I feel they hsould have solved this solution by now, and just stopping macros from processing macro text the way abilities don't would go a long way.
1705682258

Edited 1705684221
GiGs
Pro
Sheet Author
API Scripter
Adran, your comment came in while I was writing that post. You can include extra text in the query, just be careful if that text includes the control characters of a query - the comma (,), pipe (|) and ending curly bracket (}).
Thanks for the help everyone. I'm probably not gonna try the method that uses html, but it may be useful for me in other macros at some point so it's good to know.
1705684282
GiGs
Pro
Sheet Author
API Scripter
Adran06 said: I'm probably not gonna try the method that uses html On any other topic I'd be offended after spending so long writing a reply, but on this one, I'm more like, "yup, sensible."