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 .
×

Macro Variable Posting to Chat Long

Hello, I'm working on a bunch of macros for a D&D 3.5 game.  Almost everything is working nicely, but there one issue.  If the macro has user input, such as asking which weapon you want to use, it puts the selection into the chat window. So: ?{Select Weapon:|@{selected|weapon1name},1|@{selected|weapon2name},2} Shows "1" or "2" in the chat log, depending on the selection. The right value saves and everything moves forward fine from there, but the chat window is messy. Thanks.
1530668083
GiGs
Pro
Sheet Author
API Scripter
When you use that macro, what appears in the dropdown menu? Won't the formula @{selected|weapons1name} appear, and not the actual contents of that attribute? Maybe what you want is ?{Select  Weapon:|First Weapon,@{selected|weapon1name}|Second Weapon,@{selected|weapon2name}} ?? Though I'm not sure what you mean by "saves and everything moves forward". If that's part of a larger macro, you should post the full thing to get accurate advice.
Okay, I wanted to avoid a full macro, as they completed ones are very long, but here goes.  Here's the full version of another macro that works, but puts random stuff in the chat window.  It gives all the details and necessary information for the Id Insinuation power.  The first things it does are to ask you to confirm your caster level and how many points you want to augment the power by. This all works great, and you can adjust your caster level (if anything weird is impacting it) and add extra points, which increase the listed save DC.  But, if your caster level is 9 and you add 2 points then the numbers 9 and 2 appear in the chat window before the the template showing all the power information. ?{Enter your Caster Level|@{selected|casterlevel}} ?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.|0} /w gm&{template:DnD35StdRoll} {{spellflag=true}} {{name=Id Insinuation}}  {{subtags=As the confusion spell, except as noted here. Swift tendrils of thought disrupt the unconscious mind of any one creature, sapping its might. As long as the manifester remains concentrating fully on this power, the subject is confused, making it unable to independently determine it will do. Roll on the following table at the beginning of each of the subject’s turns to see what the subject does in that round. 01-10 Attack manifester with melee or ranged weapons (or move toward the manifest if attack is not possible). 11-20 Act normally. 21-50 Do nothing but babble incoherently. 51-70 Flee from the manifester at top possible speed. 71-100 Attack nearest creature (for this purpose, a psicrystal counts as a part oft he subject's self).}} {{Discipline=Clairsentience}} {{level=Psion/wilder 2}} {{components=Auditory}} {{casting time=1 standard action}} {{range=[[ 25 + 5 * floor(@{selected|casterlevel} / 2)} ]]** ft.** }} {{target=[[1 + floor(?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.}/2) ]] creature(s) }} {{duration= Concentration + 1 round }} {{Saving Throw=Will negates; DC =[[@{selected|spelldc2}+ floor(?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.} /2 ) ]] }}  {{power points = [[3 +?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.}  ]]  }}  /fx Glow-Charm@{selected|token_id}
1530727088

Edited 1530727218
GiGs
Pro
Sheet Author
API Scripter
Why do you have those two queries at the start, when they aren't used in the macro? Especially the first one, where  @{selected|casterlevel} draws the caster level from the character sheet?
1530727491

