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

what am i doing wrong with this macro? (token mod is included)

/desc @{selected|token_name} ?{Source?|Torch,lights a torch|Light, casts light|Latern,lights their lantern|Extinguish,extinguishes their light source} !token-mod {{ ?{Source?|Torch,--on|Light,--on|Lantern,--on|Extinguish,--off} emits_bright ?{Source?|Torch,--on|Light,--on|Lantern,--on|Extinguish,--off} emits_low --set bright_light_distance|?{Source?|Torch,20|Light,20|Lantern,30|Extinguish,0} --set low_light_distance|?{Source?|Torch,20|Light,20|Lantern,30|Extinguish,0} }} obviously i'm using token mod, but the Quary won't work, i've make sure all the answers the same, as i don't want it ask me 5 different questions for the same thing.
Queries with the same label use the input of the first one, regardless of what options they would have had. Because you have the same label on every query ("Source?"), the choice from the initial one is taken for all of them - which will be just the "lights a torch", "casts light", etc.
that makes sense as to why i'm having an issue, Tuo said: Queries with the same label use the input of the first one, regardless of what options they would have had. Because you have the same label on every query ("Source?"), the choice from the initial one is taken for all of them - which will be just the "lights a torch", "casts light", etc.
?{Source?|Torch,/em lights a torch. 
!token-mod --set emits_bright#on emits_low#on bright_light_distance#20 low_light_distance#20|Light,/em casts light. 
!token-mod --set emits_bright#on emits_low#on bright_light_distance#20 low_light_distance#20|Lantern,/em lights a lantern. 
!token-mod --set emits_bright#on emits_low#on bright_light_distance#30 low_light_distance#30|Extinguish,/em extinguishes their light source. 
!token-mod --set emits_bright#off emits_low#off} 
1730748361
timmaugh
Pro
API Scripter
Just to put a fine point on what Jarren is sharing, their version incorporates HTML replacements to keep characters that are a part of the data within each option of the query from acting like control characters for the query itself (like commas, pipes, and right braces). Doing it like that is probably the easiest way, but to point out another option that offers some flexibility,  a script like the Metascript Toolbox (or probably ScriptCards) can help with turning a single query into multiple different outputs. Under that model, you might have a single query like this: ?{Source|Torch|Light|Lantern|Extinguish} And tables of information for each response listing the related datapoints. Where you want one of the datapoints, you'd reference the appropriate table and use the query to look up the value you want: get.MuleCharacter.TableName.?{Source}/get I can give a proper example if you want to go this route.
now you've said it, its SO obvious Jarren said: ?{Source?|Torch,/em lights a torch. 
!token-mod --set emits_bright#on emits_low#on bright_light_distance#20 low_light_distance#20|Light,/em casts light. 
!token-mod --set emits_bright#on emits_low#on bright_light_distance#20 low_light_distance#20|Lantern,/em lights a lantern. 
!token-mod --set emits_bright#on emits_low#on bright_light_distance#30 low_light_distance#30|Extinguish,/em extinguishes their light source. 
!token-mod --set emits_bright#off emits_low#off} 
Just reading this message hurt my head, i don't know enough about coding to use things like ScriptCards and i've never heard of metascript toolbox but thank you though timmaugh said: Just to put a fine point on what Jarren is sharing, their version incorporates HTML replacements to keep characters that are a part of the data within each option of the query from acting like control characters for the query itself (like commas, pipes, and right braces). Doing it like that is probably the easiest way, but to point out another option that offers some flexibility,  a script like the Metascript Toolbox (or probably ScriptCards) can help with turning a single query into multiple different outputs. Under that model, you might have a single query like this: ?{Source|Torch|Light|Lantern|Extinguish} And tables of information for each response listing the related datapoints. Where you want one of the datapoints, you'd reference the appropriate table and use the query to look up the value you want: get.MuleCharacter.TableName.?{Source}/get I can give a proper example if you want to go this route.
1730812991
timmaugh
Pro
API Scripter
No worries... but, if I can make introductions, this video explains what metascripts are and how they work. Also, Nick Olivo did a Muler overview video (Muler is a part of the Toolbox, and the source of the little syntax structure I provided in my previous post), so that could help explain how Muler can help in your case -- turning a single query into multiple different data for your command line. Not trying to push you to using them for this situation, but if you really don't know that metascripts are a thing (and how they can help you), I figured I could share a few resources... because, if you're able to understand the way that Jarren changed your command line, then your more than capable of understanding metascripts!
1730813510

Edited 1730813529
Andrew R.
Pro
Sheet Author
I can recommend installing the MetaScriptToolbox in every game and then learning it in dribs and drabs as you have need. I started with the conditionals; getting proper IF / THEN / ELSE into regular macros is very useful with 13th Age characters. 
i did look up a tutorial for scriptcards, and i think i get some of it, and if i find a use for the custom cards i'll use it, but i've got most of my macros set and that was the only one i needed to refine thank you for all your help guys timmaugh said: No worries... but, if I can make introductions, this video explains what metascripts are and how they work. Also, Nick Olivo did a Muler overview video (Muler is a part of the Toolbox, and the source of the little syntax structure I provided in my previous post), so that could help explain how Muler can help in your case -- turning a single query into multiple different data for your command line. Not trying to push you to using them for this situation, but if you really don't know that metascripts are a thing (and how they can help you), I figured I could share a few resources... because, if you're able to understand the way that Jarren changed your command line, then your more than capable of understanding metascripts!