Game Development Community

Why Is This Attempting? (solved)

by rennie moffat · in Torque Game Builder · 03/05/2011 (7:33 pm) · 2 replies

I know this will sound lame but this is driving me crazy why do I get this message in the console rgarding this call to a function...?



function BBBehavior::checkEndGameStatus()
{
		%this.endLevelNow();
}


function BBBehavior::endLevelNow(%this)
{
}

in the console I get this message...
game/scripts/behaviors/BBBehavior.cs (3): Unable to find object: '' attempting to call function 'endLevelNow'



What object is it looking for and why is it attempting to call this? Seems so odd.


:S

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
03/05/2011 (7:55 pm)
You forgot to list %this as a parameter in checkEndGameStatus(). Unlike in C++, %this isn't automatically implied in TorqueScript. It has to be specified and for functions with a namespace, like your checkEndGameStatus(), the first parameter of the function is always the object itself.
#2
03/05/2011 (8:30 pm)
oh shoops!


Thanks.