Thread: stringcontrol data limit?
-
July 23rd, 2005, 05:57 #1
- Join Date
- Jul 2005
- Posts
- 5
stringcontrol data limit?
I'm getting pretty frustrated here.
I am working on a custom ruleset, and everything works peachy, until I get to the Inventory tab.
For inventory I created a single large <stringcontrol> to house the players inventory. Unfortunatly, there appears to be a hard coded maximum length of text that one can put in this field. It stores it fine WHILE playing, but when it saves to the db.xml file it cuts it off and everything after this 'cutoff' length is discarded.
I'm miffed as to what I can do about this. I can't even put 3 items with their full properties, etc into the inventory box w/o it cutting off the end, or the other 15 items I have.
Is there a workaround or solution for this? I tried a <formattedtext> field there, but apparently they can't be used on character sheets, because the app crashes to desktop when I try that. (Exception)
Please help! Thanks in advance for any advice! :?
-
July 23rd, 2005, 07:54 #2
Here's what I did for my inventory - a windowlist: This works the same way as the spell list in the original d20-ruleset. First off, in the charactersheet-page that holds the inventory I have this:
<windowclass name="charsheet_inventory">
<frame name="charsheet_inventory" />
<datasource name="charsheet" />
<defaultsize width="550" height="654" />
<sheetdata>
<windowlist class="ItemEntry" name="ItemList">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="60,83,431,396" />
</windowlist>
<scroller>
<bounds rect="445,452,45,27" />
<target name="ItemList" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
<windowclass name="ItemEntry">
<frame name="ItemEntry" />
<datasource name="Item" />
<defaultsize width="419" height="18" />
<sheetdata>
<stringcontrol name="Item">
<bounds rect="0,0,136,18" />
</stringcontrol>
<stringcontrol name="ItemWeight">
<bounds rect="137,0,47,18" />
</stringcontrol>
<numbercontrol name="ItemQuality">
<bounds rect="184,0,52,18" />
<noreset />
</numbercontrol>
<stringcontrol name="Location">
<bounds rect="238,0,180,18" />
</stringcontrol>
</sheetdata>
</windowclass>
The last two steps consists of creating graphics for the item-entry, in my case there's a couple of fields on a transparent space, but if you only want a single string on it all you need is a transparent space with a line at the bottom. Then you need to define it in your graphics.xml file:
<framedef name="ItemEntry">
<bitmap file="rulesets\HarnMaster\frames\ItemList.png" />
<topleft rect="0,0,0,0" />
<top rect="0,0,0,0" />
<topright rect="0,0,0,0" />
<left rect="0,0,0,0" />
<middle rect="0,0,419,18" />
<right rect="0,0,0,0" />
<bottomleft rect="0,0,0,0" />
<bottom rect="0,0,0,0" />
<bottomright rect="0,0,0,0" />
</framedef>
On the charactersheet, you will have an empty space, that when rightclicked upon produces this:
When you click on the bottom icon with the three squares and the arrow, a new itementry is created.
This will create something like this in the character xml-file:
<node name="Item">
<node name="00001">
<stringvalue name="Item" value="Waterskin" />
<intvalue name="ItemQuality" value="0" />
<stringvalue name="ItemWeight" value="5" />
<stringvalue name="Location" value="Backpack" />
</node>
</node>
Where the skull deletes the item clicked upon. Also note the scroller button in the right corner, this will automatically appear when the itemlist exceeds the space available. The location of the scollerbutton is defined by the scroller-section in the inventory_charsheet.
I hope you find this useful. Please let me know if you want further explanations.
-
July 23rd, 2005, 19:03 #3
- Join Date
- Jul 2005
- Posts
- 5
Thank you for the detailed post.
I'll give that a shot and see how it works out.
I just rewrote the entire ruleset for the OCF/DCF system we use and when I got to inventory I wanted to be lazy
Thank you much!
-
April 4th, 2006, 07:19 #4
So the scroller will only work on a group of frames within a windowclass? Not a single multiline windowclass?
• snikle •
. .lapsus calumni. .
-
April 4th, 2006, 09:38 #5
I'm sorry but I'm not sure I understood the question. What is it that you want to do?
/EDIT: Nevermind, I read your post on the other thread. I suspect that isn't possible, but I'm not sure.Last edited by Crusader; April 4th, 2006 at 09:47.
Honor et Gloria
-
April 11th, 2006, 21:01 #6
- Join Date
- Feb 2006
- Posts
- 44
@Crusader The only problem I see with that (it is what I wanted to do) is that you then can't automatically add up allt he weights of the items in the inventory. If you knoe a way that you can then I would be *very* pleased to know about it
What I ended up doing what having a *reasoble* number of slots (27 in my case cos thats waht woudl fit into the space I had) and then adding ip up seperatly. This lead to an awful lot of cuttign and pasting and modify in the xml though...
Dan.
-
April 11th, 2006, 21:58 #7
Ran into same problem with adding up weights for inventory items.
My temporary clunky solution (hoping 1.06 provides a nicer way of doing this) was to make a total field which can be reset (middle-mouse click sets ti back tro 0) and acceptsdrop with operation="+".
The users can reset the field then drag (one at a time) the weight of each inventory item down onto the total field and it sums them up.
-
April 12th, 2006, 07:27 #8
Yeah, I was kinda hoping for 1.06 to be the rescue as well.
Honor et Gloria
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks