You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
Describe the bug
Players are unable to execute script macro via applying a condition with Enhanced Conditions despite having the proper permissions to execute script macros in the world. The macro execution works fine for the GM.
To Reproduce
Steps to reproduce the behavior:
Create any script macro, such as a console.log (actor, token) macro, and set it in the Condition Lab to be executed alongside a certain condition.
When logged in as GM, apply the condition to a token. It should function fine. Remove the condition again.
When logged in as a player, apply the same condition to a token that you own. It does not execute the macro.
Expected behavior
Players should be able to execute script macros via applying conditions when those conditions are set up to do so in the Condition Lab.
Screenshots
n/a (though I can get some if that would help? just tell me what of!)
Environment Info (please complete the following information):
Foundry Version: 9.269
Game System / Version: LANCER 1.2.0
CUB Version 1.9.2
Browser Firefox
OS Windows 11
Additional context
Specifically, the macros I am trying to get to work are macros that apply/remove TokenMagicFX visual effects. I also tried giving all players ownership permission of the applicable macros within the macro directory, since I thought that might be what was causing them to not execute, but that did not fix it.
The text was updated successfully, but these errors were encountered:
The issue here is that Enhanced Conditions logic is proxied through a GM, so any macros associated to a Condition will be executed by/as the GM. However in most cases this should still result in the desired outcome (eg. the TokenMagicFX being applied/removed). There is possibly some other bug causing the context (actor/token) to not be passed correctly.
There's a related "bug" here where, since macros that are triggered by conditions being added/removed are run as GM, that means that any reference to, say, canvas.tokens.controlled specifically refers to whichever tokens are being controlled by the GM. If a player adds or removes a condition from a token, and that triggers a macro to be run, if the GM is selecting a different token than the player, the macro will be run as if the GM's selected token is the triggering token rather than the player's. Or if the GM is selecting no token, then canvas.tokens.controlled is empty even when the player triggering the change is selecting one.
Fortunately it looks like Enhanced Conditions passes the actual token/actor being affected as a parameter, an object that either looks like { token: <affected TokenDocument> } or { actor: <affected Actor> }. In CUB 1.9.2 and earlier, this argument can be accessed in the macro with arguments[0].args[1], or in CUB 1.10 and later it can be accessed with arguments[0].args[0]. At least, that's how I was able to get it to work.
Describe the bug
Players are unable to execute script macro via applying a condition with Enhanced Conditions despite having the proper permissions to execute script macros in the world. The macro execution works fine for the GM.
To Reproduce
Steps to reproduce the behavior:
console.log (actor, token)
macro, and set it in the Condition Lab to be executed alongside a certain condition.Expected behavior
Players should be able to execute script macros via applying conditions when those conditions are set up to do so in the Condition Lab.
Screenshots
n/a (though I can get some if that would help? just tell me what of!)
Environment Info (please complete the following information):
Additional context
Specifically, the macros I am trying to get to work are macros that apply/remove TokenMagicFX visual effects. I also tried giving all players ownership permission of the applicable macros within the macro directory, since I thought that might be what was causing them to not execute, but that did not fix it.
The text was updated successfully, but these errors were encountered: