PDA

View Full Version : Allowing players to edit a GM module sheet



Jacklifear
June 4th, 2015, 02:27
I'm looking for assistance with a theoretical option.

As a GM I'm looking to create a means for players to edit and change statistics on a GM Monster in the Earthdawn ruleset.

Is there a line of code that I'm specifically looking for that restricts non-GM editing? Is there a line of code I'm unaware of that allows players to edit a sheet or module?

Thanks for your help, just a nudge in the right direction would be great. I've searched quite a bit and I'm stuck on this.

Thanks!

Trenloe
June 4th, 2015, 02:55
Not being familiar with that ruleset I'm not too sure about the whys and wherefores of exactly where data is stored and viewed/edited.

The big issue you're going to have is that only one player can "own" data and edit it at a time. So, you're going to have to write some code that temporarily gives ownership of the record you want to allow the specific player to edit - perhaps via an onDrop event on the PC portrait on the desktop. i.e. drag/drop the record you want the player to have access to and edit to the portrait on the desktop of one of the PCs they control. By default, in most rulesets, this will share the record with the player but they won't be able to edit it. This is where you'll have to put some onDrop event code on the portrait to allow the player to take ownership of the record and unlock it. You will probably have to use something like addHolder (https://www.fantasygrounds.com/refdoc/DB.xcp#addHolder) to do this. Even then you may have issues with the GM being the base owner of the record and FG not allowing a player to edit a record that the GM created/is the base owner of, so you may have to do some OOB messaging shenanigans to pass the data to the GM instance of FG to do the update.

Then, there may be some controls in the record that are set as <gmeditonly />, you'll have to change those too - see the "Definition" section here: https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

Doing some quick testing in the 3.5E ruleset. If the GM drags an NPC record to a PC portrait the record is shared with the player and they have read only access. They are added as a holder of the record, but not given ownership. Setting owner = true in the addHolder (https://www.fantasygrounds.com/refdoc/DB.xcp#addHolder) method should give the player ownership and allow them to edit the record. Hopefully, most of this is already there in the Earthdawn ruleset, otherwise you'll have to code all of this up.

Trenloe
June 4th, 2015, 02:56
Note: once you share an entry with a PC and allow them to edit it you may find it hard to relinquish that control. You'll probably have to program something like a right-mouse-click menu to remove ownership.