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

[Question] Graphic:Token change updates the Character Sheet default token?

1609339048
Pat
Pro
API Scripter
This is in regards to the never-ending problem of updating a character token after  updating their vision, or aura, or other attribute that we want to keep on the token when we drag it to a new map... and forgetting to go into the character sheet, delete the former token, and replacing the token?  Added to this: is there a way to propagate token changes to all existing tokens representing the character on all maps?  I'm wondering if there is already a script that does this automatically or provides a button for DMs to do so - the last time I tried to tackle something I found out it had already been done twice over, so I imagine this problem has already been tackled. Is there a script that does this already, as an automatic behavior?
1609339802
Jordan C.
Pro
API Scripter
Does this solution accomplish what you are going for or are you looking for something more? (Some limitations apply) <a href="https://app.roll20.net/forum/post/9033474/help-how-to-quickly-set-token-default-using-scripts-slash-macros" rel="nofollow">https://app.roll20.net/forum/post/9033474/help-how-to-quickly-set-token-default-using-scripts-slash-macros</a> !token-mod&nbsp;--set defaulttoken
1609340398

Edited 1609340600
Pat
Pro
API Scripter
Jordan C. said: Does this solution accomplish what you are going for or are you looking for something more? (Some limitations apply) <a href="https://app.roll20.net/forum/post/9033474/help-how-to-quickly-set-token-default-using-scripts-slash-macros" rel="nofollow">https://app.roll20.net/forum/post/9033474/help-how-to-quickly-set-token-default-using-scripts-slash-macros</a> !token-mod&nbsp;--set defaulttoken A little more - I'm looking out for other forgetful DMs like me that set a character's torch to "on" and then teleport them to another map where the torch is not set - I realize a watch for graphic:change &nbsp;would not catch API updates, but this is more about 'hey, you made a vision change that you forgot when the token was created - did you want to propagate that back to the sheet, and then to all of the other associated tokens on other pages?" To be clear : I'm not asking someone else to make this - I'm going to make this if it isn't already there. I just want to know if it's already there.&nbsp; Last point : The one thing I wish it would *really* do to propagate to other pages is to update the token image on other pages, and I realize the stricture on marketplace images prevents this.&nbsp;
1609341080

Edited 1609341309
Jordan C.
Pro
API Scripter
Ahhhh gotcha, so adjusting already existing instances of the token. I don't think that exists but I'll let others verify that as well. I imagine you could make the same changes to all tokens that represent the character of the changed token without recreating them? And if you can do so without changing the imgsrc would that avoid the Marketplace Item limitation? Something like: let allTokens = findObjs({ _subtype: 'token', represents: 'referenceTokenCharacter' }); Then set all the previous properties to those objects?
1609341289
The Aaron
Roll20 Production Team
API Scripter
If you are changing the light settings with TokenMod, you can specify a character id instead of a token id (or selected token) and it will make the same adjustment to all tokens that represent that character.&nbsp; That's the closest I know to a script that does what you are considering writing.&nbsp; I have a vague recollection that there is some complication with doing the update (I think it has to do with linked bars and relative changes), but I don't think that would affect your case.&nbsp; One thing to be aware of is that when you set the default token, it will lose any custom bar configurations the user may have made. Really, it might make more sense to add this as a feature of the teleport script so that when a token teleports, it updates the token on the new page with the settings from the old page.
1609342844
Pat
Pro
API Scripter
The Aaron said: If you are changing the light settings with TokenMod, you can specify a character id instead of a token id (or selected token) and it will make the same adjustment to all tokens that represent that character.&nbsp; That's the closest I know to a script that does what you are considering writing.&nbsp; I have a vague recollection that there is some complication with doing the update (I think it has to do with linked bars and relative changes), but I don't think that would affect your case.&nbsp; One thing to be aware of is that when you set the default token, it will lose any custom bar configurations the user may have made. Really, it might make more sense to add this as a feature of the teleport script so that when a token teleports, it updates the token on the new page with the settings from the old page. Understood - the use-case I'm looking at is a reminder/button or outright update of the default token if the GM is making, say, a vision change to a token that was created without vision and forgets to update the default token - and you're saying it would lose any custom bar configurations meaning...updating it with the currently selected token won't keep the changes made?&nbsp;
1609342928
Pat
Pro
API Scripter
Jordan C. said: Ahhhh gotcha, so adjusting already existing instances of the token. I don't think that exists but I'll let others verify that as well. I imagine you could make the same changes to all tokens that represent the character of the changed token without recreating them? And if you can do so without changing the imgsrc would that avoid the Marketplace Item limitation? Something like: let allTokens = findObjs({ _subtype: 'token', represents: 'referenceTokenCharacter' }); Then set all the previous properties to those objects? Well, I need to figure out if the changes all take place at once due to a "save" on the token versus the individual changes that happen with the token updates that normally occur with changing rotation, position, or status markers for instance.&nbsp;
1609351016
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Pat said: - and you're saying it would lose any custom bar configurations meaning...updating it with the currently selected token won't keep the changes made?&nbsp; Those features have not yet been exposed to the API and can't be set by it. Despite many pleas to the dev team. :(
1609371288
The Aaron
Roll20 Production Team
API Scripter
Just the things like Bar Position and compact vs standard get reset back to Above/Standard. Generally speaking, if you change a bunch of stuff in the Token Settings, they all come in a single change event.
keithcurtis said: Those features have not yet been exposed to the API and can't be set by it. Despite many pleas to the dev team. :( Upvotes to&nbsp; this Suggestion &nbsp;to expose Bar Position &amp; Styles to the API would be helpful!
1609435929
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren K. said: keithcurtis said: Those features have not yet been exposed to the API and can't be set by it. Despite many pleas to the dev team. :( Upvotes to&nbsp; this Suggestion &nbsp;to expose Bar Position &amp; Styles to the API would be helpful! Yup, I'm already there. I also make regular pleas through other channels.
1609600975
David M.
Pro
API Scripter
Upvoted! Jarren K. said: keithcurtis said: Those features have not yet been exposed to the API and can't be set by it. Despite many pleas to the dev team. :( Upvotes to&nbsp; this Suggestion &nbsp;to expose Bar Position &amp; Styles to the API would be helpful!