League-of-Foundry-Developers / fvtt-module-trigger-happy

Trigger Happy! FVTT Triggering system
Creative Commons Attribution 4.0 International
28 stars 12 forks source link

Triggers Stopped #80

Closed cptnbananajam closed 2 years ago

cptnbananajam commented 2 years ago

Module Version: v0.0.0

Describe the bug Triggers have completely stopped functioning. The doors function with open locks and find traps works. Trap tokens and capture move tokens have stopped functioning. Passing over the token does nothing.

To Reproduce The text in the journal entry uses @Actor. All of the triggers are the same as I had them before and they all worked properly before. I didn't change anything, other than updating.

Expected behavior Traps triggering

p4535992 commented 2 years ago

Any exception on the web console? Disable the setting 'Disable warning messages' and tell me if you got any warning.

darkwon commented 2 years ago

I can confirm this bug as well and tested on dev machine with no other modules running except trigger-happy. I have also tried I have a few Triggers formatted like this;

@Drawing[L1Clean]@Trigger[capture move]@Macro[fzBrtI5XwrqsSpPG]{Pause-Game}@selfWhisper[say something cool] @Token[NetTrap]@Trigger[capture move@Macro[fzBrtI5XwrqsSpPG]{Pause-Game}]

I noticed that adding @selfWhisper to; @Door[*]@Trigger[doorOpen]@Macro[VZJifeoslPJInSxC]{Door-Open}@selfWhisper[The door is open]

That the console drops the following message; trigger.js:661 Uncaught (in promise) ReferenceError: chatData is not defined at TriggerHappy._executeTriggers (trigger.js:661)

Now on v.8.19 and 8.22 the following does work; @Token[NetTrap]@Trigger[capture move@Macro[fzBrtI5XwrqsSpPG]{Pause-Game}]

There are no errors in the console with or without the setting 'Disable warning messages'

Hope that helps a bit

p4535992 commented 2 years ago

nothing i can't replicate for now i downgrade to the 0.8.22

p4535992 commented 2 years ago

@cptnbananajam @darkwon can you try this beta and tell me if the problem persists?

https://github.com/p4535992/fvtt-module-trigger-happy/releases/download/v0.8.27/module.json

darkwon commented 2 years ago

Yes, this still appears to be an issue. Below are the commands I am using along with a short video;

@Door[*]@Trigger[doorOpen]@Macro[VZJifeoslPJInSxC]{Door-Open}@selfWhisper[The door is open] @Drawing[L1Clean]@Trigger[capture move]@Macro[ia3dghQmMy5ccT9t]{Pause-Game}@selfWhisper[Drawing Trigger] @Token[Devil] @Trigger[capture move] @ChatMessage[You are hit]

http://zandoralegends.com/public_share/2021-12-29_001.webm

darkwon commented 2 years ago

ok, so @p4535992 I changed the following command;

FROM: @drawing[L1Clean]@trigger[capture move]@macro[ia3dghQmMy5ccT9t]{Pause-Game}@selfwhisper[Drawing Trigger] TO: @Drawing[*]{L1Clean}@Trigger[capture move]@Macro[ia3dghQmMy5ccT9t]{Pause-Game}@selfWhisper[Drawing Trigger]

then I added some console.outputs here;

  _isDrawingTrigger(drawing, trigger, type) {
    const isTrigger =
      (trigger.trigger instanceof Drawing && trigger.trigger.id === drawing.id) ||
      (trigger.trigger instanceof DrawingDocument && trigger.trigger.id === drawing.id);
    if (!isTrigger) {
      console.log('isTrigger=False')
      return false;
    }
    if (type === EVENT_TRIGGER_ENTITY_TYPES.CLICK) {
      return (
        trigger.options.includes(EVENT_TRIGGER_ENTITY_TYPES.CLICK) ||
        (!trigger.options.includes(EVENT_TRIGGER_ENTITY_TYPES.MOVE) && !drawing.data.hidden)
      );
    }
    if (type === EVENT_TRIGGER_ENTITY_TYPES.MOVE) {
      console.log('Trigger: move found');
      return (
        trigger.options.includes(EVENT_TRIGGER_ENTITY_TYPES.MOVE) ||
        (!trigger.options.includes(EVENT_TRIGGER_ENTITY_TYPES.CLICK) && drawing.data.hidden)
      );
    }
    if (type === EVENT_TRIGGER_ENTITY_TYPES.CAPTURE) {
      console.log('Trigger: capture found');
      return trigger.options.includes(EVENT_TRIGGER_ENTITY_TYPES.CAPTURE);
    }
    return true;
  }

and here is a short video of what happens along with console output. It appears that drawings are not recognized on the initial move from a token into the drawing.

http://zandoralegends.com/public_share/2021-12-29_002.webm

cptnbananajam commented 2 years ago

https://github.com/p4535992/fvtt-module-trigger-happy/releases/download/v0.8.27/module.json

This fixed the issue. it looks like it went back to 8.26 instead of 8.27. But it works now, thanks.

p4535992 commented 2 years ago

@cptnbananajam ty for the feedback, now i waiting for the confirmation of @darkwon on this version for his issue and we can go on.

https://github.com/p4535992/fvtt-module-trigger-happy/releases/download/v0.8.28/module.json

darkwon commented 2 years ago

@p4535992 I just tested v.0.8.28 and it fixes the drawing issues. The trigger now happens

p4535992 commented 2 years ago

new official version released, fingers crossed.

p4535992 commented 2 years ago

seem to be all right i'll close the ticket.