Hey all. Longtime forum browser. First time poster ;) I’ve been DMing for about 6 months. Learning my way around macros and APIs. Using many of them. 1000+one thank yous to all who have contributed. Such an enhancement to the platform. I have to say: I am amazed at how supportive the Roll20 community is (…and that’s not a setup/butter you up for my question. I mean it)!
So, my dilemma: I’ve got a Bag of Tricks and I’m trying to make a Fuzzy Object morph into the appropriate creature with a button click. I can do it in a drop down menu, but I can’t figure out how to make it happen on a roll. I’m not a programer, but I can occasionally sort through and tweak other people's code to make things do my bidding.
I’ve got a Fuzzy Object character. The default token is a multi-sided token I created from my [BagOfTricks] roll table. It has this Token Action on it:
!token-mod {{
--set
?{Choose a Trick|Weasel,currentside#1 represents#@{Weasel|character_id}
|Giant Rat,currentside#2 represents#@{Giant Rat|character_id}
|Badger,currentside#3 represents#@{Badger|character_id}
|Boar,currentside#4 represents#@{Boar|character_id}
|Panther,currentside#5 represents#@{Panther|character_id}
|Giant Badger,currentside#6 represents#@{Giant Badger|character_id}
|Dire Wolf,currentside#7 represents#@{Dire Wolf|character_id}
|Giant Elk,currentside#8 represents#@{Giant Elk|character_id}
}
bar1_link|hp
bar1_reset|0
bar2_link|npc_ac
bar3_link|npc_speed
name|”Bag Pet”
showname|yes
}}
This is tweaked script I found here (credit where it’s due, The Aaron):
Is there a way to do something akin to this:
varRoll /roll 1d8
varName [[varRoll T[BagofTricks]]]
--set varName currentside#varRoll represents#@{varName|character_id}
name|varName
I’ve searched around but can’t find/don’t know where to look to find a potential solution. Macros can't store values, correct? Is there's any solution that could automate the roll and selection? If not, I just roll a 1d8 then manually choose, but, you know... looking for the most efficient solution. Any all help is greatly appreciated! Regardless, my hat is off to the myriad macro/API contributors. You’ve made the game much more enjoyable for me and my party!