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.

DarkBASIC Professional Discussion / Load Object Problem

Author
Message
Trancos
22
Years of Service
User Offline
Joined: 1st Dec 2003
Location:
Posted: 1st Dec 2003 18:07
In DBP when i use [Load Object "walk.x",1] shows Cant Load File!! but the file IS in the directory, the same program runs OK in Dark Basic 1.13

Thanks
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 1st Dec 2003 18:35
What 'upgrade' of DBP are you using?
Can you show a snippet so we can deduce potential problems?
Can you upload the model for us to confirm it is a valid model?

You could try re-exporting the model from another program/exporter to change it's file format, it could be an .x format incompatability as unfortunately .x doesn't just meen one format, it meens binary/ascii/binary compressed in dx 9, dx 8, dx 7 .... varieties. Oh then there's the bone or keyframe formats, the open or closed.....


God created the world in 7 days, but we're still waiting for the patch.
Trancos
22
Years of Service
User Offline
Joined: 1st Dec 2003
Location:
Posted: 2nd Dec 2003 05:26
In the example if i remove the line [Load bitmap] the program works ok, but with it i only see a black screen.....the directory is the right one.....

load bitmap "foliage.bmp",1
MAKE OBJECT CUBE 1,100
DO
YROTATE OBJECT 1,OBJECT ANGLE Y(1)+0.1
LOOP
Jaze
22
Years of Service
User Offline
Joined: 20th Nov 2003
Location: Connecticut, USA
Posted: 5th Dec 2003 11:57
Solution: Put in the full path!

Lame? I know I know - it doesn't change to the directory you're working in in all circumstances. I haven't got it nailed down exactly the rule - I THINK it has to do with how the editor behind the scenes is using a temp directory while building - so the Current directory isn't where you think it should be.

I simply do this in all my test apps (as thats all I'm doing so far):

`----TOP--------
GLOBAL ROOT$ ` or path or dir whatever
ROOT$="e:\files\media\"

` blah blah

load object root$ + "xfiles\myxmodel.x" ` or whatever

This technique is simple - I know - but it works and this way all you have to do is comment out the root$="e:\files\media\" in your final build providing the media and file structure is the same as it was... Or as your code looked - drop it all together because your media files are in the same dir as your program. When you click on your program's icon or launch from explorer it will set that directory as the working directory. Note Window shortcuts and "pif" (program information Files...basically glorified shortcut) can be modified so the working directory is not like you'd think but thats another matter - and I'm sure you can see what I mean if you right click properties of any shortcut on your desktop

-=/Jaze/=-

Login to post a reply

Server time is: 2026-07-26 20:14:35
Your offset time is: 2026-07-26 20:14:35