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

"Selected" Value Twice?

Is there any way to replace the {modifier|0}  portion of the below macro from the Useful Macros wiki so that it can simply pull the initiative (dex) modifier from the journal page? When I try to do it I keep getting a "cannot find selected" error, which to me seems like it can read the "selected" token the first time, but not the second. This would really help with not having to look up each token's modifier, it would just be done automatically. For GM-Controlled Tokens: "GM_INIT": /emas @{selected|token_name} rolls a [[1d20+?{modifier|0}&{tracker}]] for initiative! Make sure to select "Token Action" before saving! For GM use only; see below for players. To use, select the token. Hit the button (GM INIT). When prompted, enter the total initiative modifier for the token. Token will automatically be added to turn order. 
1487923893
Tetsuo
Forum Champion
It can easily be done, but the exact syntax depends on which system sheet you're using. Which one are you using, and I can easily help you out.
I'm using the 5e OGL sheets. Thanks Franky!
try /emas @{selected|token_name} rolls a [[1d20+@{selected|npcd_dex_mod}&{tracker}]] for initiative!
1487963408

Edited 1487963518
Same error with that one Kyle. It reads the first selection, in my test case Goblin, but doesn't read the second. So I get the result of the raw 1D20 only and the error message said below. No character was found for 'selected'
I just tried it and it worked properly. Do you have a token selected when you run the macro?
Also, /emas only works for the GM. Don't know if you might be a player trying to use /emas because you posted about a " For GM-Controlled Tokens:" macro but I figured I would point it out anyway.
I am GM and do have the token selected. I must have an error with the token journal.
Could you paste the exact macro that you are using in addition to the exact error. I see that you have posted the base error, but I was wondering if maybe there was a clue hidden inside either the macro or the error that we are missing.
1487965084
Tetsuo
Forum Champion
Double click the token. Make sure the "Represents" is set to the journal for the npc. Then, Try this: %{selected|npc_init}
That was it Franky. It wasn't linking to the journal properly.  This is my first game as GM, so I didn't learn about using the journal until I was about 80% through, so a lot of my tokens had manually entered values. Those ones don't work with the macro, so I just need to go back and link those to the journal entries. Sorry for the silly mistake, and thank you for the help all.