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

Combining Token Mod macros for all selected tokens.

I want to select multiple tokens, Give them player control, name them all the same, show the nameplates and have the players see the nameplates. ALL IN THE SAME MACRO. So far I have (all as separate macros):  !forselected set-attr —[command] !forselected !token-mod --set controlledby|all !forselected set-attr —[command] !forselected !token-mod --set name|1d8-F1 !token-mod {{   --on     showname     showplayers_name }} Thanks so much!
1723347134

Edited 1723906580
timmaugh
Forum Champion
API Scripter
Hi, John... You should be able to do any TokenMod commands in the same message, and, as long as the commands are universal, you won't even need the forselected syntax. The TokenMod command would look something like: !token-mod {{   --on     showname     showplayers_name   --set     controlledby|all     name|1d8-F1 }} If you share the full syntax of what you've already got, I can probably tell you whether you need the forselected syntax or not. Also, given that you'd still have as many as 3 commands in this macro (2 ChatSetAttr calls and a TokenMod call), there might be a benefit to batching them up in a ZeroFrame batch  to avoid the dropped line bug . If you want to go that way but have trouble converting your own commands, posting the full verbiage here will let me lend a hand on that, too. EDIT: Corrected to introduce a space between the TokenMod handle and the double braces. It wouldn't work without that.
Thanks for the help. The command sent did not do the trick. I'm an absolute newbie at Token Mod. I have three macros. The first one is to give players control of the token. It is:  !forselected set-attr —[command] !forselected !token-mod --set controlledby|all The second one Sets the name of the token. It is: !forselected set-attr —[command] !forselected !token-mod --set name|1d8-F1 The third macro shows the name (clicks the nameplate on) AND shows the name to the players (Clicks "See" in player permissions). It is: !token-mod {{   --on     showname     showplayers_name }} I want to combine them into one macro. Thanks!
1723906532
timmaugh
Forum Champion
API Scripter
Sorry, john... I lost track of this thread. The problem was just that I hadn't left a  space between the "token-mod" and the double braces. I'll fix it, above, but put it here, too. This command worked for me in my game: !token-mod {{   --on     showname     showplayers_name   --set     controlledby|all     name|1d8-F1 }} That will work for all selected tokens, and set all of their names to be the string "1d8-F1". If you want that to be an individual roll, that's when we would need to implement a forselected addition to this command. Although, if you wanted to somehow individualize the token names, we can do that with forselected and an iterative tag: {&i} So... an example using that... Let's say that your "F1" is a group of tokens, and among them you might have a handful of tokens you want to differentiate. We can name them starting with "F1-0" using this command: !forselected token-mod {{   --on     showname     showplayers_name   --set     controlledby|all     name|F1-{&i} }} Or, if you wanted to start the naming with "F1-1" instead of "F1-0", we can change that {&i} to be {&i + 1}. But I'm just guessing what you're trying to do with a name like "1d8-F1". If I'm wrong and if there's a different thing you're trying to accomplish but you find that you have to do a "close enough" workaround that then results in after-the-fact manual work, post back with your steps. There might be a way to automate it with TokenMod and the Metascript Toolbox.
Thanks Tim! The first is all I need. It's for a group melee situation to ID that these tokens all roll a d8, and are a "force of 1". A tank, for example, might roll a d6 and be a force of 3. From this macro - I can make another for other combinations. A macro that queries die and force before naming would be handy, but not at all necessary. Thanks again!!