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

Macro not showing on the chat

1689930116

Edited 1689930532
So I'm pretty new to Roll20, but I've spent a decent deal of time in MapTool, specifically making macros. So I wanted to create some here too, the language is pretty different but doesn't seem too complicated. Thing is I've been making a macro for Lancer RPG that rolls a dice, compares it to a target's evasion and then uses two rollable tables to tell the player if it's a hit or a miss, without revealing the targets stats. I was trying it without adding modifiers (just the roll) first and it worked great, but when I started working on adding the modifier (with @{selected|~~~} and so) to the equation, it just stopped showing in chat alltogether, no error mesages, no crooked text, nothing. If I took the modifier out, it started working again, so I wonder, is there any way I can fit the modifier in my macro? If so how can I? Here's what I made: &{template:default}{{name=Weapon attack}} @{selected|token_name} tried to attack @{target|token_name}! [[1t[[[1d20+@{selected|grit}>[[@{target|autocalc_evasion}]] ]]] ]] ¿Success? Pick a weapon: [Chain Gun](~Hacksaw-Chain-Gun) The rollable tables are just two tables named 1 and 0 with an item that say Success or Fail each, and the Chain Gun is a command button to another Macro thats just some text and a simple [[xdy+z]] command. All of this was done   as an ability macro  inside a character with the standard Lancer Roll20 Character Sheet. I've tried setting the 1d20 as a separate roll, encasing the roll and the modifier into a single roll even tried making it a standard /roll command, hasn't worked. Thanks in advance to everyone for their input. Edit: I almost forgot, I know the macro works partially, it just refuses to do the math, bc it does ask me to pick a target, but when I click on one nothing happens and it keeps asking me to pick a target, I know the target isn't bad bc it works fine without the @{selected|grit} part, it only starts failing once I add that in.
1689939722

Edited 1689939751
Hello Matias, welcome to the forums. Two solutions from your problem: 1 - Move the @{selected|grit} &{template:default}{{name=Weapon attack}}{{@{selected|token_name} tried to attack @{target|token_name}!}}{{[[1t[[[1d20>[[@{target|autocalc_evasion}-@{selected|grit}]] ]]] ]]}} 2 - Add a "neutral" roll, sum it with the d20 roll and then compare to the target value: &{template:default}{{name=Weapon attack}}{{@{selected|token_name} tried to attack @{target|token_name}!}}{{[[1t[[[{[[1d20+@{selected|grit}d1]],0}kh1>[[@{target|autocalc_evasion}]] ]]] ]]}} Does either macros are good to you or did I completely miss the point ?
The first one actually worked! I feel kind of stupid, it didn't cross my mind to substract the bonus rather than add it. It was so simple, thanks either way!
Sometimes the simplest solutions are... the simplest :p To be honest, the first solution hasn't my vote because it modifies both the 'attack roll' and the 'defense score'. Since I didn't know if the 'total attack score' and the 'total defense score' were important, I posted it to make sure the "Roll20 roll language" was correct. Good to see the issue solved though.