PDA

View Full Version : Field Locking



drahkar
March 28th, 2010, 16:24
One of the features I'm hoping to incorporate into my character sheets is a experience tracking system that's tied to a 'Field Lock' on the character sheet. The idea is to give the GM the ability to 'Approve' characters and then lock their fields until they go to purchase upgrades for their characters with points. (This is all supported on the backend with how leveling is handled in the system).

What I'm checking on is if anyone has any suggestions on a effective solution for putting fields into a read-only state based on another variable. For example having a variable 'isReadOnly' and them build a function that gives a specific response based on if that variable is set and in turn makes the field read only or not accordingly.

Can anything think of a simpler way of implementing this?

Moon Wizard
March 28th, 2010, 18:52
I would add a locking checkbox on the character sheet that is only visible to the host, but is still on the client sheet (just invisible).

Then you have 2 options:
* When the value of that field changes, then iterate through all the fields you want to lock/unlock. This may be complicated by the fact that you want to lock fields across multiple tabs.
* Modify each field to listen to the field lock database node, then set the readonly value for the field when the field lock node changes. This approach would work well across multiple tabs, but requires a lot more individual field editing. You can probably speed the changes up some by using templates.

The first approach is basically how the Creature/Trap/Vehicle sheet works in the 4E ruleset. All the fields are on the sheet, but only the fields for the appropriate type are shown.

Cheers,
JPG

drahkar
March 28th, 2010, 20:08
The second option was the one I came up with as well. Was curious to see if anyone had other suggestions, and the first option is definitely one to keep in mind. It would certainly require less field template customization.

Thanks for the suggestions!

Foen
March 28th, 2010, 22:31
A long while back I implemented an extension that provided a total-character-sheet lock (except for the Notes tab). This allowed the GM to lock or unlock the character sheet, by adding/revoking ownership rights. A more fine-grained version would be possible but hard work, as each field would need to be treated separately, rather than the top level charsheet node.

Foen

Moon Wizard
March 29th, 2010, 21:06
That's a good idea, and probably easier to program.

The ownership of a character node is set automatically on login, but you could change that on the host. Just make sure not to remove the user as a holder of the character node, or they lose all access to the character sheet. Also, you may need to store a variable to remember which user owned the node, since the character sheet nodes may have multiple holder tags.

Cheers,
JPG

Foen
March 29th, 2010, 21:18
The code was written about 12 months ago, and probably isn't my finest ;)

I've attached the extension, zipped, but please note it is built to work with the FGBase ruleset and uses GM preferences. The same techniques could be used at the individual charsheet level using right-click radial menus, and hence needn't rely on FGBase preferences.

It does save a copy of the original owner in a separate charsheet node...

Foen

MaJo
February 23rd, 2011, 06:58
(Sorry for my english, i'm french).

I found your lock/unlock system very interresting, and i wonder if it is possible to use that on a DD4E sheet (for preventing cheatings).

Could it be implemented ?

Zeus
February 23rd, 2011, 07:57
You could also take a look at the 4E Personalities extension. It introduces two additional controls which allows the GM to lock/unlock or hide/reveal empty fields.

MaJo
February 24th, 2011, 11:28
Yep, but not just for NPC, looking for PC too.

Extension correctly intalled.

Can you tell me where or show me please the tips ? :)