PDA

View Full Version : Is there a way to prevent client from moving PC/NPC token?



SilentRuin
March 25th, 2022, 18:20
Ideally I'd like to use tokeninstance.setModifiable(false) to prevent the client PC/NPC tokens (CT linked entries) from being moved. And to use tokeninstance.setModifiable(true) to toggle them back to moveable again.

But this does not seem to work for these types of map tokens (does for non CT linked ones). Is there something I'm missing here? Is there another way to do this for PC/NPC (CT linked map tokens) that would do the same thing?

Moon Wizard
March 25th, 2022, 18:28
That's part of what the TokenManager script does is set all the token attributes on updates to the CT data. You'd probably have to start overriding a bunch of scripts to get the behavior you describe so that the setModifiable function isn't called by the default token updates.

Regards,
JPG

SilentRuin
March 25th, 2022, 20:20
That's part of what the TokenManager script does is set all the token attributes on updates to the CT data. You'd probably have to start overriding a bunch of scripts to get the behavior you describe so that the setModifiable function isn't called by the default token updates.

Regards,
JPG

Its only ever called in delete but I assume some other attribute disables it. I'll have a look around.

LordEntrails
March 25th, 2022, 22:32
Some of it is going to be tied to Party Vision and Movement option right? Maybe that's worth looking into.

SilentRuin
March 25th, 2022, 22:46
Some of it is going to be tied to Party Vision and Movement option right? Maybe that's worth looking into.

Well this is an owned client PC/NPC that needs to be frozen in movement - they can still target and do everything else. So I'm trying to find out how to disable only movement without having to basically reset to the original position everytime their position updates (not looked into that yet either as I'm hoping there is a "magic undocumented LUA call" I'm missing to disable it). Though if I don't find a way to freeze a live owned PC/NPC token on the client for movement I may have to take draconian workarounds - which I prefer to avoid if at all possible.

Moon Wizard
March 25th, 2022, 23:50
You can't selectively change the edit properties. Either the player can fully edit (move/target) or they cannot.

Regards,
JPG

LordEntrails
March 26th, 2022, 00:05
Ah. And I assume the approve movement isn't going to do what you want either :(

Moon is way more qualified to answer than me anyway, so don't let me confuse the issue.