Are you sure your model is rigged properly.
In your installation of DarkGDK, there will be a tank model called "L-Tank.x".
Use it with this sample code and see if the turret and barrel function as they should.
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
//dbSetWindowOff ( );// Set to full screen mode
dbSetDisplayMode ( 1024, 768, 32 );
//dbHideMouse ( );
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
dbAutoCamOff ();
//dbMaximizeWindow ();
dbPositionCamera ( 0, 20, 0 );
dbRotateCamera ( 60, 0, 0 );
dbLoadObject ( "L-Tank.x", 1 ); // low resolution tankk model prerigged
dbYRotateObject ( 1, 180 ); // tank model was back to front.
dbFixObjectPivot ( 1 );
// our main loop
while ( LoopGDK ( ) )
{
dbText (10, 10, "WASD controls movement of the tank");
dbText (10, 25, "Q / E controls movement of the turret");
dbText (10, 40, "Z / C controls movement of the gun elevation");
/****************************
* Limb 1 is the body
* Limb 2 is the right tread
* Limb 3 is the turret
* Limb 4 is the cannon
* Limb 5 is the left tread
*****************************/
if (dbKeyState(17)) { dbMoveObject (1, 0.2); } // W
if (dbKeyState(31)) { dbMoveObject (1, -0.2); } // S
if (dbKeyState(32)) { dbTurnObjectLeft (1, -0.5); } // A
if (dbKeyState(30)) { dbTurnObjectLeft (1, 0.5); } // D
if (dbKeyState(16))//Q
{
if (dbLimbAngleY ( 1, 3 )>-120 )
{ dbRotateLimb ( 1, 3, 0.0, dbLimbAngleY ( 1, 3 )-0.5, 0.0 ); }
}
if (dbKeyState(18))//E
{
if (dbLimbAngleY ( 1, 3 )<120 )
{ dbRotateLimb ( 1, 3, 0.0, dbLimbAngleY ( 1, 3 )+0.5, 0.0 ); }
}
if (dbKeyState(0x2C))//Z
{
if (dbLimbAngleX ( 1, 4 )<30.0)
{ dbRotateLimb ( 1, 4, dbLimbAngleX ( 1, 4 )+0.5, 0.0, 0.0 ); }
}
if (dbKeyState(0x2E))//C
{
if (dbLimbAngleX ( 1, 4 )>0)
{ dbRotateLimb ( 1, 4, dbLimbAngleX ( 1, 4 )-0.5, 0.0, 0.0 ); }
}
// update the screen
dbSync ( );
}
// return back to windows
//dbShowMouse ( );
return;
}
If things work properly for that tank model and the code, then the problem you are facing is probably in yur created model.