#About Time - Do In

1 messages ยท Page 1 of 1 (latest)

fierce tree
#

@near ivy

#

ok, let's see the current script

odd minnow
#
let t = await warpgate.spawn("Airship")
Gametime.doIn(5, t=>{
  console.log(t)
  canvas.scene.deleteEmbeddedDocuments("Token", t)
});
near ivy
#

GameTime, not Gametime Oh this is a module? Well then. vanishes

odd minnow
#

no....

fierce tree
#

again, do not provide a function argument for the doIn callback

#

you want to implicitly capture the outer t to use inside the callback

#
let t = await warpgate.spawn("Airship")
Gametime.doIn(5, ()=> canvas.scene.deleteEmbeddedDocuments("Token", t));
#

but check your units

#

cause 5 might mean 5 ms or seconds or minutes

odd minnow
#

that does it. game time is seconds. the game calendar does not even have ms in the timestamp

#

that worked

#

@fading stag

#

just change the time to the spell duration in seconds

fading stag
#

Wow! You guys, totally above and beyond here. Thank you so much ๐Ÿ™‚

#

Potential silly question but does the "Token" need to stay as "Token" or do I change that to the name of the token? e.g. "Hunger of Hadar"?

fierce tree
#

nah, it can be whatever

#

the "Token" string is just telling foundry which document type to delete

fading stag
#

Hello,

Just maybe possibly one more thing.
Sometimes when I log out and then log back in the passive effects in the token that I am summoning to the canvas disappear and I have tried to replicate it and it isn't consistent, however I will keep my eye on that.

Another thing is that when the spell is cast, this appears in the console relating to DND5 Helpers it doesn't seem to have any bearing on what is happening, because I have tested it with the macro above and it works perfectly, even disappears after 60 seconds.

I can't get over how brilliant this is.
@fierce tree @odd minnow

You have both been more than helpful, so I don't blame you if you want to have a break from me ๐Ÿคฃ

fierce tree
#

Yea, not entirely sure why helpers is freaking out about that

#

But reloading foundry will wipe any hooks active

fading stag
# fierce tree But reloading foundry will wipe any hooks active

Just to clarify, the passive effects in an actor will be wiped when Foundry is reloaded? I would need to add the effects of the spell to the Hunger of Hadar actor at the start of each session? And every other one I want to create similar to this, like Fog Cloud, Darkness, Cloudkill.........

Would it stay around if I created a feature in the actor that gave it the passive effects of the spell?

fierce tree
#

Mm, not sure about that

#

Sounds like the effect didn't actually get created in the database

#

And a reload will re sync the data

#

Which is usually due to race conditions

#

Or maybe the effect expired on reload

fading stag
#

So for example an elf has resistance to being charmed, that is a passive effect, that stays there all the time because it is a feature.

So if I made the spell a feature in the actor that gives it that passive effect, it should stay there right?

fierce tree
#

it should, yes

fading stag