Playgui::onAdd not being called?
by Terence Tan · in Torque Game Engine · 07/26/2006 (9:00 pm) · 7 replies
Hi,
I just put this in playgui.cs starter.fps\client\scripts:
in the FPS starter mod. It isn't being called? ideas? Tested with out of the package exe.
I just put this in playgui.cs starter.fps\client\scripts:
function PlayGui::onAdd(%this)
{
echo ("Play Gui on add called");
}in the FPS starter mod. It isn't being called? ideas? Tested with out of the package exe.
About the author
#2
huh. it works on SimObjects..
i guess the base class method must be overridden in the engine by a method which doesn't do the script callback.
Terence - onWake() will probably work for you, but if it doesn't, it should be easy to make onAdd() work for guiControls. let me know if you need help.
07/26/2006 (10:05 pm)
Really ?huh. it works on SimObjects..
i guess the base class method must be overridden in the engine by a method which doesn't do the script callback.
Terence - onWake() will probably work for you, but if it doesn't, it should be easy to make onAdd() work for guiControls. let me know if you need help.
#3
I suppose i should go over and nudge him to make sure he fixes it before somebody else forgets?
Got dropped in 1.4? I assume?
07/26/2006 (10:39 pm)
Should be fine then....Ed's book on counters needs some corrections then...I suppose i should go over and nudge him to make sure he fixes it before somebody else forgets?
Got dropped in 1.4? I assume?
#4
So why doesn't it work for PlayGui? I know that on several occasions i've tried onAdd on PlayGui and it never works. Something else must be going on with that particular control.
07/26/2006 (11:30 pm)
Well i take it back... i got curious and looked at the code. GuiControl::onAdd() clearly calls the onAdd callback...// Notify Script.
if( isMethod("onAdd") )
Con::executef(this, 1, "onAdd");So why doesn't it work for PlayGui? I know that on several occasions i've tried onAdd on PlayGui and it never works. Something else must be going on with that particular control.
#5
I tracked it down there using the debugger as well. The namespace is definately there...even caught it calling PlayGui but it never called it. It's just odd because the code is the first thing I hit..GameTSCtrl be eating up the onAdd and not passing along to the parent?
Some mystic stuff going on..onWake works though for now.
07/27/2006 (1:21 am)
Yeah,I tracked it down there using the debugger as well. The namespace is definately there...even caught it calling PlayGui but it never called it. It's just odd because the code is the first thing I hit..GameTSCtrl be eating up the onAdd and not passing along to the parent?
Some mystic stuff going on..onWake works though for now.
#6
I tracked it down there using the debugger as well. The namespace is definately there...even caught it calling PlayGui but it never called it. It's just odd because the code is the first thing I hit..GameTSCtrl be eating up the onAdd and not passing along to the parent?
Some mystic stuff going on..onWake works though for now. I've kinda noticed that derived object from GuiControl from a new via scripts also do not call onAdd.
07/27/2006 (1:22 am)
Yeah,I tracked it down there using the debugger as well. The namespace is definately there...even caught it calling PlayGui but it never called it. It's just odd because the code is the first thing I hit..GameTSCtrl be eating up the onAdd and not passing along to the parent?
Some mystic stuff going on..onWake works though for now. I've kinda noticed that derived object from GuiControl from a new via scripts also do not call onAdd.
#7
07/27/2006 (10:46 am)
The question is onAdd disabled in some GuiControls on purpose or is it a bug?
Associate Tom Spilman
Sickhead Games