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 / What am I doing wrong?

Author
Message
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 29th Apr 2008 03:42
I'm trying to load a .x file into a scene, and I have it in my source files as Ship.x. Okay, this is the code I have.


What am I doing wrong in this? When I build it all I get is a green screen.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Apr 2008 14:26
Load it outside the loop - you're loading it over and over. Same for the MAke Camera!

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 30th Apr 2008 00:41
Thanks for your post, but it seems that something else is wrong.

Sorry for my bad timing and MSN. =p

Is there anything else that could be causing this?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Apr 2008 01:07
1: Vista LOL (just kidding)

2: Try if(dbFileExist("Filename.x")){dbPrint("See It");}else{dbPrint("SHOOT!");};

Could be part of your issue alone! (Or try full path to file.)

jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 30th Apr 2008 01:35
...I thought I read that correctly. You don't need to add the ship.x file to your project. I'd remove that.

You do need ship.x to be in the same directory as your executable. however. It is either Release, or Debug and not the project directory itself.
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 30th Apr 2008 01:38
Nope. "Shoot" showed up on the screen. I'll try a full path. Exactly how do I find the full file path of a file? I'm sure I could figure it out, in time. But it would be much faster to see it, or read it. Once I have the full path how do I incorporate it in code? Thanks for your help man!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Apr 2008 02:31
Navigate to the directory with the file and cut-n-paste the "Path" and put that in the dbLoadObject("c:/MyPath/Myfile.x"); (I like forward slashes.)

But what Jenzai said is true... If you run the compiled EXE by clicking on it from explorer, the files needs to be in same dir as the EXE...

...but if you run from the IDE VS2008, you need media usually in the project directory but not the solution directory(if different) ... do the "Cool/Shoot" file test

Once you get the hang of WHY... You'll have a better understandingh of what's going on. In short, the "Working Dir" Depends how the program is launched. Actually using FULL PATHS for the file names is not a good practice... because if you move the program to a friends PC or another directory on your machine - things might break if the media isn't there anymore.

Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 30th Apr 2008 12:07
Try don't make a new camera.
There is already a camera by default.
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 30th Apr 2008 22:26
Could there be another problem behind it? Like the .x file is not being exported properly? Oh, when I right click on Source Files and click Add Existing Item, a Dialog box opens asking for some information. Could I not be putting the right info in or something?

Quote: "But what Jenzai said is true... If you run the compiled EXE by clicking on it from explorer, the files needs to be in same dir as the EXE...

...but if you run from the IDE VS2008, you need media usually in the project directory but not the solution directory(if different) ... do the "Cool/Shoot" file test

Once you get the hang of WHY... You'll have a better understandingh of what's going on. In short, the "Working Dir" Depends how the program is launched. Actually using FULL PATHS for the file names is not a good practice... because if you move the program to a friends PC or another directory on your machine - things might break if the media isn't there anymore."


I'm...totally lost to all of that. See, it worked once before when other file. It was just a simple .x file of a 16th century house. There were a few pollys overlapping, but it at least loaded.

Quote: "Try don't make a new camera.
There is already a camera by default."

Thanks for your post, but when ever I do that a black screen shows up. The model never does.

Thanks for your patience, guys. I don't know how you guys can do thousands of these lines of code with out killing the computer screen.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Apr 2008 22:57
LOL... I've blown up many a computer screen, memory chip, harddrive, keyboard, ... funny though ... I haven't killed a mouse yet.... My Cat on the otherhand..

Um... All that jargon I was saying... Look... In windows, there is this concept of a "Working Directory".

If you open explorer, and navigate to c:\program files\SomeDirectory\ and click on somefile.exe than that program start's with its current directory set to: c:\program files\SomeDirectory\

What happens is, when you "run a Program" inside Visual Studio, the program it makes and then runs is actually two directories DOWN from the project directory! The Gotcha is that the "Working Directory" is your project's directory.. (Where your source code is)

This is why when you use eplorer and navigate to YourProjectFolder\bin\debug\ and click YourProgram.exe you just made YourProjectFolder\bin\debug\ the working directory versus YourProjectFolder.

One cheap trick... to run your app outside of Visual Studio and get it to work the same way is to literally COPY your YourProjectFolder\bin\debug\YourProgram.exe to YourProjectFolder and then click it.

Go back to the Cool/Shoot dbFileExist("Filename.x") thing though. Only when you know your program sees the file like it should, should you continue to load and try to get things to work some way or another.


Oh... and the making another camera is Whack.... something else might be going on... like... you are calling dbSync() in your look right?

Load objects before loop... um... thats all for now
gotta go

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 30th Apr 2008 23:07 Edited at: 1st May 2008 00:00
I finally got the darn thing to load. Now...for the more complex things.

This is gunna be a pain, I hope I don't get banned for how many help posts I'll end up making the next few weeks! Haha. Thanks for all of your guys help. I can finally start working on a small level.

Oh, and thanks for the post above. This gives me a much better understanding of how it all works. You've been a great help!

Login to post a reply

Server time is: 2024-09-29 19:16:14
Your offset time is: 2024-09-29 19:16:14