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

Read a token's initiative without API?

Something like @{selected|initiative} or something like that? Only possible with the API isn't it?
1509718048

Edited 1509718125
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
If you mean the value that is in the tracker,then yes. If you just want to get their initiative bonus, then the syntax you gave works, just make sure you're using the right attribute name. If you want to get the current tracker value so that you can change it, you can adjust the tracker values via the &{tracker:-/+} syntax. <a href="https://wiki.roll20.net/Turn_Tracker" rel="nofollow">https://wiki.roll20.net/Turn_Tracker</a>
1509720560

Edited 1509720669
The Aaron
Pro
API Scripter
You can't reference it by @{selected}, but you can use @{tracker|character name}. From:&nbsp; <a href="https://wiki.roll20.net/Turn_Tracker#Adding_a_Cust" rel="nofollow">https://wiki.roll20.net/Turn_Tracker#Adding_a_Cust</a>... You can even reference these values the same way you would Attributes by using the syntax: @{tracker|Item Name} . This can be used to simulate systems that use an Escalation Die mechanic or fetch the value of a token's turn order.
1509721626
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Oh, nice Aaron. I completely missed that every time I've looked at that wiki article.
1509722124
The Aaron
Pro
API Scripter
It's pretty obscure. I had to search back for the message when it was announced 3 years ago to find it, then I found it on the docs when I went back and search for "@{tracker".&nbsp; =D
1509725285

Edited 1509725317
Oh yes, I was looking for modifying the value, ok that's much easier than I thought. Thank you so much! Oddly enough: @{selected|token_name} gives me the name of the token, but @{tracker|@{selected|token_name}} doesn't work :( Not that it matters too much, as I said, I just wanted to modify the initiative to start with, and that works.
1509727756
The Aaron
Pro
API Scripter
Nesting attributes is problematic. Scott or Silvyre might be able to get it to work...
1509728374
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yeah, there's no way to nest them that I know of. But, as you said Quatar, if you're just looking to increment/decrement the turn tracker value of a token, then you don't need it anyways.
If I could have gotten it to work, I could have used it to show the current and new initiative in the macro, but so I just show the Modifier, it works fine. Thank you again
1509734936

Edited 1509734956
Nesting isn't possible, but you can simulate nesting with a custom variable like this: You have a character named cmd &nbsp;and&nbsp;create an attribute for this character in the Attributes & Abilities tab called tracker_prefix &nbsp;with the value @{tracker| Then in your macro you can do @{cmd|tracker_prefix}@{selected|token_name}} &nbsp;to get the value stored in the tracker for the selected token.
1509735766
The Aaron
Pro
API Scripter
ooh!&nbsp; clever!
Indeed
1509737192
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Kyle G. said: Nesting isn't possible, but you can simulate nesting with a custom variable like this: You have a character named cmd &nbsp;and&nbsp;create an attribute for this character in the Attributes & Abilities tab called tracker_prefix &nbsp;with the value @{tracker| Then in your macro you can do @{cmd|tracker_prefix}@{selected|token_name}} &nbsp;to get the value stored in the tracker for the selected token. Kyle, does this work for you? Doing for instance: @{nester}@{nested}} where: @{nester}=@{ @{nested}=dexterity_mod Just gives me an error:
1509814683
Silvyre
Forum Champion
Scott C. said: @{nester}@{nested}} where: @{nester}=@{ @{nested}=dexterity_mod Just gives me an error: Within an Ability this should work: @{nester}@{character_name}|@{nested}} Otherwise, you'll need to append a keyword to the value of @{nester}, e.g. @{nester}=@{selected