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 Ear for Deceit Macro

Hi everyone, I am completely new to macros and I have never coded with HTML before (just a few other languages) and I keep getting an error with a macro that I am trying to use. The macro I found here:&nbsp; <a href="https://app.roll20.net/forum/post/7230268/5e-shaped-sheet-ear-for-deceit-macro" rel="nofollow">https://app.roll20.net/forum/post/7230268/5e-shaped-sheet-ear-for-deceit-macro</a> &nbsp; The macro is: &amp;{template:5e-shaped} {{title=Insight}} | {{Ear For Deceit= [[{1d20,0d0 + 8}kh1 + @{insight}]]}} This is supposed to perform the Ear for Deceit feature for the Inquisitive Rogue Subclass. However I keep getting this error:&nbsp; TypeError: Cannot read property 'substring' of undefined Can anyone assist me with the macro?
1554663841
GiGs
Pro
Sheet Author
API Scripter
Is it saved as a macro, or an ability on the character sheet? If it's a macro, and not stored in the character's abilities, you need to change this part @{insight} to&nbsp; @{YOUR-CHARACTER-NAME|insight} It's also worth checking if the insight attribute is defined: select your character token, and type this in chat @{selected|insight} and see if you get a valid value.
1554663902

Edited 1554664032
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If it's a macro and not an ability )macro on the character sheet), try replacing&nbsp;@{insight} with&nbsp;@{selected|insight} or @{target|insight} or @{ charactername |insight}. At first glance, it looks like the macro doesn't know whose Insight to use. Also, I just noticed that you are using the 5e Shaped sheet. That sheet doesn't have an attribute called Insight unless you've added one. Skills are a repeating field, and referenced by number. Insight would be something like&nbsp;@{NAME|repeating_skill_ID_bonus} with ID being replaced by the position of the skill in the list: $01, $02, and so forth. Be forewarned that the skill list doesn't always stay in the same order from sheet to sheet. You may need to press the generate skills button to produce an ordered list on the exceptions. More info here .
Okay so I did a combination of things from both of your advice. I no longer am getting an error but in the chat nothing is actually displaying. Is there some kind of printf function that is missing from the macro? Currently my macro is this:&nbsp;&amp;{template:5e-shaped} {{title=Insight}} | {{Ear For Deceit= [[{1d20,0d0 + 8}kh1 + @{Jay|insight_bonus}]]}}
1554665175
GiGs
Pro
Sheet Author
API Scripter
From what Keith says, you havent got the right attribute bonus for insight. Try this: 1: click the button on the character sheet that makes an Insight roll. 2: click in the chat box, and hit the UP arrow, that will show you the last command sent to chat. You'll be able to grab the needed attribute for the insight bonus there.&nbsp; If you cant identify it, post the text here and we'll figure it out.
When I did that the attribute bonus is listed as being called as "insight_bonus". Which is what I put in the macro. Whenever I run the macro however, the chat just shows my character name and a blank afterward as if it knows I was performing the macro but it never returned anything. Like so:
1554667128
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try this: &amp;{template:5e-shaped} {{title=Insight}} | {{Ear For Deceit= [[{1d20,0d0 + 8}kh1 + @{Jay|repeating_skill_$06_total}]]}} Skills start numbering at $0, so if Insight is the 7th skill on Jay's list, then the above should pull the modifier. You can check to make sure you have the right one by entering @{Jay|repeating_skill_$06_name} in the chat. If it comes up "Insight", you're golden. Otherwise you may have to adjust up or down.
1554667245
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you are still getting a blank, try rolling other things. If you continue to get blanks, you may have a corrupted chat archive. But the greatest likelihood is a typo in the macro.
So I have been testing around with if for a while and still can't get it to work.This is what I've done so far: 1. I changed the {template:5e-shaped} to {template:simple}&nbsp; and found that doing this gives me this: 2. After reading through the whole Insight check command I changed {{title=Insight}} to {{rname=^{insight-u}}} and it started to do this: progress but still not showing the roll itself. 3. I then took away the entire section after the name change just to see if it was having any affect. The result was the same as with #2 above. So the problem has to be with the section:&nbsp; | {{Ear For Deceit= [[{1d20,0d0 + 8}kh1 + @{Jay|insight_bonus}]]}} The problem is, when I type in the command [[{1d20,0d0 + 8}kh1 + @{Jay|insight_bonus}]] it does do the roll and gets me what I want. The macro itself just doesn't for whatever reason do the roll.
So I just did what you suggested Keith and I got an error:&nbsp; No attribute was found for @{Jay|repeating_skill_$06_total}
1554668193
GiGs
Pro
Sheet Author
API Scripter
Which character sheet are you using? what happens if you use ?{template:default}
That in and of itself worked. It output kinda weird but it worked:
Thank you guys so much for your help!
1554668593
GiGs
Pro
Sheet Author
API Scripter
Did you find a solution? I'm guessing you weren't using the 5e Shaped sheet and needed to use a different rolltemplate?
Yeah I mean the only existing template for it used the Shaped sheet. I think I'm using the simple one, because that's what the Insight check command used. I actually found a way to take the exact code from the insight check and modify the roll in it just to do what I wanted, so it outputs in the normal format. For anyone else who might see this sometime, my macro code is:&nbsp;@{Jay|wtype}&amp;{template:simple} {{rname=^{insight-u}}} {{mod=@{Jay|insight_bonus}}} {{r1=[[{1d20,0d0 + 8}kh1 + @{Jay|insight_bonus}]]}}@{Jay|rtype}+@{Jay|insight_bonus}@{Jay|pbd_safe}]]}} {{global=@{Jay|global_skill_mod}}} @{Jay|charname_output}
1554668900
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ah. We made assumptions from the initial macro code. :D Glad it's working.