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 / Can't laod any image or sound with my FPSC map -_-?

Author
Message
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 2nd Jun 2009 17:29
Every time I try to load a map in a new project or a sound file they work.

But when I dblaod them in my 3D world that I got form FPSC, they don't work, I really don't know why, I tried everything bbut no images or sound files load or show up :S.


I would post a code but its too long and too complicated to understand, but its your basic noobish dblaodobject commands.

I really need to know as fast as possible plz, thx
Serial Velocity
16
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 2nd Jun 2009 17:57 Edited at: 2nd Jun 2009 17:57
Quote: "I would post a code but its too long and too complicated to understand, but its your basic noobish dblaodobject commands."


Well if we havent got code to look at, we cant really tell your problem. I'll take a guess, are your objects beyond the clipping plane? (dbSetCameraRange())

jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 2nd Jun 2009 19:51
They are most likely in the wrong location. They be in the project's working directory, which can be found from Project Properties.

yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 2nd Jun 2009 20:44
no there no, here is a sample of my project







as you cab see I put the image on the first line and nothing show up, and I am sure the loaction of the image is right.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 2nd Jun 2009 21:47
Guesses:

The dbLoadBitmap and the dbPasteImage commands don't match, because a bitmap is not an image (not even if you use the same number). Try dbLoadImage instead.

The "gif" file format is not supported by either dbLoadBitmap or dbLoadImage according to the help. I tried to load a gif and it did not work, while it works well with jpg or png, for example.

If you want the image to appear behind the 3D objects, then turn off the background colour with dbBackdropOff, otherwise the camera background hides everything. But for background images, skybox would probably be a better solution. If you want it to appear in front, then I would suggest making it a sprite.

Also, I'm pretty sure that the image or sprite should be displayed inside the "while" loop, not just once in the beginning.

No guesses on the sound files without seeing the relevant parts of the code.
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jun 2009 01:05
OK the image does show up if I put it in a "if, else if" command, but then disappears on the second, when I put it in a "while" command the thing freezes :S, why?



And about the sound its the same thing like the image, I want to start with the music playing and still looping, so I do dbLoadMusic(musicname.mid,music-ID) , but wont work
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 3rd Jun 2009 03:45
Your program is getting stuck inside the while loop forever. In this line:



By only having one equal sign, you are assigning whatever SC_ObjectCollision(...) returns to itemcollide. Did you mean to have two equal signs there to compare the variables? You can also exit a while loop by having the keyword 'break' inside of it wherever you want to exit. Also, why are you loading an image on every loop? For more info on loops and stuff: http://www.cplusplus.com/doc/tutorial/control/

For the music problem, are you calling dbLoopMusic(musicID)?

#ifdef _DEBUG
FixBugs(All);
#endif
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 3rd Jun 2009 11:04
It is advisable to always put the variable on the right of an equals sign, because it would return an error if you did this:
SC_ObjectCollision(50, 3) = itemcollide
but not
itemcollide = SC_ObjectCollision(50, 3)
which is also wrong.
this would work fine:
SC_ObjectCollision(50, 3) == itemcollide

yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jun 2009 19:01
Quote: "It is advisable to always put the variable on the right of an equals sign, because it would return an error if you did this:
SC_ObjectCollision(50, 3) = itemcollide"


it givess me this:

1>c:\the game creators\dark gdk - game1\dark gdk - game1\main.cpp(284) : error C2106: '=' : left operand must be l-value
1>Build log was saved at "file://c:\The Game Creators\Dark GDK - Game1\Dark GDK - Game1\Debug\BuildLog.htm"


===============


for Bran flakes91093:

I tried the :


But it does post the image(FIANLLY ), but I want it to show up whrn the character collides with the gun, so if I take out the break, and run it, the comppiler freezes.


As fo the music, I got to working using one of the lopps in the link you gave me, ty (it was a looping problem after all).
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 3rd Jun 2009 21:43
So why are you using a while loop then? A while loop keeps going until it hits a break statement or the statement inside it becomes false. You would want to use an if statement instead.



By the way, what is 'itemcollide' for? What does it equal? And what kind of variable does SC_ObjectCollision(...) return?

#ifdef _DEBUG
FixBugs(All);
#endif
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jun 2009 22:36
I did use the the "if statement", but the second the 'itemcollide' happens the image appears and then disappears on the second.

SC_ObjectCollision(50, 3) is collision between the character (= 50) and gun( = 3)

Itemcollide is collision between any object.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 4th Jun 2009 00:49
What are you trying to accomplish? The image shows up when the two objects are colliding and hides when they are not. Is that correct? Are you trying to make it so that if the two objects ever collide the image shows up and doesn't go away? Make a bool variable then.


That will make the image appear forever if the two objects ever collide.


Quote: "
Quote: "It is advisable to always put the variable on the right of an equals sign, because it would return an error if you did this:
SC_ObjectCollision(50, 3) = itemcollide"

it givess me this:

1>c:\the game creators\dark gdk - game1\dark gdk - game1\main.cpp(284) : error C2106: '=' : left operand must be l-value
1>Build log was saved at "file://c:\The Game Creators\Dark GDK - Game1\Dark GDK - Game1\Debug\BuildLog.htm""


Well, you can't assign a value to a function. Besides, he was telling you NOT to do it that way anyway.

#ifdef _DEBUG
FixBugs(All);
#endif
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 4th Jun 2009 01:02
I woud suggest having a look around the web at some basic C++ coding tutorials, or downloading some free ebooks on the subject.

Alot of the code in C++ is more complex that it appears and requires a firm knowledge of the concepts involved. However, it doesnt take too long a time to get a grasp on the basics and go from there.

Good Luck.

If it ain't broke.... DONT FIX IT !!!
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 4th Jun 2009 16:25
Quote: "What are you trying to accomplish? The image shows up when the two objects are colliding and hides when they are not. Is that correct?"


Dude why do you sound so pissed off lol, yes that what I want basically want, I want the 3D character to collide with the gun, then an image of a gun appears and stays there, just like real games.

Anyway it worked, bool why didn't think of that XD, your awesome man , I know I been a totally noob and stuff but it works now:




=========================
Quote: "I would suggest having a look around the web at some basic C++ coding tutorials, or downloading some free ebooks on the subject."


Well I would if there was one for Dark GDK, all they have are some basic stuff, thats didn't help with developing a game people would want, also C++ tutorials wont help me fast enough in the coming week, I just have the small last touches I wanna add for the game to finish it before time is up :S.


Anyway thanks Branfor all your help .
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 4th Jun 2009 21:56
Did I really sound that mad? I must've been in a bit of a bad mood when I wrote that lol. Don't take it personally though.

#ifdef _DEBUG
FixBugs(All);
#endif

Login to post a reply

Server time is: 2024-11-05 23:01:43
Your offset time is: 2024-11-05 23:01:43