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

token-mod --set represents| revisited

I use a MACRO (suggested by timmaugh) that calls: !token-mod --set represents|@{selected|token_name} /w gm @{selected|token_name} I use it a lot when restoring tokens after a battle however... It doesn't work if there is more than one character sheet for a token Represents Character such as two goblins in the list. It doesn't work if there are more that one creature whose names start with the same name such as Goblin Boss and Goblin. Is there a way around this?
If the token name is exactly  the same as the character name, and there's only one character with that name in the journal, then you can use quotes: !token-mod --set represents|"@{selected|token_name}" I recommend not having more than one character in the Journal with the same na me, as that will cause issues with calling attributes and abilities from the correct character. Why do you have to restore tokens after a battle? 
1738450120
Andrew R.
Pro
Sheet Author
Yes, why? I’ve been running 13th Age on Roll20 since 2014 and I’ve never done that. When I’m prepping a new battle map, I drag new tokens from the Journal entries. 
Why do you have to restore tokens after a battle? Because I want to. I do it for expediency, I feel that my time is short. I am running a couple of different campaigns and when the players get close to an area I like to Transmogrify the pertinent map with the tokens already set up in order to play it and/or copy the tokens to another map in the same campaign. Example: The players enter a crowded bar get involved in bar brawl then move on. A couple of sessions later they return to the bar and the crowd is there again. Also I am using Encounter Helper which has a bug in that it doesn't execute a reset without crashing the sandbox. Thanks for the tip of using quotation marks, I'll try it.
1738515519
timmaugh
Forum Champion
API Scripter
I'm not sure how the tokens get "unassociated" with the character sheet (in order to require a reset of the "represents" property), however... The above command seems to require you to select individual tokens and run the reset. In other words, since each token might have a different name, you have to run the command once-per-name so that the name properly resolves... IOW, you can't select Bob and Volcano Man and run this command, because BOTH would be reset to representing whichever the first token was in the set of selected tokens. In that case, you could use the Metascript Toolbox to automate this a little for you: !forselected(^) {{   !token-mod --set represents|"@^(selected.token_name)"   /w gm @^(selected|token_name) }} {&select *, +npc} You wouldn't have to select anything on the VTT. You just go to the page and run this command. This will select all NPC tokens on the page (criteria for selection discussed here ) and reset them to their represented entry. If you didn't want to do this to ALL NPC tokens (maybe some wouldn't have this 1-to-1 name/represents connection), the fact that you're re-using the tokens means you could take a minute to put a note somewhere on the token (like in the gmnotes). If you put a word in the notes that wouldn't otherwise appear UNLESS YOU WANTED TO RESET THIS TOKEN (something like "reset_rep_true"), then you could modify the selection tag from the previous command to be: {&select *, +npc, +notes~reset_rep_true}
@timmaugh, Yes, I am already using your "forselected(^) {{ }} in my MACRO and it has been, and continues to work. Thank you