PDA

View Full Version : Two Columns for NPC sheet



sloejack
December 3rd, 2007, 16:00
I've been messing with my ruleset again recently and one of the things that annoys me about it is the length of the combat tab for NPCs. I've got 18 number fields that I'd like to put into two columns of 9 instead of how it currently appears. I've attached a screen capture of how it currently appears.

Since I'm modifying the adventure_npcs.xml file I'm wondering if I'm just missing some other template reference to be able to use a second column. If anyone has a quick pointer to do what I want here that would be great, though I may just be asking this question to help jump start my brain. If I sort it out before an answer comes I'll update.

Hamish
December 3rd, 2007, 16:09
In charsheet_skills.xml they use a windowlist with charsheet_skilllistitem entries that has 2 columns. I think that's the only place where the columns are actually created by the code.
I don't see why you need it though; just don't change the coordinates of the controls in your NPC window to form 2 columns.

sloejack
December 3rd, 2007, 16:14
In charsheet_skills.xml they use a windowlist with charsheet_skilllistitem entries that has 2 columns. I think that's the only place where the columns are actually created by the code.
I don't see why you need it though; just don't change the coordinates of the controls in your NPC window to form 2 columns.

I had looked at that a little bit and will keep digging into it, so thanks for that. I suspect part of my problem in figuring this out is that I actually want 3 areas, 2 columns in the upper part of the frame and then a wide bit at the bottom part for dealing with the long strings/text globs.

Hamish
December 3rd, 2007, 18:26
Either approach I mentioned will work. I still think the easiest way is to just place some controls in the left column, and some others on the right. The windowlist is useful when you must be able to add entries, like on the skill list or the combat tracker, but for mostly static content like your NPC sheets it looks like complete overkill to me.

So for example, use the following coordinates:
(10,10).....(120,10)
(10,20).....(120,20)
(10,30).....(120,30)
(10,40).....(120,40)

sloejack
December 3rd, 2007, 18:56
Yes, you're right. That certainly works out much easier. I think I was just trying to come up with something I could reuse without too much hard coding. Thanks for the feedback.

sloejack
December 3rd, 2007, 20:55
Hacking from the default d20 I managed to get the main window to behave properly taking some cues from charactersheet_main. However I still can't get the combat tab to act right.

I've plugged in the following code but the formatting still doesn't place things properly.

<genericcontrol name="attcoloneframe">
<anchored>
<to>npc_combat</to>
<position>above</position>
</anchored>
<bounds>0,0,165,210</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>
<columnnumberfield name="body">
<anchored>
<to>attcoloneframe</to>
<position>insidetopleft</position>
<offset>15,10</offset>
</anchored>
<anchorto>attcoloneframe</anchorto>
<tabtarget next="agility" prev="notes" />
</columnnumberfield>
<columnfieldlabel>
<anchor>body</anchor>
<static>Body</static>
</columnfieldlabel>

Any ideas on what I'm missing here and why it's not applying the formatting to the control created for the column?

Hamish
December 4th, 2007, 08:24
<genericcontrol name="attcoloneframe">
<anchored>
<to>npc_combat</to>
<position>above</position>
</anchored>
<bounds>0,0,165,210</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>
<columnnumberfield name="body">
<anchored>
<to>attcoloneframe</to>
<position>insidetopleft</position>
<offset>15,10</offset>
</anchored>
<anchorto>attcoloneframe</anchorto>
<tabtarget next="agility" prev="notes" />
</columnnumberfield>
<columnfieldlabel>
<anchor>body</anchor>
<static>Body</static>
</columnfieldlabel>

Something is wrong with your anchoring. The attcoloneframe control has both <anchored> and <bounds> tags. That's not going to work; either specify an absolute location using <bounds> or give a relative location using <anchored> and <offset>.
The body numberfield has both <anchored><to> and <anchorto> tags. As far as I know, a windowcontrol does not support the <anchorto> tag.

Hope this helps!

sloejack
December 4th, 2007, 12:45
Hmm, for those fields I took the examples from charsheet_main and how it handles subwindows, I'll look at it again and play with it some more, thanks for the pointer

sloejack
December 5th, 2007, 20:44
I ended up making a 6x3 grid for the attributes, followed by the handful of text blob areas for skills, powers, spells, gear, etc. I'll post of a screen later to see what the potential SR GMs think. I'm now trying to go through and parse out the npcskills.lua to get it to behave properly, I think I just need to change the regex it's using to parse the string to find the pool modifier.

sloejack
December 7th, 2007, 03:53
Here's what I came up with for the NPC frame. Tried to follow the format of how the npc attribute details are printed in the various rulebooks/adventures.

Hamish
December 7th, 2007, 07:44
Looks good to me. :)