Game Development Community

What happened to my string?

by Drethon · in Torque Game Builder · 05/13/2009 (4:55 pm) · 1 replies

I tried passing a constant string from a gui to the object that created a gui by:

Creating a GUI button with an associated function:

Command = "MyGUI.GuiFunction(\"Player\");";

Then having the callback call the object that created the GUI ( calingObject is a field updated with %this when the GUI is created )

function MyGUI::GUIFunction ( %this , %MyObject )
{
echo("Callback:",%MyObject);
   %this.callingObject.ObjectFunction ( %this.callingObject , %MyObject ) ;
}

At this point the echo produces "Callback:Player". This gets to the Object Function:

function MyObject::ObjectFunction ( %this , %MyObject )
{
   echo("Object Function",%MyObject);
}

At this point, instead of producing "Object Function:Player", the echo outputs "Object Function:1359".

What did I misunderstand?

#1
05/13/2009 (5:24 pm)
Never mind... it clicked in my head that I was wrong to think I need to pass in a value for %this. Should think a bit longer before I ask questions...