Borders: Make clients check combat updates

In the Fabula Ultima system, the clients cannot
use the combat hooks, only the GM.
So the GM orchestrates the token visiblity changes
for all clients.

Currently, the GM checks the status of tokens when
they run the combat hook.
However, this doesn't work when the GM is on another
scene, as the tokens *do not exist* for their client
in this case, as only those in the current scene do.

To fix this, we need to do the token status check
on all clients, and verify that we are on the proper
scene : otherwise there won't be a token to update.

Change the method called on the clients by the GM
to be a wrapper around token_set_border_visibility()
which checks the scene and the token locally.

Introduce another method to manually set the border
status on clients via SocketLib, used for the end of
combat.

Remove the mentions of this issue in the README and
comments as this commit fixes it.
This commit is contained in:
trotFunky 2025-06-01 22:17:36 +01:00
parent 7cd85468c7
commit 73d2a08b88
2 changed files with 60 additions and 23 deletions

View file

@ -38,14 +38,8 @@ The module supports going back and forth in the combat rounds, as well as going
### Limitations
There are currently two main issues that need to be fixed :
1. The tokens will not be updated when the GM is not on the scene.
- Indeed, the Fabula Ultima system seems to prevent players from receiving combat events,
so the GM is the only one that can receive them and update the tokens. That means they need to be in the active
combat scene for the changes to take effect.
- However, given that the module only uses the current state, if the GM comes back to the scene and a combat event is
triggered, the token borders will become correct.
2. The token borders will be incorrect when switching to a new scene
There are currently one main issue that need to be fixed :
1. The token borders will be incorrect when switching to a new scene
- It is unclear why, but apparently switching to another scene is very different from loading a new scene,
and the combat encounter of the scene is not available when tokens are created. This means that the combat status,
and thus the border type, cannot be properly determined on scene switch.