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

Initiative macro not adding onto tracker when adding text

March 14 (4 years ago)

Hey!

I'm trying to make a macro that have different text output depending on what query is selected, that also puts the number onto the initiative tracker.

Testing bit by bit and studying the example given in the wiki for the cure spell, I've managed to make it work where it will say
"CharacterName will attack at x" if you select "Attack" and "CharacterName will attack and bonus at x" when you select "Attack - Bonus" and if you go for casting it asks for the level of the spell slot you're using.
But no matter where I try to put &{tracker}, it does not put the numbers onto the tracker. Or it just breaks the drop-down prompt.

Posting the macro that works with adding the number onto the tracker and how far I've gotten with making the text change depending on whats chosen. It seems like adding the text between the label and the roll is what starts to break stuff. If it's not included then @{initiative_bonus} can be put at the end with &{tracker} and it works just fine.

Just have a few options right now for a simpler time editing, rest of the macro will be implemented once/if I manage to get it to add it onto the initiative tracker automatically. (Also yes it's supposed to subtract the initiative bonus hahah).

Any help or guidance will be appreciated! Even a "what you're trying to do specifically is not possible"

I've made something similar through chat menu just fine but I want to try to make this very specific "one button one macro" work.

But here is the macro that works with rolling and adding the number onto the tracker

@{character_name} will act with [[?{What will you do? |
Attack, 1d8 |
Attack - Bonus, 1d8+1d8 |
Cast, 1d10+?{Spell Level|0}
} +@{initiative_bonus}&{tracker}]].

And here's what I'm working on that is not able to add it onto the tracker

@{character_name} will ?{What will you do? |
Attack, attack at [[1d8-@{initiative_bonus}]] |
Attack - Bonus, attack and bonus at [[1d8+1d8-@{initiative_bonus}]] |
Cast, cast at [[1d10+?{Spell Level|0}-@{initiative_bonus}]]
}&{tracker}
March 14 (4 years ago)
Andreas J.
Forum Champion
Sheet Author
Translator

The &{tracker} must be inside the inline roll( the [[ ]] section), so add it to each of the 3 options.

If you compare to your working macro, you see that's the difference.

March 14 (4 years ago)

I've tried that, it breaks the drop-down menu.

This is how it looks when I put &{tracker} in with the options.


And this is how it works when &{tracker} is not put inside the inline roll and how I want it to look.


March 16 (4 years ago)
Andreas J.
Forum Champion
Sheet Author
Translator

Runa said:

I've tried that, it breaks the drop-down menu.

Then you need to do HTML replacements for either the "}" on the &{tracker}, to get around the query breaking down.

The &{tracker} must be inside the [[ ]] for your macro to work, regardless of any other troubles.