PDA

View Full Version : Only three classes for a character?



spliskamatyshak
May 25th, 2007, 21:33
I really need to be able to have nine classes for a character. I believe I've gotten everything set up to handle nine classes, but there just isn't room to display them on the main sheet. How do I get just the class list (not including the Character Level [already solved that issue]) to be a scrolling list within the classframe and limiting it to displaying three at a time.

I'm thinking it would be alot like the inventory list, except I have a set limit of specific items.

Can anybody point me in the right direction? I can't figure out how to do this given the current documentation.

SephDragoon
May 26th, 2007, 03:49
I would love to help you with this, I really would, because I need about 5 for mine. If you can get it solved though, could you throw over the scripts for it?

TarynWinterblade
May 26th, 2007, 06:54
There's one main problem with switching the class list over to being a list instead of how it's setup right now, and that's the current skills page (and it's a pain and a half trying to modify it to work with a list - recoding it took about two hours of planning and another few to code). The problem lies in how the skills page stores class skills and whatnot - it expects (more like enforces) only having 3 classes to deal with, and it won't deal with more without a good deal of re-coding.

Edit: The reason why I'm not sharing the scripts is mostly because in the process of recoding I switched things over to a system that made more sense for my ruleset, and changes the functionality of more of the code than just enabling a larger class pool.

Foen
May 26th, 2007, 07:50
The classes can be changed to a list by creating a new windowclass and then changing the individual items to a windowlist.

The windowclass needs to be visible from charsheet_main (you can put it at the top, next to the one for languages):



<windowclass name="charsheet_classlistitem">
<sizelimits>
<minimum>
<height>23</height>
</minimum>
<maximum>
<height>23</height>
</maximum>
</sizelimits>
<sheetdata>
<stringfield name="name">
<bounds>5,5,-53,20</bounds>
<font>sheettext</font>
<frame>
<name>textline</name>
</frame>
<tabtarget>
<next>level</next>
</tabtarget>
</stringfield>
<numberfield name="level">
<bounds>-46,3,32,20</bounds>
<font>sheetnumber</font>
<frame>
<name>modifier</name>
<offset>5,4,5,4</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,4,5,4</offset>
</keyeditframe>
<noreset />
<script>
function onValueChanged()
window.windowlist.window.characterlevel.updateValu e();
end
</script>
<tabtarget>
<prev>name</prev>
</tabtarget>
</numberfield>
</sheetdata>
</windowclass>


The classes section of charsheet_main then becomes:



<!-- CLASSES -->
<genericcontrol name="classframe">
<bounds>255,90,145,200</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>

<stringcontrol name="classlabel">
<anchored>
<to>classframe</to>
<position>insidetopleft</position>
<offset>15,10</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Class</static>
</stringcontrol>
<stringcontrol name="levellabel">
<anchored>
<to>classframe</to>
<position>insidetopright</position>
<offset>20,10</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Level</static>
</stringcontrol>

<windowlist name="classlist">
<datasource>.classes</datasource>
<anchored>
<to>classframe</to>
<position>insidetopleft</position>
<offset>10,19</offset>
<size>
<width>135</width>
<height>69</height>
</size>
</anchored>
<class>charsheet_classlistitem</class>
<sortfields>name</sortfields>
<script>
function onSortCompare(w1, w2)
if w1.name.getValue()=="" then
return true;
end
if w2.name.getValue()=="" then
return false;
end
return w1.name.getValue() &gt; w2.name.getValue();
end

function getWindow(slot)
for k, v in ipairs(window.classlist.getWindows()) do
if v.getDatabaseNode().getName()==slot then
return v;
end
end
return createWindow("." .. slot);
end

function onInit()
local newwin;
--[[ ensure that three slots are shown ]]
newwin = getWindow("slot1");
newwin = getWindow("slot2");
newwin = getWindow("slot3");
end

