May 12, 2009

Legal or not - That is the question...

...that lots of people have been bugging DaDummy and me about, so we just went to PiranhaBytes and JoWood and asked for allowance. And then... the unimaginable! We got the allowance from PB and JoWood!
Yeah! No more being-bugged about legality stuff!

Man, I'd really like to have a Guinness about that!
But I have none... D:

By the way: If you still think that this project is not really legal and/or just want to make a drama, then drop a private message for DaDummy at the World of Gothic forum!

Parser interaction


As you all know, we're doing quite devious and sadistic things with Gothic's engine, but.... wow... we managed to make Gothic register a external script function, which can actually be used. *weeeeee*

G2Ext + zCWorldPerFrameCallback = *weee*


After playing a bit with Gothic's "per frame callback"-system, I implemented added a wrapper for the zCWorldPerFrame callback system into G2Ext. No more hooks (and their stupid limitations) needed to perform any actions in the main loop!
You just register your function in to the callback system and you're done! G2Ext does all the annoying stuff with zCWorldPerFrameCallback for you.^^

Lets make a short example:

// foobar() is the function which shall be registered
// and called each rendering cycle
void __stdcall foobar(void* world, void* camera)
{
MessageBox(0, L"hello world :)", 0, 0);
};

// a random init function which will be called at program start
void init(void)
{
// Register callback to function "foobar"
g_callback->registerPerFrameCallback("foobar", &foobar);
// Globally turn on rendering callbacks
g_callback->enableCallbacks();
};

// a random shutdown function which will be called when the program
// is being closed
void shutdown(void)
{
// remove "foobar" from the callback list
g_callback->unregisterPerFrameCallback("foobar");
// globally disable callbacks
g_callback->disableCallbacks();
};

By the way: callbacks can be registered at any time.

Another example for callback usage is on-screen output:

void __stdcall Callback(void* World, void* Camera)
{
// Get the zCView instance
zCView* screen = (zCView*)GetScreen();
// Create a zSTRING (actually a wrapped std::basic_string.....)
// with text
// Oh, how i hate zSTRINGS! They caused so much trouble...
zSTRING text("G2Ext Pre Alpha");
// Print everything on screen (x, y, text)
screen->Print(200, 200, text);
};

A shot on the new starter


The new starter has been finished so far and it works^^
At the moment, it doesnt have many features, but its planned to give it at least the same functionality as the GothicStarter by Nico.

If you're interested in G2Ext and want to participate in our project or contribute something to it, drop a private message to DaDummy at the World of Gothic forum.

Sooooo.... wt* is G2Ext actually?


G2Ext is a engine modding toolkit for Gothic II, which allows you to write and use your own engine plugins for Gothic II.
The toolkit can be used to implement f.e new features or modify existent features of the engine, without modifying the actual data of the engine itself, by using code injection.

The actual reason why we make G2Ext is, because there are lots of people which actually want to use some features for their mods, which can only be implemented by modifying the engine.
The thought behind it was to make a unified code injection toolkit for Gothic II to make it easier for people to implement their stuff to the engine by plugins, so that they don't have to do the whole code injection stuff themselves.

G2Ext will also have some features that will make your like easier (f.e a callback system for the main application loop, interaction with Gothic II's script parser, etc.) and also some other stuff to play with.

If you now think that G2Ext is some wonder toolkit which makes everything possible, you're only partially right. You can make everything, but it depends on your skills and knowledge about how to do it.
By the way: You will need knowledge about reverse engineering, gamehacking and good C++ skills to work with G2Ext.

Heyhey!

Welcome to our new G2Ext-dev-blog^^
We (DaDummy and Thunderhawk) will post our progress more or less regularily up here.

Have fun.

Sig.
The G2Ext devs.