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

Need to Link Two Character Sheets, Kinda

So, I have a weird situation, and I'm hoping there's a way to do this programmatically. I have a player in a 5e game that, for reasons, I've allowed to build as a Jekyll/Hyde design, where one class is an Alchemist Artificer, and the other is a Path of the Beast Barbarian. Note, this isn't a multiclassing, its two separate sets of skills and abilities, where only the INT and STR stats swap based on form, and health, hit die, other stats, and inventory carry over. I know that a token can only be bound to a single sheet, but I was hoping that I could at least have the two sheets at least sort of maintain each other. I do have pro subscriber access, so APIs, custom sheets, etc. would also be an option, if there's a better way to handle this. I'm not afraid to do something outside the norm, I'm just don't know enough of the underlying code environment to begin to make something like this. If you provide a script, please comment the code so I can learn what makes it work. I've also posted this same question on /r/Roll20 and was directed here.
1646093036
David M.
Pro
API Scripter
If you set up a multi-sided token with only two sides, you could set up the following macro using the token-mod script: !token-mod --set currentside|+1 represents|?{Which character?|Artificer,@{ArtificerCharName|character_id}| Barbarian,@{BarbCharName|character_id}} You will need to replace the two charname placeholders above with the appropriate names. Then just select the token and run the macro. This will change the side of the token to show the appropriate artwork and change the represents property of the token to the appropriate sheet. If you don't want to mess with different artwork, just remove the currentside|+1 part.
David M, thank you for that piece with the token, I'll definitely look at that as a part of it! Any thoughts on what to do to keep the sheets themselves synchronized?
1646095875
David M.
Pro
API Scripter
So, I if I understand: you want two separate sheets with different classes and abilities. Stats are identical except for INT/STR. But you want hp, hit dice, and inventory shared? I think Hit dice and inventory are going to be your biggest issues. Not sure how to handle those. Hp could be carried over with token-mod if you use linked bar values, but putting it into a single query macro would be a pain. If you go that route, I might make two macros (well, character abilities really) instead and hardcode each option. You could then put them into a single chat menu (with two buttons) if you wanted. 
1646098502
GiGs
Pro
Sheet Author
API Scripter
If the character sheets are already made, and you just want to swap a sall number of stats from one sheet to the other, look into using the chatSetAttr script.
GiGs said: If the character sheets are already made, and you just want to swap a sall number of stats from one sheet to the other, look into using the chatSetAttr script. I was thinking the same thing, but then I reread the part about it being a character who basically switches back and forth between two different classes.  I think the best option would be to simply maintain two character sheets and swap them when changing classes.  To deal with inventory, another idea would be to just create an 'Inventory' character and that way all the items wouldn't need to be duplicated between sheets.
1646102177

Edited 1646102213
Kraynic
Pro
Sheet Author
Yeah, my "simple" suggestion on reddit was to just copy the main character sheet any time there were major changes, and then edit the copy for the alternate personality. But as far as the api, I suggested posting here.
1646106098