function onListRearranged(changed)
if changed and window.characterlevel then
window.characterlevel.updateValue();
end
end
</script>
</windowlist>

<stringcontrol>
<anchored>
<left>
<parent>classframe</parent>
<anchor>left</anchor>
<offset>15</offset>
</left>
<right>
<parent>classframe</parent>
<anchor>right</anchor>
<offset>-50</offset>
</right>
<top>
<parent>classlist</parent>
<anchor>bottom</anchor>
<offset>7</offset>
</top>
</anchored>
<font>sheetlabelsmall</font>
<static>Character level</static>
</stringcontrol>
<numberfield name="characterlevel">
<anchored>
<top>
<parent>classlist</parent>
<anchor>bottom</anchor>
<offset>3</offset>
</top>
<left>
<parent>classframe</parent>
<anchor>right</anchor>
<offset>-46</offset>
</left>
<size>
<width>32</width>
<height>20</height>
</size>
</anchored>
<font>sheetnumber</font>
<readonly />
<frame>
<name>bonus</name>
<offset>5,4,5,4</offset>
</frame>
<script>
function updateValue()
local tot = 0;
for k, v in ipairs(window.classlist.getWindows()) do
tot = tot + v.level.getValue();
end
setValue(tot);
end

function onInit()
updateValue();
end
</script>
<readonly />
</numberfield>

<numberfield name="exp">
<anchored>
<to>classframe</to>
<position>insidetop</position>
<offset>-15,128</offset>
<size>
<height>20</height>
</size>
</anchored>
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumbersmall</font>
<noreset />
<stateframe>
<drophilight>
<name>sheetfocusplus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<droptypes>
<type>number</type>
</droptypes>
<tabtarget>
<next>expneeded</next>
<prev>level3</prev>
</tabtarget>
<script>
function onDrop(x, y, draginfo)
if draginfo.isType("number") then
setValue(getValue() + draginfo.getNumberData());
return true;
end
end
</script>
</numberfield>
<numberfield name="expneeded">
<anchored>
<to>exp</to>
<position>below</position>
<offset>0,17</offset>
<size>
<height>20</height>
</size>
</anchored>
<frame>
<name>modifier</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumbersmall</font>
<noreset />
<stateframe>
<drophilight>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<droptypes>
<type>number</type>
</droptypes>
<tabtarget>
<next>hp</next>
<prev>exp</prev>
</tabtarget>
<script>
function onHover(oncontrol)
if oncontrol then
local draginfo = Input.getDragData();
if draginfo and draginfo.isType("number") and draginfo.getNumberData() &lt; getValue() then
setColor("ffbb0000");
end
else
setColor(nil);
end
end

function onDrop(x, y, draginfo)
if draginfo.isType("number") and draginfo.getNumberData() &gt; getValue() then
setValue(draginfo.getNumberData());
end

return true;
end
</script>
</numberfield>

<stringcontrol>
<anchored>
<to>exp</to>
<position>aboveleft</position>
<offset>0,1</offset>
</anchored>
<static>Experience</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<stringcontrol>
<anchored>
<to>expneeded</to>
<position>aboveleft</position>
<offset>0,1</offset>
</anchored>
<static>Needed for next</static>
<font>sheetlabelsmall</font>
</stringcontrol>


Make sure you update all of this, as the character level, experience controls, etc refer to some of the deleted class controls.

This should work with the skill system so long as you only have 3 slots (it uses the same database nodes), if you go above 3 slots you'll need to rework the skills system (TarynWinterblade makes a very good point).

Scrolling the list is done using the mouse wheel.

Cheers

Stuart
(Foen)

Toadwart
May 26th, 2007, 10:55
9 classes eh.. come on, admit it your real name is 'fumbles' isnt it?

