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

Syntax for /fx not working?

October 31 (8 years ago)
Quinn
Pro
Sheet Author
I feel dumb for posting this, but I've read over the wiki page multiple times and scoured the forums for answers, and I feel like I must be missing something obvious in how the /fx command is supposed to work.

So, I have a token on the map. It has an ID of -ABC. I want some kind of effect to appear on it. Attempt 1:
/fx burn-death -ABC
Result: "TypeError: Cannot read property 'view' of undefined", no effect displayed.

Attempt 2:
/fx burn-death @{-ABC}
Result: "TypeError: Cannot read property 'substring' of undefined", no effect displayed.

The syntax described on the wiki is so simple that I can't imagine what else it could be. What am I missing here?
October 31 (8 years ago)
The Aaron
Pro
API Scripter
Are you using -ABC as a placeholder?

Try this:
/fx burn-death @{target|token_id}
October 31 (8 years ago)

Edited October 31 (8 years ago)
Quinn
Pro
Sheet Author
Oh, those were supposed to be literal - I assumed that meant "put the token ID for the target in here when you actually enter the command".

What if I want an API script to spawn an effect on a specific token? Is there a format for that? As in:
var id = token.get('_id');
var fxCommand = '/fx burst-death '; // Something else goes here
sendChat("Wizard", fxCommand);
October 31 (8 years ago)

Edited October 31 (8 years ago)
The Aaron
Pro
API Scripter
Well, hardcoding the token_id will definitely work, provided that token still exists.  The API doesn't need a token id as it can just spawn an effect at a location directly: https://wiki.roll20.net/API:Utility_Functions#Spec...
October 31 (8 years ago)
Quinn
Pro
Sheet Author
And THAT's what I was overlooking. Thanks for the help!
October 31 (8 years ago)
The Aaron
Pro
API Scripter
No worries!  Feel free to post any API questions in the API forum and they'll get pounced on post haste!  =D