Log in

View Full Version : setValue Unable to create node



bmos
June 30th, 2020, 02:08
I tried to use my extensions in my game yesterday, but couldn't because of a ton of console errors that showed up for my players but not for me.
I didn't (and don't) get any of these issues in my test environment (including opening another instance of FGC and connecting back to my host session).
The same seems to be the case for one other person who has tested it (huge amount of errors when player client connects).

37280

The file is here (https://github.com/bmos/FG-PFRPG-Live-HP-from-CON/blob/master/scripts/hp_from_con.lua).

superteddy57
June 30th, 2020, 03:40
Only the host can manipulate the database. If the extension has the players making changes to the database, then you will have to use OOB messaging to make it work. It funnels the command through the host to make the changes. A great example would be the ActionInit global script in 5E. This allows the player to roll initiative and set values within the database.

Trenloe
June 30th, 2020, 10:21
The issue, as superteddy57 days, is that the code on clients is trying to change nodes the client doesn’t own - in this case, hp fields in a character sheet when HP in that char sheet changes.

This wouldn’t have raised error with one player testing, as they would have owned the PCs being used.

The database handlers in the onInit function are being setup for all clients and the GM. As these use wildcard filters (which is fine) you’ll only need to run these events once. Change all of the database handlers in the onInit function to only be called if it’s the GM instance. Use if User.isHost() for this.

bmos
June 30th, 2020, 11:39
The issue, as superteddy57 days, is that the code on clients is trying to change nodes the client doesn’t own - in this case, hp fields in a character sheet when HP in that char sheet changes.

This wouldn’t have raised error with one player testing, as they would have owned the PCs being used.

The database handlers in the onInit function are being setup for all clients and the GM. As these use wildcard filters (which is fine) you’ll only need to run these events once. Change all of the database handlers in the onInit function to only be called if it’s the GM instance. Use if User.isHost() for this.Phew, that's much easier! Thanks to you both :)
I haven't had to learn OOBHandler handlers yet but I'm sure that will come soon :D