Game Development Community

Custom c++ ConsoleFunction

by Eyaly · in iTorque 2D · 12/29/2009 (10:54 am) · 3 replies

Hi,

i add the following function to the engine
ConsoleFunction(helloWorld, void, 1, 1, "A simple test function.")
{
Con::printf("Hello World!");
}

then i build it in xcode.

now i want to execute this function from within the console so i launch iTGB again
and hit F5 to execute the simulator.(iTGB simulator)
then i open the console with ~ (tild)
and there i type: hello();

the console complain that theres no such function.

please help.

#1
12/29/2009 (11:52 am)
I am no guru but i beleive you have to type in helloworld(); in your console since thats what you named the function :)
#2
12/29/2009 (12:14 pm)
well i did type helloword()...
i just type hello() here in the forum :)
so the problem is still there.

any idea?
#3
01/02/2010 (11:34 pm)
Eyaly, what file have you created your new ConsoleFunction in? It sounds like the file its in may not be getting compiled when you build your program.