preUpdateHook question
Hey all, question for anyone who has a sec. I'm trying to use
preCreateActor
to add rolled values to a new actor, but I don't seem to be able to get the values to apply. Anyone mind having a look? I'll throw my code in a thread so it doesn't clutter up the channel8 Replies
The
console.info
has the following:
The error I'm getting when trying to do the update:
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Nope! It's a system I've been building, https://github.com/wyrmisis/foundry-chromatic-dungeons
GitHub
GitHub - wyrmisis/foundry-chromatic-dungeons: An implementation of ...
An implementation of the OSR TTRPG system, Chromatic Dungeons (https://izegrimcreations.com/gaming-related) - GitHub - wyrmisis/foundry-chromatic-dungeons: An implementation of the OSR TTRPG system...
check the
preCreate
hook example
basically you need to do actor.data.update
A working example: https://github.com/fh-fvtt/zweihander/blob/9a55f94a8682a8443b5d85f175fb66855e5c7b39/module/actor/entity/pc.js#L121
Do not if you have the possibility, update data inside hooks.
It can lead to weird behavior. Do it inside the respective methods instead.
This is what got things working for me, thanks! It's been a minute since I've been able to work in Foundry 😬
@wyrmisis gave LeaguePoints™ to @re4xn (#60 • 33)