PDA

View Full Version : Using a value to set # of checkboxes



Waldo Pepper
January 7th, 2009, 20:19
I have a very simple question: How do I pass the value of a number field (specifically a jpgnumberfield) to a checkcounter control to set the total number of check boxes to display? Both controls are located in the same frame. I know there has to be some simple way but I can't figure out how to. :confused: All I ever get are script errors telling me I'm referencing a nil value or that I'm trying to pass usrdata to the function which wants a number. :(

Moon Wizard
January 9th, 2009, 03:00
If you have access to it, I would open up the 3.5 extension for the foundation ruleset that ships with the current version, or the d20 ruleset that shipped with previous versions. To open the extension, the extension file is just a zip file containing the source files for 3.5 ruleset.

Inside the charsheet_combat.xml file, there is an ammocounter control with the associated charsheet_ammocounter.lua script file. It does exactly what you are asking for. The number field sets the maximum value (up to 20), and the counter generates the check boxes and keeps track of the number checked off.

Cheers,
JPG

Waldo Pepper
January 9th, 2009, 22:51
Thanks for the tip!