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

Variable call Macro

I have 4 x macros...HitLoc1, HitLoc2, HitLoc3 & HitLoc4 I want to call these randomly via a d4 dice roll from within another macro... e.g  &{template:default}{{name=Head Shot}}{{...lands on location (! 
#HitLoc)1d4}} Anybody got an idea for something like this that will work??
Not knowing a huge amount about macros and such, couldn't this be solved by using a rollable table? If each of the hit locations are known and permanent, couldn't you just call for a location from a table? Recursive Tables might work well here. Just an idea, although I'm sure there may be tidier solutions out there.
Martin M. said: Not knowing a huge amount about macros and such, couldn't this be solved by using a rollable table? If each of the hit locations are known and permanent, couldn't you just call for a location from a table? Recursive Tables might work well here. Just an idea, although I'm sure there may be tidier solutions out there. Yeah...funny you should suggest that...I was thinking the same thing last night when I went to bed after posting this...will look into it more..cheers  :)
1527892270

Edited 1527892432
Ray
Pro
Ok...so I implemented a partial solution to this using rollable tables, but the game mechanics of the game system I am using still require me to generate a variable to call a random rollable table.... I am also using The Aaron's excellent Recursive Table API script...Thanks The Aaron ;) The code I am using is as follows: : !rt &{template:default}{{name=Head Shot}}{{hits [[1t[HitLoc[[1d6+3]]]]]}} Ray (GM):Head Shot Hits [[1t[HitLoc6]] So...I am almost there, I just can't quite seem to get it over the finish line...Any ideas?
1527894627
GiGs
Pro
Sheet Author
API Scripter
What isn't working? Does that macro command not work? With your hit location roll, are you using Hero System/Champions? if so, my damage script may help - it allows you to enter locations, or make any of the rolls for that system as part of rolling damage:&nbsp; <a href="https://app.roll20.net/forum/post/6009891/script-c" rel="nofollow">https://app.roll20.net/forum/post/6009891/script-c</a>...
G G said: What isn't working? Does that macro command not work? With your hit location roll, are you using Hero System/Champions? if so, my damage script may help - it allows you to enter locations, or make any of the rolls for that system as part of rolling damage:&nbsp; <a href="https://app.roll20.net/forum/post/6009891/script-c" rel="nofollow">https://app.roll20.net/forum/post/6009891/script-c</a>... I am using Hero system rules....looking at your script post now....