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 / sparky object not being updated 7008

Author
Message
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 11th Jan 2011 11:28
Hi all.

ok i am a beginner in VS C++ and darkgdk.I have a problem in my code which is really annoying me as i can't find the mistake.Here's the code:


Now the problem i guess is in "objecty" . Thanks in advance.

ALLAH IS THE GREATEST
May he forgive me
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 11th Jan 2011 15:46
Oh and one more thing , the camera (trdcam()) function is a little disturbed too.It makes the camera orbit in reverse order when the wrapvalue is at 180 to 360

ALLAH IS THE GREATEST
May he forgive me
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 11th Jan 2011 19:39
What's the problem you mention in your first post?

Difficult to help until the GDK.read_mind struct is finished.. .


If it is a "won't compile" or "won't link" problem, then best to post the error report, etc.

If it is a "don't do what I expected" problem, then please explain what you expected and what it doesn't do, etc.

Amazing Simulation
www.amazing-forum.com
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 11th Jan 2011 20:33 Edited at: 11th Jan 2011 20:39
well the error comes in after the project is built.An error message appears on screen with heading COLLISION and error report as "Error in object update:object (7008) not setup" and an ok button.When click the ok , the program shuts down /closes by it self.

If you can compile the code i suggest testing with remming the code of making the "objecty" as a whole.

ALLAH IS THE GREATEST
May he forgive me
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 12th Jan 2011 10:38
Helloooooooo? plz guys help me . I have a Chief Of Army Staff(C.A.S) science fair to hold on.I need a project as fast as possible.


PLZZZZZZZZZZZZZZZZ help me..

ALLAH IS THE GREATEST
May he forgive me
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Jan 2011 16:46 Edited at: 12th Jan 2011 22:59


Your objectx and objecty seemed to have been wrong. I debugged it and changed a couple of bits in the code.

EDIT: Fixed the (int max) bit as the comment below...

Warning! May contain Nuts!
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 12th Jan 2011 17:47
@WLGfx
Thank you SIR!, man what was wrong???

Is FOR loop not suitable??

ALLAH IS THE GREATEST
May he forgive me
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Jan 2011 17:51
objectx wasn't being assigned so it had any old number in it. Once that was sorted it ran fine. That's after playing about with the other code a little. Sparkys collision is something I've only just started with myself but it seems easy enough to use. Once it ran okay I didn't do much else with it to get the actual collision working. Gonna have a nap then if either of us get it working then the first to post.

Warning! May contain Nuts!
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 12th Jan 2011 21:44
Could I also point out that your "returnobject" function is somewhat defective? You pass the value of "max" to it, but never use that value.

Did you mean to do something like this?

int returnobject (int max) {
for (nt counter=1;int counter<=max;counter++){
if (dbObjectExist(counter)==0){
return (counter);
}
}
return(0); // assuming that 0 would be a failure code
}

Amazing Simulation
www.amazing-forum.com
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Jan 2011 22:56
I just edited the code and never took that part of the function out. I just used a piece that was slightly quicker I always use. I was more doing the debugging to find were the original error was being generated from. I found the error in the objectx and objecty setup, got it running and never finished polishing the code. Sowwy.

Warning! May contain Nuts!
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 13th Jan 2011 03:46
WLGfx nah its ok you have helped alot too, thanks.

OK so how do i use "SetCurrentDirectory" .Whenever i do this it doesn't load the object(dbo).Oh and if i use the address of the object in dbLoadObject command it still doesn't do anything and it does not give any error for missing objects.

ALLAH IS THE GREATEST
May he forgive me
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Jan 2011 15:34
I tend not to set directories. It's easier to use relative paths instead. ie. "../media/level.x" or "../../stuff/"

The only time to use SetCurrentDirectory is when using a file/directory selector. But that's winapi stuff.

Warning! May contain Nuts!
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Jan 2011 00:38
@Neotron

I've added a link to this post (a project zip file you can download) with something I've come up with. Collision works fine. (no sliding collision yet though). I had problems with the dbSetCameraToFollow. After reading the forums I found that it would not work if using free flight object control. Something to do with the function dbObjectPositionY(obj). Hope this helps out because it's the first time I've used sparky's...

Warning! May contain Nuts!

Attachments

Login to view attachments
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 14th Jan 2011 10:29
@WLGfx

thank you so much sir.

I am 17 yrs old and don't know much of the c++ , so plz forgive me of anything ,thing....

ALLAH IS THE GREATEST
May he forgive me

Login to post a reply

Server time is: 2024-09-28 14:04:58
Your offset time is: 2024-09-28 14:04:58