View Full Version : Minisheet - Charactersheet simultaneous update
Doskious
October 8th, 2008, 03:45
I've tried everything I can think of, and still this eludes me. I want to add a simple number field to both the charactersheet and the minisheet, to be linked, to keep track of power points used (for Psionics). At each rest, I would have the player update the sheet to reflect the proper rested total, and then either mousewheel decrement or ctrl-modifier on a dragged /die ## command to decrement the field. Obviously, to maintain ease-of-use, I'd like to have it update the minisheet field when the charactersheet field is changed, and vice versa.
I'm running the most recent d20_JPG ruleset, with the collected tabbed minisheet. I've gotten the fields to display in each location, but cannot for the life of me figure out how to link their values the way I want to. I've tried for a week now to reverse-engineer the process for the other fields on the sheets that do this (HP, Ability scores, modifiers, etc.), and I'm sure it's something blindingly simple that I've missed entirely. If anyone could render assistance, I would much appreciate it.
Best regards,
~Doskious Steele
Foen
October 8th, 2008, 06:32
I'm not familiar with the jpg_d20 ruleset, but generally you should use numberfield instead of numbercontrol and make sure they both have the same name/source.
If you posted a snippet of xml code from each place (character sheet and minisheet) that would help.
Cheers
Foen
Moon Wizard
October 8th, 2008, 07:43
I would actually use the wounds and total HP fields as an example of what you want to accomplish. You could have total PP available, and total PP spent. To reset for the day, simply reset the PP used field.
Cheers,
JPG
Doskious
October 8th, 2008, 22:31
I would actually use the wounds and total HP fields as an example of what you want to accomplish. You could have total PP available, and total PP spent. To reset for the day, simply reset the PP used field.
I would do this except for space considerations - on the Minisheet, I have the PP field placed directly next to to Speed display. It looks elegant, and (more importantly) doesn't require me to fiddle with the graphical layout of the minisheet (which is very nice as it is, by the way). I did try to mimic exactly the setup of the wounds field, but it doesn't seem to update.
Minisheet Code:
<hitpointfield name="powerpoints" source="powerpoints">
<anchored>
<to>mini_miscframe</to>
<position>insidetopright</position>
<offset>20,24</offset>
<size>
<width>65</width>
<height>25</height>
</size>
</anchored>
</hitpointfield>
<stringcontrol>
<anchored>
<to>powerpoints</to>
<position>above</position>
<offset>0,2</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>PP</static>
<center />
</stringcontrol>
Charactersheet Code:
<hitpointfield name="powerpoints" source="powerpoints">
<anchored>
<top>
<anchor>top</anchor>
<offset>8</offset>
</top>
<size>
<width>25</width>
<height>22</height>
</size>
<right>
<parent>availablelevel0</parent>
<anchor>left</anchor>
<offset>-8</offset>
<relation>relative</relation>
</right>
</anchored>
<frame>
<name>modifier</name>
<offset>4,1,3,1</offset>
</frame>
<font>sheetnumbersmall</font>
</hitpointfield>
<stringcontrol name="pplabel">
<anchored>
<to>powerpoints</to>
<position>above</position>
<offset>0,-4</offset>
</anchored>
<font>sheetlabelsmall</font>
<center />
<static>PP</static>
</stringcontrol>
The Minisheet field is on the first page displayed, the Charactersheet field is on the spells tab.
"hitpointfield" is a template that is defined as follows:
<template name="hitpointfield">
<jpgnumberfield>
<noreset />
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumber</font>
<stateframe>
<drophilight>
<name>sheetfocusplus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<droptypes>
<type>number</type>
</droptypes>
<script>
function onDrop(x, y, draginfo)
if draginfo.isType("number") then
setValue(getValue() + draginfo.getNumberData());
return true;
end
end
</script>
</jpgnumberfield>
</template>
<template name="jpgnumberfield">
<numberfield>
<script>
function onWheel(n)
if not ChatManager.isMouseWheelEditEnabled() then
return false;
end
end
</script>
</numberfield>
</template>
with additional template definition appended.
I remain mistified.
~Doskious Steele
Foen
October 8th, 2008, 22:39
I'll leave this to JPG as the expert, although on first blush this looks like it should work (not much use there, then).
On the spells tab, might the field be somehow nested inside some other control (like a list) which would break the context of the name?
One thing to try would be to set the minisheet value to 333 and the main sheet value to 666 and then look in your DB.xml campaign file to see where each of those numbers appears.
Sorry I'm not much help
Stuart
Doskious
October 8th, 2008, 22:47
I appended the Charactersheet field to the chain of spell level slots, that's probably what it is.
Curses, does that mean that I have to meddle with the layout?
The charactersheet field is under a windowclass tag bloc:
<windowclass name="charsheet_spelllistset">
but not under any windowlist tags.
Thanks for that thought.
I tried your suggestion, and found the lack of parity. Thanks!
~Doskious Steele
Doskious
October 8th, 2008, 23:14
Huzzah, thanks very much Stuart! All I had to do to tie the two together was change the referent location for the minisheet source to reflect the generated location of the charactersheet's field. (spellset.set1.powerpoints)
Naturally, this is not a perfect solution, inasmuch as it does not take the existence of multiple spellsets into consideration, but since Power Points stack between Psionic class and race sources, I figure it's pretty immaterial for this application, since regardless of which psionic class one would be looking at, the PP counter would be the same.
Thanks again!
~Doskious Steele
Foen
October 9th, 2008, 05:57
No problem, glad we could be of help ;)
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.