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

A New Script for marking a large amount of tokens

Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Apply Token Marker Number (aTMN) script &nbsp;Source code at: <a href="https://github.com/TheKrakenCoder/aTMN" rel="nofollow">https://github.com/TheKrakenCoder/aTMN</a> &nbsp;This script is designed to be an easy way to mark a large amount of tokens so that players and GMs can easily refer to them in combat. &nbsp; There are more powerful and more flexible scripts that do a similar thing (e.g. The Aaron’s TokenNameNumber script) but usually this script's functionality is all I need. &nbsp; Plus, it gave me an excuse to write my first script. &nbsp; The script applies a token marker with a numeral to selected tokens. &nbsp; It can also remove the applied token markers. Applying Markers The GM selects one or more tokens and then executes: !aTMN &nbsp;By default, the first 20 tokens selected are marked. &nbsp; The first ten tokens are marked with pink circles with numerals 0 through 9 and the next ten have purple circles with 0 through 9. &nbsp; The manner in which roll20 decides the order of tokens is a mystery to me (maybe order in which they were created?). Tokens that are controlled by someone, or represent a character that is controlled by someone, are not marked, and do not count towards the limit of 20. &nbsp; This means you don’t have to avoid PCs when selecting tokens, and as long as important NPCs have the GM’s name in the “Can Be Edited &amp; Controlled By” field, they won’t be marked either. &nbsp; &nbsp; Changing Markers The GM can change the markers used to tag tokens by supplying a comma separated list of marker names. &nbsp; For example: !aTMN green,brown &nbsp;will make the first 10 markers green and the next 10 brown the next time the !aTMN command is run. &nbsp; This command does not actively mark tokens, it changes the markers used the next time the !aTMN command is run.&nbsp; Don't put any spaces in this list; the parsing is picky. &nbsp; The GM can list as many markers as he wants: !aTMN green,brown,red &nbsp;will mark up to 30 tokens, first green, then brown, then red the next time the !aTMN command is run. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Removing Markers To remove the markers, selected the desired tokens and execute: !aTMNX &nbsp;Note the X at the end of the command. &nbsp; There is no limit to the number of tokens that can have their markers removed with one command. &nbsp; Note that if you apply pink and purple markers, then change the markers by using something like !aTMN green,brown then the next !aTMNX command will remove only green and brown markers. &nbsp;If you have a bunch of tokens marked, you can select more tokens and mark them as well. &nbsp; There will be duplicate markers in this case. &nbsp; Applying new markers does not automatically remove old markers. &nbsp; This duplicate marking is not a feature, but I’ve used this when there is a group in front of the PCs and another group behind and the chance for confusion is minimal. Summary In summary, out of the box: &nbsp; !aTMN - For the first ten selected tokens, this applies a pink marker and puts a numeral from 0-9 in them. &nbsp; The next ten tokens get a purple marker with a numeral. &nbsp; Tokens after the 20th are ignored. &nbsp; !aTMNX – Removes all markers currently used by aTMN (by default pink and purple) from all selected tokens. &nbsp; !aTMN marker1,marker2,…,markerN – (e.g. red,green,yellow,purple) sets the markers aTMN uses to marker1,marker2,…,markerN. &nbsp; The number of tokens that can be uniquely marked is 10 times the number of markers specified.
1686806614
The Aaron
Roll20 Production Team
API Scripter
As first scripts go, it's not bad! &nbsp;It's definitely a lot cleaner than my first script. &nbsp;=D&nbsp;