Closed Kreals closed 2 years ago
Yeah, that's expected behaviour; it's not practical to push database updates to the Darkness value for all scenes on every change, just the scene currently being viewed by the GM.
Fair enough, it doesnt seem there is an easy way to get a reference to each player's/user's currently viewed scenes either, without looping through every scene and token. Oh well. Thanks for the reply.
Oh, i actually did find a way to do this that only targets currently viewed scenes if anyone fancies a go.
Replace the the following code in the `
original
1819 if (game.user.isGM) {
1820 await currentScene.update({ darkness: darknessValue });
1821 } else {
replace with the following
1819 let usersViewingScenes = Array.from(game.users.values()).filter(function (emp) { return emp.viewedScene !== null });
1820 if (game.user.isGM) {
1821 for (let i = 0; i < usersViewingScenes.length; i++) {
1822 await game.scenes.get(usersViewingScenes[i].viewedScene).update({ darkness: darknessValue });
1823 }
1824 //await currentScene.update({ darkness: darknessValue });
1825 } else {
This will likely stress out your network connection a little more sooo, use at your own peril.
Basically if a player moves away from the GM's currently viewed scene then the darkness level for the player's new scene will not change if the GM adjusts one of the time/moon/sun settings.