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

[Script] Faces 1.0

1665018644

Edited 1665957000
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
[Script] Faces The  original thread  for this script has expired, and I was tired of editing in updates. There have been several improvements from the original, hence the new thread. [ CODE ] - will be in One-Click soon, if no one finds any glaring errors. This script is designed to provide a quick visual interface for swapping token images and names, as well as for quickly making rollable tables from an existing set of tokens, both simple and multisided. I originally built it for a Changeling character I want to play, so that I easily could build up a library of disguises from tokens I encounter. The interface will work for both players and GMs. Assigning images to token from a rollable table The script calls names and images from any rollable table that has a name and image for each entry: To call up the chat interface, use  !faces [tablename] . For the above example: !faces Portraits ...builds this in chat: This menu is visible only to the person issuing the command, so it shouldn't spam the interface. The interface is non-persistent as well, so it will not leave litter in the Chat Archive or persist from game to game. Clicking an image will assign that image to any selected token. Clicking the name will likewise change the token's name. Filtering results after the name of the table, and separated by a space, you can use a the word "filter" followed by a vertical pipe and one or more keywords. !faces <tablename> filter| This will only show results from a table if the table item name includes whatever comes after " filter|". Multiple keywords can be used. In order for an item to display, it must satisfy all keywords. example, if you have a table named "Warriors" that includes: elf archer 1 elf archer 2 human archer elf wizard dwarf mage !faces Warrior filter|archer will only return entries for elf archer 1 elf archer 2 human archer !faces Warrior filter|archer elf will only return entries for elf archer 1 elf archer 2 A good use for this might be a table of commoners that includes elves, humans and dwarves. When you are in a large cosmopolitan area, you might want to choose from the whole table. If you are in the dwarven mines of Shmoria, you might only want the dwarf entries.   Displaying results from the token, rather from a rollable table If you have an existing rollable token on the VTT, you can select it and type !faces existing This will use the same interface as described above, but the token faces will come from the token if it is a rollable table token. It will not display name or token notes in the dialog box, since those would be identical (it's a single token). Adding images to a rollable table one at a time Clicking the button  [Add an image to this table]  will prompt the user to target a token on the VTT, and ask for a name. The resulting name and image will form a new entry in the rollable table: [Display this table]  is the same as issuing the !faces command for the  rollable  table, showing not just the new token face, but all tokens on the rollable table. [Add another image to this table]  repeats the process as above. Adding images to a rollable table in bulk This method will allow you to grab a token or group of tokens on the VTT and use their faces to create a new rollable table or to append their faces to an existing table. All newly added faces are titled "Item_1", "Item_2", and so on. It will not overwrite existing entries on the table, and it does not check for duplicates. If the table does not exist, it will create one. !faces create Commoners This will create a table called "Commoners" if none exists, and add all the faces of any selected tokens to the table. It any of the selected tokens are multi-sided, it will add each face in the token to the table. Random Image Assignment The title bar of the token images display now has a little "Random Image" button:   ;  . If you press this button while selecting one or more tokens, the script will assign random images to each of the selected icons. Currently this only works from images pulled from a rollable table, but in the will eventually also work with images generated by existing rollable token images. What this script does not do: Adjust token size. Change any token-character representation, linking, or attributes. It is not intended to be a Wildshape script. There are much better-suited scripts for that. Potential uses for this script: Disguise-master characters Changeling characters Alter Self  and  Seeming  spells (and similar) Providing the GM a way to alter the image choices for a group of enemies. Quickly differentiate between goblin archers, goblin infantry, dead goblins Give a visual interface for a player who has multiple expressions or variations for their character Characters who contract lycanthropy Monsters with different states: Ankheg on surface, surfacing or a Bugs Bunny-style burrowing mound Build a library of townsfolk, scholars, city guards or other commoner-types. Assigning map pin icons: Tavern vs temple vs shop, etc. Quickly changing the state of a trap image Changing a closed door image to an open door image. Laying out a bunch of map tiles and quickly switching between them to build a dungeon having tables for map furnishings: a chair table, a door, even a table table. Change downed enemies to a creative variety of grisly remains? A GM could present players with a menu of tokens for their PCs A rollable table of scenes and images to show characters using shift-Z. Just keep one token on the VTT and switch at need. Quickly create a rollable table from a bunch of uploaded images. Move image from one token to another (select first token, use !faces existing, and use the resulting button to assign to one or more other tokens) Randomly populate a scene with differentiated token images Probably more I haven't thought of. I've tried to build this so it works equally well for dark and light mode, since the API has no way of adjusting currently. Code is updated  here .
1665048374
Oosh
Sheet Author
I feel like combining this script with my token art would be like wiping faeces on the Mona Lisa.
1665127051
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
New Feature: Random Image Assignment The title bar of the token images display now has a little "Random Image" button:   ;  . If you press this button while selecting one or more tokens, the script will assign random images to each of the selected icons. Currently this only works from images pulled from a rollable table, but in the will eventually also work with images generated by existing rollable token images.
1665956838
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The script should be available in One Click after the next merge (likely Tuesday). After that, I will pull the code link from this thread.