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

Need macro help

Hi, so I'm trying out a custom Speed Factor initiative system for 5e and I'm trying to make a macro for it. So I want to make a nested macro with possible choices and modifiers applicable to them, and then have it roll it and then add the result to the roll20's turn tracker. So, I've made 2 versions of this macro. The first one works fully, however it doesn't say in chat what type of action was chosen, and I want it do do that as well. The second one says the type of action chosen and does the appropriately modified roll, however it doesn't add the number to the turn tracker. So basically, in the end what I want is the chat output to be "**Initiative!** *&lt;Acton type!* *&lt;Number&gt;*" Can see both macros here: <a href="http://pastebin.com/jX4H8bK9" rel="nofollow">http://pastebin.com/jX4H8bK9</a> I've also tried putting the &{tracker} mod within each roll in the nested macro, but that just fucks up the whole macro and it rolls everything within it and doesn't add anything to the tracker, for whatever reason. What am I doing wrong?
1472570358
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So you aren't getting the *level 1 spell* to show up in chat as an example? What exactly does get output to chat? One potential problem I see with the macro is that &{tracker} appears to be on a new line which would mess with sending it to the turn tracker (although shouldn't have any effect on displaying the roll result. It may not give what you want, but you could try: [[1d20 + @{selected|Initiative_bonus} + ?{Type of Action|level 1 spell,-1[Level 1 Spell]|level 2 spell,-2[Level 2 Spell]|...|Repeat for all the possible options}]] Which would put the type of modifier into a roll label that you could see upon hovering over the roll. As for the &{tracker} inside each option screwing it up, this is because the roll query ends on the first "}" that it finds (attribute/ability calls don't count as they are resolved prior to the roll query). You could replace the "}" after tracker with &amp;#125; and try it in the roll query, but the best practice is to not repeat things within a roll query.
Chat output looks like: Iniative! &lt;Action Type&gt; &lt;Number&gt; So that all works. However, it doesn't put the number into the turn tracker. Know that I can be able to see it on mouse-over, but I'd rather not have to mouse over it and just be able to see it outputted in the chat. The &#125: trick worked, however! Cheers for that.
1472575777
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Glad to hear. The rest of it was mostly because I wasn't quite sure what the problem was, so I just took the shotgun approach and spewed everything I could think of :)
1472576155

Edited 1472576249
New problem - when I save that macro the &125; symbols revert to being ], thus fucking up the macro, any way around that? Current macro: **Initiative!** ?{What type of action?|Level 1 Spell,*Level 1 Spell!* [[1d20 + @{selected|Initiative_bonus} - 1&{tracker}]]| Level 2 Spell,*Level 2 Spel!l* [[1d20 + @{selected|Initiative_bonus} - 2&{tracker}]]| Level 3 Spell,*Level 3 Spell!* [[1d20 + @{selected|Initiative_bonus}- 3&{tracker}]]| Melee Heavy Weapon,*Melee Heavy Weapon!* [[1d20 + @{selected|Initiative_bonus} - 2&{tracker&}]]| Melee Light or Finesse Weapon,*Melee Light or Finesse Weapon!* [[1d20 + @{selected|Initiative_bonus} + 2&{tracker&}]]| Melee Two-Handed Weapon,*Melee Two-Handed Weapon!* [[1d20 + @{selected|Initiative_bonus} - 2&{tracker}]]| Ranged Loading Weapon,*Ranged Loading Weapon!* [[[[1d20 + @{selected|Initiative_bonus} - 5&{tracker}]]| Swap Equipment,*Swap Equipment!* [[1d20 + @{selected|Initiative_bonus} - 2&{tracker}]]| Retrieve Item at Hand,*Retrieve Item at Hand!* [[1d20 + @{selected|Initiative_bonus} - 2&{tracker}]]| Retrieve Stowed Item,*Retrieve Stowed Item!* [[1d20 + @{selected|Initiative_bonus} - 5&{tracker}]]| Very Slow Action,*Very Slow Action!* [[1d20 + @{selected|Initiative_bonus} - 5&{tracker}]]| Slow Action,*Slow Action!* [[1d20 + @{selected|Initiative_bonus} - 2&{tracker}]]| Medium Action,*Medium Action!* [[1d20 + @{selected|Initiative_bonus} + 0&{tracker}]]| Fast Action,*Fast Action!* [[1d20 + @{selected|Initiative_bonus} + 2&{tracker}]]| Very Fast Action,*Very Fast Action!* [[1d20 + @{selected|Initiative_bonus} + 5&{tracker}]]}
1472577796
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
If you are saving this as a global macro, those parse the html entities when they are opened back up. You can just make sure to keep it maintained, or put them in a character sheet ability which does not parse the entities when it is reopened.
1472577860
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
And just checking, it's reverting to a }, not a ] right?
}, yeah sorry. Think I'll just go with the mouse-over method then, less pain in the ass. Thanks for all the help though!
I had help with the same request a while back.&nbsp; This is what we came up with.&nbsp; It doesn't display info like the spell level or which non-combat action is selected and isn't fully intuitive but it works for my 5E game.&nbsp;&nbsp; I added attributes for pronoun and size modifier (which affects the initiative). &{template:5eDefault} {{ability=1}} {{title=Initiative}} {{subheader=@{selected|token_name}}} {{emote=@{selected|token_name} considers @{selected|pronoun} next action: ?{Which Action are you declaring?| [Attack - Unarmed or Grapple] (+4)| [Attack - Melee Light or Finesse Weapon] (+2)| [Attack - Melee Normal or Versatile] (0)| [Defense - Dash - Dodge - Disengage] (0)| [Assist-Help - Hide - Shove] (0)| [Non-combat action] (0)| [Spellcasting] (-Level)| [Attack - Melee Heavy or 2H Weapon] (-2)| [Attack - Ranged Loaded Weapon] (-2)| [Attack - Ranged Loading Weapon] (-5)}}} {{rollname=Action}} {{roll=Initiative [[1d20 + @{selected|Dexterity_Mod} + @{selected|size} + [[?{Spell Level Cast|0}*-1]]+ [[0d0 + ?{Which Action are you declaring?}]]+ ?{Which non-combat action are you declaring?| [None] (0), 0| [Interact with Object - Set Speed] (0)| [Swap Equipment] (-2), -2| [Retrieve item at Hand] (-2), -2| [Retrieve Stowed item] (-5), -5} + ?{Which Speed is the action?| Normal(0), 0|Very Slow(-5), -5|Slow(-2), -2|Fast(+2), 2|Very Fast(+5), 5} &{tracker} ]]}} It outputs in this form.