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

Display initiative of targets in chat, pulling it from the turn order tracker?

Basically, I'm trying to make a macro that asks to click on tokens and pull their initiatives from the turn tracker. Psuedo : pull target name, check tracker for initiative, add to display template. Here is where I'm at with attempts: &{template:default} {{name=Initiative}} {{Init= **@{tracker|**@{target|t1|character_name}**}** }} {{Init= @{target|t2|character_name} }} {{Init= **@{target|t3|character_name}** }} This is derived from the 'party initiative' example on the macros page of the wiki.(  {{Alice= **@{tracker|Alice}** }}  ) I've tried a few variations, like {{Init= **@{tracker|"@{target|t1|character_name}"}** and a few other things. (Key is, I don't know what the ** is actually trying to do... just know it works in the example. Can't properly experiment with what I don't understand. Wouldn't mind being pointed to documentation of all of the scripting components that can be used without the Pro API.) Goal : Currently, I am operating with the idea that characters will have 3 tokens in play, each having their own initiative. (Basically, they get three turns through the course of the round. So generate each initiative by having three of the same token on the map.) Thus, it would be helpful to be able to use a macro to display the initiatives of each token together. Previous Experiment : I tried to pull initiative of a selected token to make use of it. However, it was requiring directly naming the token to pull from the tracker (instead of pulling for the selected token). My attempt was to be able to select any token and pull the initiative to then dismantle it and use that to create a macro for applying an update to the initiative. (ex : 13.040108 > create macro to select 4, or 1, or 8, > update initiative to remove the selected. So, choosing 1 would update to 13.0408. And some possible other manipulations of the value.) Basically, I don't actually understand how it all works (what variables exist, the syntax of the scripting language, etc). It's like I've uncompiled a program and reading the code to try and figure out how the language works, to then modify the program. (Imagine trying to use C++ without learning C++... just grabbing a pre-built program and then trying to change how it functions. "If then else? Perhaps I can if else then?")
1650139515
Kraynic
Pro
Sheet Author
The wiki has examples of pulling initiative values from the tracker here:&nbsp; <a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Initiative" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Initiative</a>
Kraynic said: The wiki has examples of pulling initiative values from the tracker here:&nbsp; <a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Initiative" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Initiative</a> Okay... that doesn't answer my question. Is that the only way to pull initiative information from the tracker? Is that the only way to pull initiative information from the tracker without having the API (Pro account)? Can I take the example... : Bobs initiative is @{tracker|Bob} ... and convert it into something like this? : The initiative of @{selected|character_name} is @{tracker|selected|character_name} Or to word it again, is there a way I can pull a name using @{selected|character_name} and convert it into a string BEFORE @{tracker|char_name} is processed? : @{tracker| @{selected|character_name} } Another option, is it possible to have a macro save a roll result to an attribute? ex: [[ @{selected|init_1} = 1d10 ]] [[ @{selected|init_2} = 1d10 ]] [[ @{selected|init_3} = 1d10 ]] [[ @{selected|init_1} + @{selected|init_2} + @{selected|init_3} + @{selected|initiative} @{tracker} ]]
1650495957
vÍnce
Pro
Sheet Author
Does this help? <a href="https://app.roll20.net/forum/post/10780790/how-to-call-the-initiative-of-a-randomly-selected-token-from-the-turn-tracker/?pageforid=10783383#post-10783383" rel="nofollow">https://app.roll20.net/forum/post/10780790/how-to-call-the-initiative-of-a-randomly-selected-token-from-the-turn-tracker/?pageforid=10783383#post-10783383</a>
You can do it indirectly using the Prefix Trick , and using the 'token_name' instead of 'character_name'. You will not be able to build a chat menu that lists out all of the tokens for a supplied character without the API, but you could create a macro to click on three targeted tokens: 1. Create a character named 'Macros' 2. On the 'Macros' character sheet, create an attribute named 'prefix' with a value of '@{' 3. Use this macro as a base: @{Macros|prefix}tracker|@{target|Target1|token_name}} 4. The full macro will be something like: &amp;{template:default} {{name=Initiative}} {{Init1=**@{Macros|prefix}tracker|@{target|Token1|token_name}}**}} {{Init2=**@{Macros|prefix}tracker|@{target|Token2|token_name}}**}} {{Init3=**@{Macros|prefix}tracker|@{target|Token3|token_name}}**}} Also, you asked earlier but didn't get an answer - the ** are simply markup to make that section bold.
vÍnce said: Does this help? Yes, I think I can work with that. Gets me back to the experiment of trying to attach die results as decimals to the total (using the roll catching thing)... and then pulling the decimals off as data to use and update the initiative. (Mainly, initiative is 3d10 and each die gets spent during the round.)