Edited 1646106138
David M.
Pro
API Scripter
Since stats rarely change, it's probably easiest to maintain those manually. Same for max hp (current hp handled below). Jarren's inventory sheet is a great idea. During play, you would select token, run one of the two token-mod macros below (assumes bar1 for hp), then either alt-doubleClick to open the new sheet to access actions or have them previously set up with token actions (possibly set up with TokenActionMaker). Note if relying on token actions you would need to unselect and reselect the token to refresh with the new sheet's buttons. ToBarbarian !token-mod --set currentside|1 represents|@{BarbCharName|character_id} bar1_value|@{ArtificerCharName|hp} ToArtificer !token-mod --set currentside|2 represents|@{ArtificerCharName|character_id} bar1_value|@{BarbCharName|hp}
Coartana said: So, I have a weird situation, and I'm hoping there's a way to do this programmatically. I have a player in a 5e game that, for reasons, I've allowed to build as a Jekyll/Hyde design, where one class is an Alchemist Artificer, and the other is a Path of the Beast Barbarian. Note, this isn't a multiclassing, its two separate sets of skills and abilities, where only the INT and STR stats swap based on form, and health, hit die, other stats, and inventory carry over. I know that a token can only be bound to a single sheet, but I was hoping that I could at least have the two sheets at least sort of maintain each other. I do have pro subscriber access, so APIs, custom sheets, etc. would also be an option, if there's a better way to handle this. I'm not afraid to do something outside the norm, I'm just don't know enough of the underlying code environment to begin to make something like this. If you provide a script, please comment the code so I can learn what makes it work. I've also posted this same question on /r/Roll20 and was directed here. Here is a sample of a tokenmod macro I use for my druid player in a game for ideas on what you can do with it: It takes the players properly well setup token and changes its side and what sheet it represents and its barlinks, it also adjust the hps with a roll of dice but for you it'd probably be a fixed value.&nbsp; Because it uses a query that has to replace characters, you need to set a key like this on a macro mule, then make a collections macro that calls the token action on the macro mule, then give the collections macro to the player permissions wise along with the macro mule thats archived and set the collections tab macro as a token action.&nbsp; You have to make a macro for this because when you change the sheet its represented on, he loses the button to change back.&nbsp; You could put the ability on his sheets instead of a macro mule if its just one player using this.&nbsp;&nbsp; ?{Which Shape?||Shayla,!token-mod --set currentside#1 width#70 height#70 represents#@{Shayla|character_id} bar1_link#hp bar2_link#class_resource bar3_link#other_resource name#'Shayla' showname#yes light_radius#=60 light_dimradius#=-5 light_angle#360 aura1_radius#10 aura1_color#00ff00 --off light_otherplayers @{selected|token_id}|Raptor,!token-mod --set bar1#[[3d4+3]] currentside#3 width#70 height#70 represents#@{Shayla Velociraptor|character_id} bar2_link#npc_ac bar3_link#npc_speed name#'Shayla' showname#yes light_radius#5 light_dimradius#-5 light_angle#360 aura1_radius#10 aura1_color#00ff00 --off light_otherplayers @{selected|token_id} &amp;{template:traits&amp;#125; {{name=Velociraptor&amp;#125;&amp;#125; {{source=&amp;#125;&amp;#125; {{description=[Spell](<a href="https://media.giphy.com/media/4Kz0smpvpGT3ZcdVMA/giphy.gif)&amp;#125;&amp;#125" rel="nofollow">https://media.giphy.com/media/4Kz0smpvpGT3ZcdVMA/giphy.gif)&amp;#125;&amp;#125</a>;
David M. said: Since stats rarely change, it's probably easiest to maintain those manually. Same for max hp (current hp handled below). Jarren's inventory sheet is a great idea. During play, you would select token, run one of the two token-mod macros below (assumes bar1 for hp), then either alt-doubleClick to open the new sheet to access actions or have them previously set up with token actions (possibly set up with TokenActionMaker). Note if relying on token actions you would need to unselect and reselect the token to refresh with the new sheet's buttons. ToBarbarian !token-mod --set currentside|1 represents|@{BarbCharName|character_id} bar1_value|@{ArtificerCharName|hp} ToArtificer !token-mod --set currentside|2 represents|@{ArtificerCharName|character_id} bar1_value|@{BarbCharName|hp} So far, this is looking like the most plausible, and my player will just have to manually maintain the sheets for inventory and hit die. I figured the overall was a longshot anyway. Now, I generally have bar 2 as AC, so if I understand properly, on the ToBarbarian macro, I'd set it to: !token-mod --set currentside|1 represents|@{BarbCharName|character_id} bar1_value|@{ArtificerCharName|hp} bar2_value|@{BarbCharName|ac} And on the ToArtificer, I'd set it to: !token-mod --set currentside|2 represents|@{ArtificerCharName|character_id} bar1_value|@{BarbCharName|hp} bar2_value|@{ArtificerCharName|ac} Is that correct?
1646242600
David M.
Pro
API Scripter
Note that while this works, if you do it this way you will remove the token's bar2 link to AC. So if it is changed on the character sheet, the token will not reflect the change. Instead I would replace your bar2_value syntax in both macros with bar2_link|ac This should refresh the link to the represented sheet.
Ok, this gives me some starting ground for poking around on things. I'll have to see how it works in practice to see if I have any other questions.