nezzir
May 4th, 2007, 23:05
Script Error: [string "reference_spelllistitem:link"[:1: attempt to indext a nil value
Here is the relevant code it refers to (I think):
<windowreferencefield name="link">
<bounds>5,0,20,20</bounds>
<icon>
<normal>button_openwindow</normal>
<pressed>button_emptytarget</pressed>
</icon>
<script>
function onDrag(button, x, y, draginfo)
draginfo.setType("spelldescwithlevel");
draginfo.setIcon(icon[1].normal[1]);
draginfo.setNumberData(window.getDatabaseNode().ge tChild("castnum").getValue());
draginfo.setShortcutData(getValue());
draginfo.setDescription(getTargetDatabaseNode().ge tChild("name").getValue());
local base = draginfo.createBaseData("shortcut");
base.setShortcutData(getValue());
draginfo.resetType();
return true;
end
</script>
</windowreferencefield>
I have an entry in my spell module that contains the variables "name" and "castnum". The library opens. The subwindow (the one that displays the categories - like "Bard" in the d20 setup) opens. The list opens below it that shows all the spells inside.
I get the error if I try to drag one of the spells rather than open it. The spell opens fine, I just can't drag the link.
A further indicator, is if I drag it to the bar I just get the link graphic, not the name of the spell. If I open the spell and drag it to the bar from the link on that page, it registers in the shortcut bar fine.
I'm sure there is a variable in that script that I'm not referencing properly, I just can't seem to identify it :(
Here is the relevant code it refers to (I think):
<windowreferencefield name="link">
<bounds>5,0,20,20</bounds>
<icon>
<normal>button_openwindow</normal>
<pressed>button_emptytarget</pressed>
</icon>
<script>
function onDrag(button, x, y, draginfo)
draginfo.setType("spelldescwithlevel");
draginfo.setIcon(icon[1].normal[1]);
draginfo.setNumberData(window.getDatabaseNode().ge tChild("castnum").getValue());
draginfo.setShortcutData(getValue());
draginfo.setDescription(getTargetDatabaseNode().ge tChild("name").getValue());
local base = draginfo.createBaseData("shortcut");
base.setShortcutData(getValue());
draginfo.resetType();
return true;
end
</script>
</windowreferencefield>
I have an entry in my spell module that contains the variables "name" and "castnum". The library opens. The subwindow (the one that displays the categories - like "Bard" in the d20 setup) opens. The list opens below it that shows all the spells inside.
I get the error if I try to drag one of the spells rather than open it. The spell opens fine, I just can't drag the link.
A further indicator, is if I drag it to the bar I just get the link graphic, not the name of the spell. If I open the spell and drag it to the bar from the link on that page, it registers in the shortcut bar fine.
I'm sure there is a variable in that script that I'm not referencing properly, I just can't seem to identify it :(