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

[ChangeTokenImage] Script. Changing face without token selected

1505773861
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm working on a page right now that has a variety of theatre of the mind scenes as faces on a rollable token. I have it set up so that when I click on a menu option in chat, it switches to the new scene, sizes it appropriately and plays an associated sound track. It's working just fine, but only if I have the token selected. Ideally, I'd like to have the token on the map layer, so I can put PC tokens on the token layer if a player needs it for some functionality. The scripts I am using use Roll20AM to control the sound, TokenMod to control the size, and ChangeTokenImage to control the face. From what I can see, TokenMod has an ids property which should allow me to specify the scene token without selecting, but I don't see any similar functionality on ChangeTokenImage. Is this possible? BTW, if anyone wants the code for the macro that does this, all, let me know. It's very handy to have one "Scene" page and to be able to move my players from environment to environment with a button click.
1505776252
The Aaron
Pro
API Scripter
Can you link to ChangeTokenImage?
Does your macro use @{selected|token_id}? If so, you can just replace that with the actual token ID on that page. Otherwise it would take a little bit of modification of that script to change it.
1505781392
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Aaron said: Can you link to ChangeTokenImage? Here's the  wiki entry , that has the  github link on it. Though I just have the One-click installed on that, which has your name as one of the authors :) Does TokenMod have the ability to change a face on a rollable token? I looked but didn't see a command for it, otherwise, I'd just drop the other script.
1505781617
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Sky said: Does your macro use @{selected|token_id}? If so, you can just replace that with the actual token ID on that page. Otherwise it would take a little bit of modification of that script to change it. No, the macro is really just a menu of API command buttons in a roll template, where each button calls a string of three API commands. Token Mod can apparently work by a token ID, Roll20AM doesn't deal with tokens, but ChangeTokenImage assumes you have a token selected and acts accordingly. I can find the token id for the rollable token, but nothing to assign it to in third script.
1505782214
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here's a sample button. These are all in a roll template attached to the scene token character as a token macro, to give the whole shebang portability. [Deadwood](!roll20AM --stop,ignore| !roll20AM --play,loop|Deadwood Inon Zur - The Fellwood !change-token-img --set 1 !token-mod --set width|[[70*22]] height|[[70*14]])
1505788910
The Aaron
Pro
API Scripter
I might have added that face setting secretly...  I'll have to check. If not, I can likely add it. 
1505789664
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Secret code!