Closed InnilToo closed 1 year ago
What's the purpose of the .effect()
in the macro?
Besides, you're not utilizing .waitUntilFinished()
on the .animation()
- does that alleviate the problem?
Without the .effect()
the console started screaming:
I did initially use
.waitUntilFinished()
but it seemed to have not made any difference being or not being there.
That's because you are using .atLocation()
on the (now nonexistent) effect. I highly recommend reading documentation on Sequencer basics in the wiki. I will take a look and see if there's something I can do to mitigate the bug.
Frankly, I have very little idea what I am doing. I tried to reduce the script as much as possible to figure out where the problem could be and to provide as much detail as I can. I managed to make it even shorter now.
const use = await item.use();
if (!use) return;
await new Sequence()
.animation()
.on(token)
.opacity(0.0)
.play({ remote: false });
await token.document.update(
{ x: 2500, y: 2500 },
{ animate: false }
);
await new Sequence()
.wait(1500)
.animation()
.on(token)
.opacity(1.0)
.play({ remote: false });
If I remove the .wait(1500)
then it doesn't even have a chance to hide.
This worked on the previous versions, that's why I am reporting it as an issue. If it's a user please let me know.
It appears that even core Foundry has this issue:
await token.document.update(
{ alpha: 0.0 }
);
await new Promise(resolve => setTimeout(resolve, 1000));
await token.document.update(
{ x: token.document.x + 100 }
);
await new Promise(resolve => setTimeout(resolve, 1000));
await token.document.update(
{ alpha: 1.0 }
);
I ran a script that sets the alpha of a token to 0, waits 1 second, moves the token, then sets it back to 1 alpha, and I ran this with no modules installed and this does the same thing. That means that something is fundamentally broken in Foundry itself.
Thank you. Do you wish to report this or should I make an issue?
This has been addressed in v11 - Build 300. Issue https://github.com/foundryvtt/foundryvtt/issues/9510. Thank you for being so helpful!
Describe the bug
.opacity()
breaks until the scene is re-rendered (I think). Basically, if I have a macro that contains a sequence with.opacity()
, a token update, and then another sequence with.opacity
only the first.opacity()
happens. Example macro below. This is similar to #167.To Reproduce Steps to reproduce the behavior:
.opacity()
.opacity()
.opacity()
.Expected behavior The opacity of the token changes with each sequence.
Setup:
Active modules:
Additional context Tried on a completely fresh world with the modules' default settings (except Item Macro hook).