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

FX in an ability not going to chat properly

1599503402

Edited 1599503469
I'm trying to make an ability to output /fx based on a few inputs, basically the type and how many. I'm using the D&D5e Roll20 sheet. So far I have this, which gives the proper inputs, but the output shows in the chat as having been spoken by me, not as an actual /fx.  If I copy/paste the output into the chat box, it works fine.  How can I get it to actually submit the /fx instead of making it appear that I said it. /em PEW PEW!! {How Many|One, /fx beam-?{Type|Death,death|Fire,fire} @{target|Caster|token_id} @{target|Target 1|token_id}|Two, /fx beam-?{Type} @{target|Caster|token_id} @{target|Target 1|token_id}, /fx beam-?{Type} }@{target|Caster|token_id} @{target|Target 2|token_id}
It looks like you just need to add a ? at the start of the query. (Bolded below for emphasis) /em PEW PEW!! ? {How Many|One, /fx beam-?{Type|Death,death|Fire,fire} @{target|Caster|token_id} @{target|Target 1|token_id}|Two, /fx beam-?{Type} @{target|Caster|token_id} @{target|Target 1|token_id}, /fx beam-?{Type} }@{target|Caster|token_id} @{target|Target 2|token_id}
1599512710

Edited 1599513207
Ziechael
Forum Champion
Sheet Author
API Scripter
There were a few, easily made, issues here. To start, this one will work: /em PEW PEW!! !?{Type|Death,death|Fire,fire} ?{How Many|One,/fx beam-?{Type} @{target|Caster|token_id} @{target|Target 1|token_id}|Two,/fx beam-?{Type} @{target|Caster|token_id} @{target|Target 1|token_id} /fx beam-?{Type} @{target|Caster|token_id} @{target|Target 2|token_id}} The mistakes being: You don't need to do html replacements on { You don't need to do html replacements on the offending characters ( , | } ) when part of an attribute call such as the token_id calls You were missing some key syntax, the opening ? as previously pointed out and a closing } to the overall query You had spaces before the "/fx" calls which meant, when sent to chat, you'd get " /fx" which wouldn't be a valid call Changes I made for your convenience: I prefixed the whole macro with a fake API call "!?{Type|Death,death|Fire,fire}" which allows you set your variable without html replacements and call it within the macro itself with the simplified, and minimal html, version of "?{Type}" A hard return is needed between the two fx calls for that option otherwise you'll only get one anyway I can't remember whether it is possible or not to avoid having to select 2 targets every time regardless of your choices but if it isn't then you'll just need to select the same target twice for a single beam option which isn't too much of a hassle right? ;) Hope that helps a bit with this complex subject.
Thank you both so much.  I did have the opening ?, it must just not have been in the highlight when I copied it over. Ziechael, you solution worked a charm.  Thank you. I had started that way, but kelp replacing the characters with the escape code bae on things being cut off in chat.  Seems like all I need when I started was the ! in front. Thanks again for the info!