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

Replacing one token/character with a different token/character

Hi, I'm working on a Cortex Prime campaign, which makes a lot of use of dice pools and either "stepping up" or "stepping down" a die, so if you step up a D8 die it becomes a D10.  I've created dice tokens using rollable table tokens, so there is a D8 token which has all 8 sides, and a D10 token with 10 sides, etc.  I have a button which will randomly selected a side, which replicates rolling that die.  The D8 token is tied to character sheet called "D8", while the D10 token is tied to a character called D10.  I want to select the D8 token, and click a button to have it delete the D8 token and replace it with a D10 token from the D10 character sheet.  Or alternatively, instead of deleting the original token and creating a new one, maybe it could change the original D8 token to be linked to the D10 character sheet and somehow update all its properties and the rollable images from the default D10 character?  Is something like that possible with any existing mods?  I have been searching for it, but haven't found anything yet.  If there isn't an existing mod, is it possible to write a script to do that?  I'd appreciate any guidance. Best wishes, Lindharin
You could create a rollable token that has all the different die sizes, then use TokenMod to change the token face and change the 'represents' of the token at the same time to the corresponding die.  Or alternatively you could use a single character with a rollable token, and use TokenMod to change the token face, and use ChatSetAttr to change the attribute that is used for the dice pool.
1673767427

Edited 1673767531
Jim
Pro
In case anyone else is looking for similar functionality in the future, the solution is to use SpawnDefaultToken API.  The macro command is:  !Spawn --name|D6 --deleteSource|1 --side|1  where you replace the D6 with the name of your desired character sheet/token.
Thanks, Jarren.  I wondered if something like that would work, but wasn't sure how to bring it all together.  The SpawnDefaultToken does it though; it works really well. Thanks again!