PDA

View Full Version : Crash on windowlist create item?



Brenn
November 21st, 2008, 14:13
I have a windowlist (connected to the db) and an associated child window class. Any time I try to create an item for the list, it crashes. I know I'm missing something obvious here, but I can't find it. The parent window for the windowlist is instanced by a windowreference control. The XML defenition for the window/window list/child window is below. The scripts for the windowlist and child window don't contain anything execpt a empty onInit() scripts.


<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
<windowclass name="reign_weaponlistitem">
<sizelimits>
<minimum>
<height>20</height>
</minimum>
</sizelimits>
<!--<frame>sheetgroup</frame>-->
<script file="scripts/reign_weaponlistitem.lua"></script>
<sheetdata>
<stringfield name="weaponname">
<anchored>
<!--<parent>weaponlistframe</parent>
<position>insidetopleft</position>
<offset>25,9</offset>-->
<left>
<anchor>left</anchor>
<offset>7</offset>
</left>
<top>
<anchor>top</anchor>
<offset>8</offset>
</top>
<size>
<width>100</width>
</size>
</anchored>
<font>sheetlabelsmall</font>
<!--<static>Tournament Lance</static>-->
</stringfield>
</sheetdata>
</windowclass>
<windowclass name="reign_custom_weapons">
<placement>
<size>
<width>252</width>
<height>611</height>
</size>
</placement>
<nodelete />
<datasource>reigncustomweapons</datasource>
<sheetdata>
<genericcontrol name="weaponlistframe">
<bounds>10,15,494,390</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>
<genericcontrol name="weapondataframe">
<bounds>10,400,494,200</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>

<stringcontrol>
<anchored>
<to>weaponlistframe</to>
<position>insidetopleft</position>
<offset>25,9</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Weapon Name</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponlistframe</to>
<position>insidetopleft</position>
<offset>120,9</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Range</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponlistframe</to>
<position>insidetopleft</position>
<offset>160,9</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Shock Dmg</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponlistframe</to>
<position>insidetopleft</position>
<offset>220,9</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Killing Dmg</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponlistframe</to>
<position>insidetopleft</position>
<offset>300,9</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Primary Pool</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponlistframe</to>
<position>insidetopleft</position>
<offset>380,9</offset>
</anchored>
<font>sheetlabelsmall</font>
<static>Default Pool</static>
</stringcontrol>

<windowlist name="weaponlist">
<anchored>
<to>weaponlistframe</to>
<position>over</position>
<offset>-12,-9</offset>
<top>
<parent>weaponlistframe</parent>
<offset>25</offset>
</top>
</anchored>
<datasource>.weaponlist</datasource>
<class>reign_weaponlistitem</class>
<allowcreate />
<allowdelete />
<script file="scripts/reign_weaponlist.lua"></script>
</windowlist>
</sheetdata>
</windowclass>
<windowclass name="custom_reignweapons">
<frame>charsheet</frame>
<placement>
<size>
<width>525</width>
<height>611</height>
</size>
<position>
<x>500</x>
<y>100</y>
</position>
</placement>
<minimize />
<!--<datasource>reigncustom</datasource>-->
<nodelete />
<!--<playercontrol />-->
<sheetdata>
<subwindow name="reignweapons">
<bounds>0,0,-1,-1</bounds>
<class>reign_custom_weapons</class>
</subwindow>
<!--
<subwindow name="hit_location">
<bounds>0,0,-1,-1</bounds>
<class>custom_hitlocation</class>
</subwindow>
-->
<tabcontrol name="tabs">
<bounds>-22,50,18,492</bounds>
<tab>
<icon>tab_skills</icon>
<subwindow>reignweapons</subwindow>
</tab>
<!-- <tab>
<icon>tab_hit_location</icon>
<subwindow>custom_hitlocation</subwindow>
</tab>-->
<activate>1</activate>
</tabcontrol>
</sheetdata>
</windowclass>
</root>

I've commented out datasource tags here and there in troubleshooting. I think it might have something to do with the node references I have, but truthfully I don't know.

Foen
November 22nd, 2008, 08:37
What script errors are you getting?

I'm also not sure you should create a windowclass without a frame (reign_weaponlistitem).

Foen

Brenn
November 22nd, 2008, 12:12
I was getting no script errors, it was a hard crash with no console log, and the reign_weaponlistitem is the windowclass used inside the reign_weaponlist windowlist.

It had something to do with this code in reign_weaponlistitem:



<stringfield name="weaponname">
<anchored>
<!--<parent>weaponlistframe</parent>
<position>insidetopleft</position>
<offset>25,9</offset>-->
<left>
<anchor>left</anchor>
<offset>7</offset>
</left>
<top>
<anchor>top</anchor>
<offset>8</offset>
</top>
<size>
<width>100</width>
</size>
</anchored>
<font>sheetlabelsmall</font>
<!--<static>Tournament Lance</static>-->
</stringfield>


Through commenting I found that to be the root cause, so I just cut and pasted another stringfield I had, modified and it's all golden now. I haven't compared them to see what the heck was going on yet. It's probably something stupid on my part, I was pretty tired when I was doing that code yesterday.

Foen
November 23rd, 2008, 06:10
I'm not sure how good FG is at parsing comments, they have caused crashes for me in the past. I tend to disable tags by editing the names, so <parent>...</parent> becomes <p-arent>...</p-arent>. I think this is how SmiteWorks comment out the tags too (at least, they appear like this in several places in the default d20 ruleset).

Foen

Brenn
November 23rd, 2008, 11:17
That's good to know. Come to think of it, I believe I had something similar happen a while ago too. I'll need to watch that.