Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Script:Modify Token Image

From Roll20 Wiki

Jump to: navigation, search
API ScriptAuthor: Zachare S
Version: 1.0.4
Last Modified: 2019-04-11
Code: ModifyTokenImage
Dependencies: None
Conflicts: None
Modify Token Image is a script to allow you to change your token images via the API. It allows you to change the look of your tokens (for example, polymorph or if someone switches from NPC to enemy).

This is also how you can switch out Character Tokens if you come up with something different.

WARNING: Changing the token image will *NOT* change the Default Token Image for *any* of the Journal Character Entries. You must delete the default token, and then re-add it.

Contents

Setup

Before you can run any Modify Token Images, you must have a Folder in your Journal named "Token Images" (without the quotes, obviously). The system will expect this folder exists, and, if you install this script without this folder, it will notify you that the Folder does not exist.

Adding in Token Images

Each Token Image needs to be added as a Handout with a Folder name of the name of the Token. For example:

See Example: Imgur Url Link

The Token "Oriana" needs to have a Folder named "Oriana" in "Token Images." Each token needs to have an avatar image of what token you plan on switching out for the current token.

Commands

!ModifyTokenImage --next
Changes the currently selected token's image to the next token valid token image in the folder for that token.

!ModifyTokenImage --previous
Changes the currently selected token's image to the previous token valid token image in the folder for that token.

!ModifyTokenImage --set <NameOfHandout>
Changes the currently selected token's image to the <NameOfHandout> image in that folder.

!ModifyTokenImage --gm
GM ONLY COMMAND Allows or disallows Player use of the above commands.
NOTE: Even though players can use these commands, they can *only* execute these commands on tokens controlled by themselves. GMs can modify *all* tokens *always*. Also, this defaults to Players off. If you want to change the default, you need to change it in the script.

!ModifyTokenImage --debug
GM ONLY COMMAND Enables or disables Debug outputting to the log.

Changelog

1.0.4: Fixing issues with locating the correct image to place on the token. Initial commit.