AGK is good, you don't even need to execute a type definition for it to occur.
I declare my type like this.
Quote: "Main.agc
#include types.agc
dim MyType[ 0 ] as tMyType
end
"
.
Quote: "Types.Agc
Type tMyType
EndType"
I like all my code to be self declaring, so all types in include files are declared at the top of the file, NOT in any functions.
Then when I call a function the first time, if it hasn't been declared it'll automatically call the declaration function which will do all the DIMing and GLOBALing.
This way, all my AppGameKit includes are plug and play. An example is my UI engine. All I need to do is #include UI.agk and it's all setup. As long as my main loop calls UI_Update() I don't need to explicitly do any initialisations.
Any include file which has dependencies for other files will #include them itself.
My current game engine is structured so that the game is in one folder, and the core engine files are in another. In my Game, I'll #include ..\Engine\Engine.Agc and that's it.
Game specific files remain in the game folder, engine specific files stay in its own folder. I can update the engine independently of the game, and vice versa.