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

Add an FX to a Macro

I am using a potion of healing macro that updates HP.  I have it working but I would like to add an FX to this as well.  Any way I can do it by adding a script?  To make it simple I would use /fx burn-holy This is the Potion of Healing script I have working already !token-mod {{   --set     bar1_value|+?{Potion|Regular,[[2d4+2]]|Greater,[[4d4+4]]|Superior,[[8d4+8]]|Supreme,[[10d4+20]]}!   --report     all|"{name} drinks a healing potion and recovers {bar1_value:abschange} HP. " }}
1763539230

Edited 1763539279
Gauss
Forum Champion
I'd just tack the fx command on the macro after the fact.  Example:  !token-mod {{ stuff }} /fx command (note: I am being lazy and not typing the contents of "stuff" and "command".)
Gauss I did that but the FX command seems to override the token mod script.
1763577877
Gauss
Forum Champion
Could you post the macro of that?
!token-mod {{   --set     bar1_value|+?{Potion|Regular,[[2d4+2]]|Greater,[[4d4+4]]|Superior,[[8d4+8]]|Supreme,[[10d4+20]]}!   --report     all|"{name} drinks a healing potion and recovers {bar1_value:abschange} HP. " }} /fx glow-charm @{target|token_id} @{selected|token_id}
1763588262

Edited 1763588352
Gauss
Forum Champion
Here you go:  !token-mod {{ --ids @{target|Target 1|token_id} --set bar1_value|+?{Potion|Regular,[[2d4+2]]|Greater,[[4d4+4]]|Superior,[[8d4+8]]|Supreme,[[10d4+20]]}! --report all|"{name} drinks a healing potion and recovers {bar1_value:abschange} HP. " }} /fx glow-charm @{target|Target 1|token_id}
thank you Gauss
1763733882
timmaugh
Forum Champion
API Scripter
To explain what is going on, here: There's a long standing bug (so long standing that it's just the way things operate on Roll20) that messages with a targeting structure (i.e., @{target|token_id} ) do not have "selected" tokens. So a script like TokenMod, which is defaulted to operate on the selected tokens, has nothing to do when you introduce a targeting statement without further alterations. And, for a multi-command macro, the whole thing is essentially treated as one big message for the purposes of designating any selected tokens... if one of the statements has a targeting command, none of the statements will have selected tokens. Gauss gets around that by using the "--ids" argument of TokenMod, which allows you to explicitly designate the tokens it should affect. (The Metascript Toolbox has ways to give selected tokens to a message, if you had to get around this "bug" in a script/message that did not otherwise offer something like an "--ids" argument option.)