phylll / mychs-macro-magic

A simple, sane, and friendly little scripting language for your Roll20 macros.
MIT License
0 stars 0 forks source link

Fix token selection #42

Closed phylll closed 2 years ago

phylll commented 2 years ago

Selecting "Yerrick MacRothgar" as GM in our TEST game and using its melee attack ability (which calls meleeAttack without customizing cOwnID) leads to this error:

Abbruch: Keine Zuordnung zu einem zugreifbaren Charakter möglich - [object Object]

There should be a default to selected.

phylll commented 2 years ago

Not a bug at all. Roll20 allows only either selected or selecting a target, and since the attack scripts require selecting a target, in that moment the previously selected token is deselected and thus selected is undefined once the script starts to execute. Only solution is to set cOwnID in the config script, either hardcoded to a token name or with an if...then construct to selected or sender. Closing.