Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Game HELP!!!! PART 2

Author
Message
Tylerman35
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 30th Jul 2009 03:11
Here is my code and i have an error.
Here is my error.

1>------ Build started: Project: Dark GDK - Game2, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>c:\users\tyler\documents\visual studio 2008\projects\dark gdk - game2\dark gdk - game2\main.cpp(19) : warning C4551: function call missing argument list
1>c:\users\tyler\documents\visual studio 2008\projects\dark gdk - game2\dark gdk - game2\main.cpp(20) : error C2664: 'dbMoveObject' : cannot convert parameter 1 from 'const char [12]' to 'int'
1> There is no context in which this conversion is possible
1>Build log was saved at "file://c:\Users\Tyler\Documents\Visual Studio 2008\Projects\Dark GDK - Game2\Dark GDK - Game2\Debug\BuildLog.htm"
1>Dark GDK - Game2 - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


-----------------------------------
#include "DarkGDK.h"

void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate ( 60 );

dbSetWindowTitle ( "Colonel-X.X" );

dbSetCameraRange ( 1.0f, 30000.0f );

dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbScaleObject ( 2, 30000, 30000, 30000 );
dbPositionCamera ( 385, 23, 100 );
dbSetObjectTexture ( 2, 3, 1 );

dbLoadObject ( "Colonel-X.X", 1);

while ( LoopGDK ( ) )
{
if (dbUpKey ){
dbMoveObject ( "Colonel-X.X", 1);
}

dbControlCameraUsingArrowKeys ( 0, 2.0f, 2.0f );

dbSync();
}
return;
}

---------------------------------------------

Well please message me back if you can help me!!!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 30th Jul 2009 06:13


Check your docs on the usage of functions, I think you have some things mixed up a little, here is the entry for dbMoveObject from the DarkGDK Documentation :

Quote: "dbMoveObject
This command will move the specified 3D object in 3D space. The command uses the current direction of the object and moves it using the specified step value.

Syntax
void dbMoveObject ( int iObject, float fSpeed )
"


You are calling that command incorrectly. The first parameter should be an integer that represents your object ID, in this case you loaded "Colonel.X" as object number 1. The second parameter of the function should be a floating-point number representing the speed that you want the object to move at. It basically says how far the object will move each time that command is called, larger numbers mean is moves quicker.

So, with the above in mind, the correct way to call that comand in your program would be :



ALSO :



is being called incorrectly, again check the docs, here is the listing for that command :

Quote: "dbUpKey
This command will return a value of one if the up arrow key is being pressed, otherwise zero is returned.

Syntax
int dbUpKey ( void )
"


Notice that the syntax is pre-fixed with "int" rather than "void" with this command. This means that it will return a value when it is called, of the type integer. You almost had it right when calling it, your syntax should be :


OR


both of the above will result in the same thing, it will enter the if loop, if the UP arrow key has been pressed when that command is called.

Hope this helps you

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-10-01 08:36:19
Your offset time is: 2024-10-01 08:36:19