maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Bug]: Events are not called when Lib-tokens is on the hidden-layer

Open Lector opened this issue 1 year ago • 0 comments

Describe the Bug

When a Lib-token is on the hidden-layer some events are not called until you edit and save one macro on this Lib-token. Please follow the steps below to reconstruct this behavior. The events onTokenMove and onInitiativeChange are NOT called on a hidden Lib-token. onCampaignLoad is called on a hidden Lib-token. This bug occurs until someone edits one of the macros on the corresponding Lib-token. When doing so it calles the events for every player, that was connected to the server at the time one of the macros was saved. Players connecting later will not get their eventy called until someone resaves on of the macros again.

To Reproduce

  1. Open Maptool
  2. Drag a token onto the map
  3. Rename it to Lib:macros
  4. Change it to the hidden layer
  5. Add the macro "onTokenMove" to Lib:macros with the following content: [h: broadcast("onTokenMove was called!")]
  6. Change to token layer and add another token to the map. Move it around. It should print a prompt to the chat.
  7. Save the campaign and load it again.
  8. Move the token around. Now the chat remains empty until you open and edit one of the macros on the Lib:macros token.

Expected Behaviour

I would like all event-macros on every lib-token to be called independet of the layer this tokens are on.

Screenshots

No response

MapTool Info

Version: 1.11.5

Desktop

No response

Additional Context

Here is the link to the discord-thread where i had the issue with onTokenMove not being called: https://discord.com/channels/296230822262865920/1015084154301456455

Lector avatar Sep 02 '22 13:09 Lector