GUI error: What am I doing wrong here?
by Rodney (OldRod) Burns · in Torque 3D Professional · 10/10/2009 (9:37 pm) · 3 replies
I have a GUI file that has a button defined as this:
Then at the bottom of the same GUI file I have this:
When I run the code, I get "<input> (0): Unknown command createAccount."
I'm sure I'm missing something quite obvious, but I just can't see it. Can someone enlighten me, without making me feel too stupid? :)
new GuiButtonCtrl() {
text = "Create Account";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
isContainer = "0";
Profile = "GuiButtonProfile";
HorizSizing = "right";
VertSizing = "top";
position = "189 289";
Extent = "90 23";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "createAccountDlg.createAccount();";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
};Then at the bottom of the same GUI file I have this:
function createAccountDlg.createAccount(%this)
{
}When I run the code, I get "<input> (0): Unknown command createAccount."
I'm sure I'm missing something quite obvious, but I just can't see it. Can someone enlighten me, without making me feel too stupid? :)
#2
The '.' and '::' was a copy/paste error when I made the post - I had that correct in the script. The problem turned out to be something else. I had some code inside the function createAccount() that wasn't fully commented out like I thought. That caused an error when the script compiled, so yeah, the game couldn't find it because it didn't compile properly. /facepalm
Woke up this morning and found it right away. Thanks for the help anyway, OmegaDog :)
10/11/2009 (8:28 am)
LOL, I guess it had been too long a day...The '.' and '::' was a copy/paste error when I made the post - I had that correct in the script. The problem turned out to be something else. I had some code inside the function createAccount() that wasn't fully commented out like I thought. That caused an error when the script compiled, so yeah, the game couldn't find it because it didn't compile properly. /facepalm
Woke up this morning and found it right away. Thanks for the help anyway, OmegaDog :)
#3
unnoticed script errors are a pita.
i highly recommend writing something like the following and calling it either periodically or once your level is loaded:
10/11/2009 (4:45 pm)
> That caused an error when the script compiledunnoticed script errors are a pita.
i highly recommend writing something like the following and calling it either periodically or once your level is loaded:
$gLastScriptErrorHash = "";
function checkScriptError()
{
if ($ScriptErrorHash == $gLastScriptErrorHash)
{
return;
}
MessageBoxOK("Script Error" SPC $ScriptErrorHash, $ScriptError, "");
$gLastScriptErrorHash = $ScriptErrorHash;
}
Associate OmegaDog
. is replaced with ::
I take it you have a createAccountDlg setup.