Actor attributes update on player's side
I can't fathom how to make changes to actor attributes on player's side. According to documentation I can use actor.modifyTokenAttribute("attribute.path", new_value), but this won't work on player's side, because player does not have permissions for "ActorDelta update".
Can I even do this? I really want to because in my system there are body parts on tokens so automatically updating them after attack would be pretty neat.
3 Replies
I can think of storing data of players attack and results on their's actor and then somehow reading it on DM side and updating proper actor's data. But that's super hacky and shouldn't be like that
I ended up modifuing foundry's "source code", changed function "canUserModify" to return true. Foundry for sure needs this functionality as optional stuff since you already can achieve update on player's side by creating queue on each actor and storing update's there and then resolve them on server side. But that's just contraption for the sake of nothing. Foundry already can handle this updates without this crap.
TL;DR is that it's impossible unless the players own the actor in question. Foundry is very strict about players not being able to affect non-owned tokens/actors/items in any way.
Relevant issue: https://github.com/foundryvtt/foundryvtt/issues/4808
GitHub
Allow granular permissions for documents · Issue #4808 · foundryvtt...
Originally in GitLab by @VanceCole Feature Summary It would be useful if you could, as GM via api, assign read/write permissions to documents that users do not actually own, without actually changi...