Game Development Community

isMethod() and Namespaces

by Vern Jensen · in Torque Game Builder · 01/15/2009 (4:40 pm) · 2 replies

I've modified the engine to add "alxPause". If I upgrade the engine at some point and forget to put alxPause in the source, I want to just mute the music instead of pausing it. I figure the isMethod() method should let me know if alxPause() exists as a method or not. Problem is, isMethod() requires me to pass it a namespace. I've tried "" to represent generic console functions, but that didn't work. What do I pass for a namespace for general functions?

if ( isMethod( "", "alxPause" ) )
alxPause($gCurrentlyPlayingMusicID); // This doesn't get called, but should
else
alxSourcef($gCurrentlyPlayingMusicID, AL_GAIN, 0);

#1
01/15/2009 (4:43 pm)
Try, isFunction()
#2
01/15/2009 (5:45 pm)
Sweet, that does the trick. Could've sworn I had tried that and gotten a console error, but I guess not.