Getting DefineConsoleFunction to work
by Rex Hiebert · in Torque 3D Professional · 06/15/2011 (8:27 am) · 3 replies
I have a simple function that i am trying to expose to the console
It compiles fine and doesn't give any warnings. But when i try to call it from script or on the command line I get "Unable to find function getStringMD5"
I even tried it as DefineEngineFunction. Not really sure what the differences are but neither work.
Any ideas?
DefineConsoleFunction(getStringMD5, const char *, (const char *stringVal),, "getStringMD5(string)")
{
//other code here
}It compiles fine and doesn't give any warnings. But when i try to call it from script or on the command line I get "Unable to find function getStringMD5"
I even tried it as DefineEngineFunction. Not really sure what the differences are but neither work.
Any ideas?
#3
06/15/2011 (10:03 am)
Not a typo. Looking at the other DefineConsoleFunction calls in the code you can see that they have that as well. That is the spot for the default value but a value is not required.
Rex Hiebert
3Dmotif LLC
error C2059: syntax error : 'constant'
error C2065: 'argc' : undeclared identifier
error C2065: 'argv' : undeclared identifier
These are not items in the code. It seems as if the macro is not working properly on the DefineConsoleFunction.
Oh, and here are the includes:
#include "console/console.h"
#include "console/consoleInternal.h"
#include "core/strings/stringUnit.h"
#include "console/engineAPI.h"
#include "console/consoleTypes.h"
What am i missing?