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 / Some help with BlueGUI and loading .x files?

Author
Message
Yodaman Jer
User Banned
Posted: 1st Jul 2010 02:11
Hey everyone,

so I've gotten pretty far along in my level editor (as far as one can get without loading/editing objects), and I've managed to start using BlueGUI to help the editing process along (and make it easier to load/save level and project files without messing about with the "input" command), but I've come across one small problem.

Currently I'm using the OpenDialog() command to open to my models folder to try and load a specific object into the editor. Here's the code I'm using for it:



I might be missing something obvious, but to my eyes it looks like it should work. Right? What happens is NOTHING. I don't get an error, it's like the program doesn't even touch the bit about "Load Object FilePath$...". It just seems to skip over it and ignore it completely, going back to my blank level editor screen.

Also it should be mentioned I've been using BlueGUI for no longer than a day. But it's fairly easy to use and dog gone it, this should work. I did a small test earlier with loading a level file with the OpenDialog() command and it worked perfectly. But that was with native primitive objects of DBP's, and not an .x file....

Can anyone help with this please?

Thanks in advance!

-CoffeeCoder

Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 1st Jul 2010 02:41


Give that a try, although I really can't be 100% sure without some more source code.

Good luck

Yodaman Jer
User Banned
Posted: 1st Jul 2010 02:48
Had to modify it a bit more (had to turn it into a function). Now I'm getting a "File doesn't exist" error, so I know it's at least acknowledging that part of the code now.

It stops on the "Load Object FilePath$" line. Weird. I was having trouble with this earlier too, where it wouldn't let me load an object through a string variable. Heh.

Thanks for your help! You definitely solved the first part of the problem.

Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 1st Jul 2010 02:59
If you allow me to see your source code I could help weed out the issue (if you do be sure to remove your BlueGUI ID and password).

Yodaman Jer
User Banned
Posted: 1st Jul 2010 03:05 Edited at: 1st Jul 2010 03:12
Sure, here ya' go:




EDIT:

You'll notice I tried to load the object through the standard means. It didn't work. Oh well.

Still can't figure out for the life of me why it wouldn't load it through means of the FilePath$ variable...strange bugs are annoying.

Hockeykid
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 1st Jul 2010 03:18


That should do it

Yodaman Jer
User Banned
Posted: 1st Jul 2010 03:44 Edited at: 1st Jul 2010 03:48
Nope.

thanks for the help so far, though. Just a quick question; why does the number have to be 14 in the Path$=Right$(FilePath$,14) bit of code? Isn't it only counting up to 14 characters then, when it should be 20 ("Level Editor\Models\" is 20 characters long)? Or am I misunderstanding that completely?

EDIT:

AHA! Found the cause of the bug...it shouldn't have had anything to do with it, but whatever...

You may have noticed this odd bit of code...

While Plat1=1
Plat1=Plat1+1
EndWhile

What that's supposed to do is give the loaded object a number, and it checks (before the object is created) if there's a random available ID from a previously deleted object.

However, it's supposed to read like this:

Plat1=1
While Plat1=1
Plat1=Plat1+1
EndWhile

Somehow, that caused the program to crash and give a "File Doesn't Exist" error. Heh.

So now that's solved I guess. thanks for the help!

TyJBr2
AGK Backer
16
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 1st Jul 2010 03:55 Edited at: 1st Jul 2010 03:56



That works for me to load models.

Plat1=1
While Plat1=1
Plat1=Plat1+1
EndWhile

Would make Plat1 = 2
Yodaman Jer
User Banned
Posted: 1st Jul 2010 04:01
Huh.

*looks at old editor code from his editor of a few months ago*

....Ooooh.....


THAT'S what it's supposed to look like...not the other way around.

*tries out*

Yup, that works. It needs to look like the code above, but with "Plat1" instead of "BlockCount".

Thanks for helping me clear out the confusion on that. I don't think I should have tried this when I got little sleep last night and am currently running off of four cups of coffee and have been programming this thing all day...>.>

Clonkex
Forum Vice President
16
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 28th Jul 2010 06:51
Hey Guys,

Where do you get BlueGui? Download it, I mean. I can't find it anywhere.

Thanks,
Clonkex

Making games is easy.....finishing them is a different matter.

Intel Core 2 Duo 2.8Ghz, Nvidia GeForce 9400 GT 512mb, 1gb ram.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield

Login to post a reply

Server time is: 2026-07-25 05:32:45
Your offset time is: 2026-07-25 05:32:45