
Hello there !
I recently had a problem using the !cfx command. Indeed, for explosion-type fx, the command inverts target and source. As a consequence, it appears that the caster explodes (instead of the target).
I saw that someone had the same problem on a roll20 topic named "CFX & DELAY", but this strided from the original subject. Hence this new topic.
So I think that !cfx commands are functioning for beam-like fx but not explosion fx. Indeed when I actually use a command like :
!cfx burst-fire @{selected|character_id} @{target|token_id}
the burst effect takes place at the caster's feet . I found a temporary solution. Let me explain : the !cfx command works like this :
!cfx [effect] [source character id] [destination token id]
If you call it like that and the effect is (for example) "beam-fire" it works fine. But if the effect is "explosion-fire" then the target and the source are switched (target is fine, source explodes). Hence I tried to call the function with a "reverse" progression :
!cfx [effect] [destination character id] [source token id]
and it worked perfectly fine as long as I had only ONE token representing the character I want to target physically on the map.
Let me be a bit more precise. For instance, if I type "!cfx burst-fire @{target|character_id} @{selected|token_id}" at an ogre (which is the "target") (the "selected" token is the red-horned tiefling) and if there is only ONE token "ogre" on the map, then the ogre will burst into flame, great.
Fig. 1 : 1 ogre burst into flames
But if I try the same script at a goblin, and let's say there are 3 goblins on the map, all 3 goblins burst into flame (and that's logic because the script calls as an argument the character_id, and all three goblins are linked to the same character, the same NPC Sheet. Hence they have the same character_id).
Fig.2 : All 3 goblins burst into flames
Hence, the "normal" sequence ([effect] [source] [target]) does not work for explosion-type fx but works perfectly fine for beam-like fx. The reverse "sequence" ([effect] [target] [source]) only works for explosion-type fx if there is only ONE token representing the target on the map (and as a consequence this sequence is also not a viable solution).
I thought to some solutions :
1) Keep the "reverse" sequence for explosion-types fx but instead of using "character_id" use "token_id" (as each token has a unique token_id, all 3 goblins should not all burst into flame but only the one I targeted)
2) Keep the "reverse" sequence for explosion-types fx but instead of using "character_id" use "token_name" AND a script like TokenNameNumber so that every token has a different name (same conclusions).
The problem is : I'm not familiar with roll20 programming language (and Object Oriented Programming in general ^^) and I don't know how to modify the code in order to do that ..! If someone can help it would be really nice :)
Thanks !