(obscure reference coutesy of www.goblinscomic.com (https://www.goblinscomic.com) ;))

Sigurd
May 26th, 2007, 21:37
Nine classes is a lot more reasonable than 3. I hope the Dev's notice this.

spliskamatyshak
May 29th, 2007, 14:51
9 classes eh.. come on, admit it your real name is 'fumbles' isnt it?

(obscure reference coutesy of www.goblinscomic.com (https://www.goblinscomic.com) ;))
I suppose you might be able to call the referred to ECL 49 character "fumbles, " behind his back (from another plane). :D

I'm not all that worried about the skills page. I've already modified the section of the bottom that keeps track of the class skills per class. I can unlock skills and get around other limitations if necessary, but I'd like to get the whole thing working appropriately. I was hoping there was a way to windowlist this thing and still use the data structure style already used.

I did mention this limitation before and that it would be better to have more classes in a scrolling list like I'm trying to do. (Version 2.0 update: Pixies...er, pixels; Post #44; 10/31/2006)

But three classes is definitely too few. Simple (fairly reasonable) examples. half-elf wizard/half-elf paragon/elf-paragon/archmage; elf wizard/elf paragon/fighter/bladesinger

Doswelk
May 31st, 2007, 08:56
I'm not all that worried about the skills page. I've already modified the section of the bottom that keeps track of the class skills per class. I can unlock skills and get around other limitations if necessary, but I'd like to get the whole thing working appropriately. I was hoping there was a way to windowlist this thing and still use the data structure style already used.

Any chance of you posting that code?

Playing Modern 3 classes is not enough!

Our average player has 2 base classes / 1 -2 advanced classes / 1 prestige class

Valarian
May 31st, 2007, 10:51
For my Traveller T20 modification, I've moved the appearance description to the notes tab, and extended the classes to 5.

Examples
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=25&d=1179439176
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=26&d=1179439198

Foen
May 31st, 2007, 15:48
The code for the class list is included above. I presume you are after code to reflect these changes on the skills page?

Cheers

Stuart
(Foen)

Doswelk
May 31st, 2007, 19:04
The code for the class list is included above. I presume you are after code to reflect these changes on the skills page?

Cheers

Stuart
(Foen)

Yes that's what I want.... :)

Doswelk
June 4th, 2007, 14:33
Adding
newwin = getWindow("slot4"); to the code Foen provided, adds another "line" to the class list, and the skill page does not crash, it just shows the last 3 classes....

So just need to work out how to update the skill page now.....



<skillsetlabel name="class4" source="classes.slot4.name">
<anchored>
<to>skillpointframe</to>
<position>insidetopleft</position>
<offset>480,16</offset>
<size>
<height>20</height>
<width>60</width>
</size>
</anchored>
<target>class4set</target>
</skillsetlabel>
<skillsetcontrol name="class4set">
<anchored>
<to>class4</to>
<position>left</position>
<offset>0,-4</offset>
<size>
<width>13</width>
</size>
</anchored>
<setid>4</setid>
</skillsetcontrol>

This does add another skill button (right on the edge of the screen), but sets it to the first class, not the 4th entry...

49 50

Any pointers?

spliskamatyshak
June 6th, 2007, 04:49
The code provided helped tremendously. I've got 9 classes working on main, skills and spells. I'm happy to share, just send me a message with an email address or as website to upload to.

I have quite a bit of SRD material in the form of modules already converted.

I'll also post it on https://sites.google.com/a/almebezbik.com/cycle-of-man-or-monsters-almebezbik-campaign/Home/PIAA.zip?attredirects=0&d=1 (https://groups.msn.com/TheWraithsHome)

Look for PIAA_FGII.zip.

Doswelk
June 6th, 2007, 10:33
The code that spliskamatyshak will send you works very well!

You have to lose the XP needed box, but seeing that I make characters "buy" a level so that they reset back down towards 0 every time they go up a level does not affect it....

The attachments so a character with 5 classes very nicely (the skill ranks are in no-way correct for a 5th Level Smart/Fast/Shadow Hunter/Hacker!).