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 Discussion / Save object made in Darkbasic?

Author
Message
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 5th Feb 2007 18:30
Is it possible to save an object I made in darkbasic using limbs to an 'x' file? By the way I haven't got the enhancment pack.

I can see you...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Feb 2007 23:03 Edited at: 5th Feb 2007 23:12
Hi Nano,

There isn't a direct command to save an object in DBC that I'm aware of. And without the enhancement pack, your options even become more limited. But don't abandon hope, there are alternatives if you are willing to put in the effort. The method I'm going to describe is for using the object within DBC only. It doesn't allow you to save a .x file for use with another program.

You could write a custom routine that saves information in a file according to your own specifications. For example, if you were building an object in DBC and you used a command like MAKE OBJECT SPHERE 1,25 , the idea is to save to a file the information to make a sphere, and then be able to read that back from the file and have DBC create that object.

You don't have to specifically save the words "MAKE OBJECT SPHERE blah blah blah..." but you might save a shorthand version that you and your file decoder would understand. Maybe something like 's,1,25;' which when read back, your read routine would decifer that into the instruction to make a sphere, object 1, size 25. With a similar method, you could add any parameters, and any functionality that you could hardcode by hand directly.

If you made an object that had limbs, you could save in your file using the same exact methods that you used to create the object and the limbs. Then read that back and have DBC create that object.

so if you made a limb from a mesh : O,1,M,1,L,1; might translate into make mesh 1 from object 1 and create limb 1 from that mesh.

The whole method hinges on the ability to read back the command and translate it into code that DBC can use. Here's a very basic example



Now, as you add parameters to your custom commands, you would have to find ways of separating the values out of the strings. That's not too hard if you use separators ( like commas for example ) and terminators ( like a semicolon for the end of a line ).

Enjoy your day.
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 8th Feb 2007 11:13
thanks.

I can see you...

Login to post a reply

Server time is: 2025-05-26 03:23:17
Your offset time is: 2025-05-26 03:23:17