Game Development Community

ConsoleFunction macros and embedded Torque

by Frank Bignone · in Torque Game Engine · 08/23/2003 (2:13 pm) · 4 replies

First of all, yep I'm still alive ;)

Just a side note as it took me at least 10 minutes to figure it out, and it may help some of you. I'm currently writing a DLL/lib to embed Torque engine in many application (think of it as nice C++/Java classes that will allow you to interact with the game engine inside your own application). I face a problem with some script functions (i.e. OpenALInitDriver, ...) not known by the console. It turns out to be that the functions are defined via ConsoleFunction which defines a static ConsoleConstructor object, which then allocates your function and registers it. However, in order to work (at least with visualc), you must 'go' in the .cc file to 'activate' the static variables because it's a DLL/lib and not an exec I think. A work-around is to include these functions in a dummy.cc file and have a dummy function that you will call once. Voila.

If it's not clear for you, it's probably that you do not face this problem and then sorry to have bothering you.

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
08/23/2003 (2:19 pm)
Hey Frank!

I always wanted Torque to be embeddable inside a decent windows interface for tools.

Is this something personal or are you going to share?

Guess its quite a bit of work though.

Anyway, good to see your still around!

Phil.
#2
08/23/2003 (2:27 pm)
@Phil: I do not have any ideas if I will share it or not. I'm using it for the Eclipse framework (if you see where i'm going ;) ). BTW, yes it's a bit of work; mainly if you want to make it almost thread-safe. I may release the java library + dll when available so people will be able to develop new eclipse plugins.
#3
08/27/2003 (6:22 am)
Frank,

What's going on with DoP? Is it currently back-packing around Europe looking to find itself? ;-)
#4
08/28/2003 (12:16 am)
I'm cutting down all the features we wanted to put on DoP as the team is now greatly reduced. I'm focusing only on the racing and dogfight features of the game and rewritten a fair amount of scripts before asking some artists for help.