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

How to make a character token transform into a Werebear

Not sure what I did wrong but I followed this tutorial on Wildshape <a href="https://www.youtube.com/watch?v=p4lpuEnxxHI" rel="nofollow">https://www.youtube.com/watch?v=p4lpuEnxxHI</a> &nbsp;on how to make a Werebear token/character for one of my players. I edited this macro at the youtube channel to: &nbsp; &nbsp; Sten wills himself to transform! !token-mod {{ &nbsp; --set &nbsp; &nbsp; ?{Choose Form|Werebear,currentside#2 represents#@{Werebear|character_id} width#[[70]] height#[[70]] &nbsp; &nbsp; &nbsp;|Sten,currentside#1 represents#@{Sten Erikson|character_id} width#[[70]] height#[[70]] &nbsp; &nbsp; } &nbsp; &nbsp; bar1_link|hp bar2_link|passive_wisdom &nbsp; &nbsp; bar3_link|ac &nbsp; &nbsp; name|"Sten" &nbsp; &nbsp; showname|yes }} Whatever I did wrong, it's causing the character sheet of the player character to transform into the stats of the Werebear, specifically the AC and Hit Points. Can someone tell me what I did wrong here? Thanks for any assistance!
1689576282
The Aaron
Roll20 Production Team
API Scripter
Hmm. There's probably a race condition between the setting of the bar links and the changing of the token represents. I'll have to experiment with it a bit to see if I can isolate and fix it. In the meantime, you can just break it into two TokenMod commands, and it shouldn't cause that to happen. Just do the set for the represents and side in the first command, and the linking and such in the second. &nbsp;
Thanks for the response Aaron. I'm not smart enough to understand your suggested fix though. Would you be able to provide something I could copy/paste? No worries if that's asking too much.
1689625595
The Aaron
Roll20 Production Team
API Scripter
Sure, no problem.&nbsp; I was on my phone when I wrote that, which doesn't give the best experience for writing code.&nbsp; This is what I'm thinking (note, these can be just like this in the same macro, just need to be separate commands): !token-mod {{ --set ?{Choose Form|Werebear,currentside#2 represents#@{Werebear|character_id} width#[[70]] height#[[70]] |Sten,currentside#1 represents#@{Sten Erikson|character_id} width#[[70]] height#[[70]] } }} !token-mod {{ --set bar1_link|hp bar2_link|passive_wisdom bar3_link|ac name|"Sten" showname|yes }} This lets the setting of the represents and current side happen in one run through TokenMod, then makes the additional adjustments in the next run.&nbsp; The main issue here is that at the point where the bar links are being set, it has to set the bars to the value in those attributes (setting from the API doesn't force and update to the visible bar value automatically--I'd consider that a bug, honestly), however, it's doing the set as one collection, so the values get set at the same time as the links, which means the the linked attributes get updated with the value, but the new links haven't taken effect yet, so this forces and update of the old linked attributes to the incoming attributes' values. The long term fix for this is for TokenMod to be more intelligent about phased updates (it does this a little with defaulttoken and some of the lighting settings), but that's a somewhat large undertaking.&nbsp; Forcing a phased approach by separating it into two commands should also solve it.
Thank you so much for the help. Is there a way to get rid of these bars over the head of the token? They didn't appear until I created this macro.
I think I'm missing something. I put your script into the macro and now when I hit the "Transform" button, I get a message in the chat: But nothing actually transform with the token. Maybe I need to link the token somehow with the macro? I'm sure I'm forgetting something.
1689632634
The Aaron
Roll20 Production Team
API Scripter
That looks like you have a space or other character before the ! on the front of !token-mod.&nbsp; If you want to PM me an invite to your game and GM me, I can hop in and help get it working.
1689632877
The Aaron
Roll20 Production Team
API Scripter
Regarding the bars, they show up because there is a value in the max for the bar, likely from the attribute it is linked to.&nbsp; You could explicitly clear those out with: !token-mod {{ --set ?{Choose Form|Werebear,currentside#2 represents#@{Werebear|character_id} width#[[70]] height#[[70]] |Sten,currentside#1 represents#@{Sten Erikson|character_id} width#[[70]] height#[[70]] } }} !token-mod {{ --set bar1_link|hp bar2_link|passive_wisdom bar3_link|ac bar1_max| bar2_max| bar3_max| name|"Sten" showname|yes }} but that will change the underlying attributes.&nbsp; You could also set the tokens to be isdrawing|yes but that will make it not show the bubbles, name, or snap to the grid.
Ok, sent you an invite link. You'll have to tell me how to GM you once you're in.