Edited 1530728228
GiGs
Pro
Sheet Author
API Scripter
If you want to have the augment effects and level printed in chat, the queries could be changed to something like: Caster Level: @{selected|casterlevel} Augment Power Points spent: ?{Augment|0}; Save DC +[[floor(?{Augment}/2)]], Extra Targets: ?{Augment} You could also create a rollable table for that random attack, and include an API button to call it, so that you can just click it and get the results each time you need them. Add this line in place of your table roll, and replace "RandomActiontable" with the name of the table you created. [Confused Action](!
/r 1t[RandomActionTable]) You might need to put that at the end of the macro, after the last }}. It depends how the rolltemplate processes each element. 
The problem is I don't want Caster Level and Augment Power Points to appear in the chat window and they are.  I've attached a screenshot. The Caster Level query should get used again, but it seems I overlooked that when making this particular macro.  I meant to use it for the power's range, but went back to the base caster level on the sheet by mistake. The table and API suggestions are good.  I'll have to look into APIs, I really don't know where to begin.  Nor, do I except you to try to explain it.  I'll do some research if I can find the time.
1530895160
The Aaron
Pro
API Scripter
You can preface them with ! to hide them: ! ?{Enter your Caster Level|@{selected|casterlevel}} ! ?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.|0} /w gm&{template:DnD35StdRoll} {{spellflag=true}} {{name=Id Insinuation}}  {{subtags=As the confusion spell, except as noted here. Swift tendrils of thought disrupt the unconscious mind of any one creature, sapping its might. As long as the manifester remains concentrating fully on this power, the subject is confused, making it unable to independently determine it will do. Roll on the following table at the beginning of each of the subject’s turns to see what the subject does in that round. 01-10 Attack manifester with melee or ranged weapons (or move toward the manifest if attack is not possible). 11-20 Act normally. 21-50 Do nothing but babble incoherently. 51-70 Flee from the manifester at top possible speed. 71-100 Attack nearest creature (for this purpose, a psicrystal counts as a part oft he subject's self).}} {{Discipline=Clairsentience}} {{level=Psion/wilder 2}} {{components=Auditory}} {{casting time=1 standard action}} {{range=[[ 25 + 5 * floor(@{selected|casterlevel} / 2)} ]]** ft.** }} {{target=[[1 + floor(?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.}/2) ]] creature(s) }} {{duration= Concentration + 1 round }} {{Saving Throw=Will negates; DC =[[@{selected|spelldc2}+ floor(?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.} /2 ) ]] }}  {{power points = [[3 +?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.}  ]]  }}  /fx Glow-Charm@{selected|token_id} This takes advantage of the fact that API commands have no chat output by default.  It will cause the API to evaluate the message, but nothing should be responding to the empty API command.  (This trick actually gets used a lot for "commenting out" part of a macro.) Another option is to place them where you first use them.  It's less convenient for editing, but more efficient for the system (minorly). Another option is to put them in the first roll template in a place where they won't get displayed: /w gm&{template:DnD35StdRoll} {{name= ?{Enter your Caster Level|@{selected|casterlevel}} ?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.|0} }} {{spellflag=true}} {{name=Id Insinuation}}  {{subtags=As the confusion spell, except as noted here. Swift tendrils of thought disrupt the unconscious mind of any one creature, sapping its might. As long as the manifester remains concentrating fully on this power, the subject is confused, making it unable to independently determine it will do. Roll on the following table at the beginning of each of the subject’s turns to see what the subject does in that round. 01-10 Attack manifester with melee or ranged weapons (or move toward the manifest if attack is not possible). 11-20 Act normally. 21-50 Do nothing but babble incoherently. 51-70 Flee from the manifester at top possible speed. 71-100 Attack nearest creature (for this purpose, a psicrystal counts as a part oft he subject's self).}} {{Discipline=Clairsentience}} {{level=Psion/wilder 2}} {{components=Auditory}} {{casting time=1 standard action}} {{range=[[ 25 + 5 * floor(@{selected|casterlevel} / 2)} ]]** ft.** }} {{target=[[1 + floor(?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.}/2) ]] creature(s) }} {{duration= Concentration + 1 round }} {{Saving Throw=Will negates; DC =[[@{selected|spelldc2}+ floor(?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.} /2 ) ]] }}  {{power points = [[3 +?{Augment: For every 2 additional power points you spend, this power’s save DC increases by 1, and the power can affect an additional target. Any additional target cannot be more than 15 feet from another target of the power.}  ]]  }}  /fx Glow-Charm@{selected|token_id}   Since the last value assigned to a template tag is used, the name tag will get set correctly to Id Insinuation but the values of those queries will not be displayed.