PDA

View Full Version : Unlocked Number Fields in NPCs..



Blackfoot
July 3rd, 2015, 14:16
This isn't exactly a 'bug' but I'm not sure whether or not it works quite right... or as intended... so I'm posting it here as I'm not really sure where else to put it.

For some reason Number Fields in NPCs do not 'lock' when the NPC is locked. I'm not sure why this would be a feature.. it seems like it is pretty easy to mess up your NPC data with it set up this way. I know it works this way in the current REV of PF.. I'm just sorta wondering if there is a good reason for it. I'm currently looking to change this in my own ruleset and wondering about it.

Andraax
July 3rd, 2015, 14:58
Which ruleset? Because you can't change them in locked NPCs on any of the rulesets I commonly use...

Trenloe
July 3rd, 2015, 15:11
I hadn't noticed this before. To re-create:

Load up a Pathfinder (PFRPG) campaign.
Open the bestiary module and drag an NPC from the library to the campaign NPC lists.
Open the NPC in the campaign list and click on the "CR" field - you can change the value by typing in a new number or using CTRL+mousewheel - even though the record is showing locked.

Blackfoot
July 3rd, 2015, 16:07
I hadn't noticed this before. To re-create:

Load up a Pathfinder (PFRPG) campaign.
Open the bestiary module and drag an NPC from the library to the campaign NPC lists.
Open the NPC in the campaign list and click on the "CR" field - you can change the value by typing in a new number or using CTRL+mousewheel - even though the record is showing locked.

Exactly. Sorry for not including more details. I haven't tested this in other Rulesets but since my NPCs (for my Champions Ruleset) are based largely on the 3.5 NPCs I suspect it works that way in both 3.5 and PF at least.

Blackfoot
July 16th, 2015, 02:14
I tried getting around this by creating a new lockable template... but apparently I 'f'd' it up. It doesn't change state when the lock is clicked... it just stays whatever state the thing was when the NPC was started up. Does it... hmm.. it doesn't do this with number fields in inventory items... I wonder what template they use.
Hrm.. they use number_columnh... rather than basicnumber... a much more complicated template in terms of placement and stuff. Hrm.

Blackfoot
July 21st, 2015, 18:31
I tried switching to number_columnh and it still doesn't lock them. I'm not sure what's up here. Is this functionality is as intended?

Moon Wizard
July 21st, 2015, 20:21
The templates don't auto-lock, since that would require every single control to register a callback when the "locked" field changes.

All of the rulesets I've built register a callback when the "locked" field changes at the windowclass level, then the callback function specifically locks/unlocks the relevant fields as well as showing/hiding additional controls used for layout.

Regards,
JPG

Blackfoot
July 21st, 2015, 21:44
So the unlocked functionality in the 3.5/PFRPG ruleset for NPCs is 'as intended'? I don't know about other rulesets, I based my code (in my Champions Ruleset) off the 3.5 functionality.. so it works/doesn't work the same as that ruleset.

Moon Wizard
July 22nd, 2015, 00:37
No. I'm just saying that the templates used don't lock/unlock themselves based on the lock field changing. You have to register callback in main window, then call template functions to lock/unlock each control.

Check out the npc.lua file in 3.5E ruleset. Or look for any onLockChanged functions scattered throughout.

Regards,
JPG

Blackfoot
July 22nd, 2015, 09:08
OK. So what I ended up doing was creating a new template 'lockable_number' and copied the update scripts from 'number_columnh' to this template but removed the Visibility bits from it. Then I set them to be called in npc_main. This seems to have resolved the issue for my ruleset but it remains an issue in 3.5 and PFRPG.