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

Really Basic Simple Initiative Roller

Hello all, I'm totally new to Roll20 and I want to write a really simple initiative macro to roll initiative for monsters.  Right now I have the following: /em rolls some dice. Initiative is [[1d20 + @{selected|initiative_bonus}&{tracker}]] When I use this it gives me the error message that no character was found for selected. Am I missing something here? Thanks, Wolf
1553654300
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Do you have a token selected when you use this macro? and is that token set to represent a character in the journal? Both of these need to be true to use the selected keyword when referring to anything other than the token bars.
1553654818
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
As a quick test, select a monster token and paste this into chat: @{selected|dexterity} If you get an error message, then the great likelihood is that your token is not set up properly.
1553654819
The Aaron
Roll20 Production Team
API Scripter
If you’re somewhat new to Roll20, this might help clear up some early confusion:&nbsp; <a href="https://wiki.roll20.net/Linking_Tokens_to_Journals" rel="nofollow">https://wiki.roll20.net/Linking_Tokens_to_Journals</a>
1553654886
The Aaron
Roll20 Production Team
API Scripter
keithcurtis said: As a quick test, select a monster token and paste this into chat: @{selected|dexterity} If you get an error message, then the great likelihood is that your token is not set up properly. Might be even clearer to use: @{selected|character_id}
Yes. The token is in the journal and the dex bonus is properly labeled and the value is there and yes the token is selected when I run the command. I just keep getting the feedback token not selected. I DO have the right code structure, don't I? Am I mislabeling something? What I wrote SHOULD work, right?
@KeithCurtis - I tried your suggestion&nbsp; @{selected|dexterity}&nbsp; and got the message 'No character was found for selected' I made sure the monster had a Dexterity attribute of 2.
@KeithCurtis I also just tried your&nbsp; @{selected|character_id} with the token selected and got the same message&nbsp; No character was found for 'selected'.
The monster IS most definitely in the journal.&nbsp;
I think I found the broken piece. Aaron - when setting it up I hadn't chosen the "Represents character" dropdown.
1553708884
The Aaron
Roll20 Production Team
API Scripter
Ah, I suspected something like that. That wiki link should do a good job of explaining it. It’s not intuitive that assigning a token to a character is not bidirectional. There are cases when you might want the token to represent a different character, such as a boss which has all the stats of a normal monster, but more hit points.&nbsp;
1553708943

Edited 1553709013
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
WolfmanNYC said: I think I found the broken piece. Aaron - when setting it up I hadn't chosen the "Represents character" dropdown. That was what the tests were for. If you got a No Character Found message, then the culprit was that the token did not represent a character. Glad you worked it out. :) Make sure that once you've got the token properly set up, you then set the new modified token to be the default token.
Ok. I totally got the initiative rolls working! Thanks, guys!
1553724224
The Aaron
Roll20 Production Team
API Scripter
Sweet!