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 / Making my own file types????

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Nov 2008 23:36
i was wondering i know that you can make your own file type by just changing the name but how do you read it with darkbasic????????????
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 28th Nov 2008 00:17
@Caleb1994

Have you read TDK's excellent File Access Tutorial? If not, its here...

http://forum.thegamecreators.com/?m=forum_view&t=96084&b=7

That should give you some ideas
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 28th Nov 2008 00:36
ok thanks i didn't know he made that many tutorials haha
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 30th Nov 2008 14:23
Its OK, WindowsKiller. I answered that near the bottom of this thread:

http://forum.thegamecreators.com/?m=forum_view&t=140597&b=10

Quote: "
Posted: 28th Nov 2008 00:24 toggle
Well ".map" is just a file extension. It simply exists to help you quickly identify what files do what.

For instance ".doc" is generally recognised as being the file extension used by Microsoft Word. However there is no reason why you could not create a program in DarkBASIC that created ".doc" files that weren't Word documents, but something entirely different. You could write it all out as strings or as something more complicated such as bytes

Back to ".map" files, well I remember that the 3D Realms Duke Nukem 3D used the file extension ".map" for files saved in the level editor (BUILD) - no doubt these files use a different format to Halo ".map" files.

Depending on how the Halo files are formatted, you may be able to read them using read string (if all the data is plain text) or something like read byte (if the file is more complex).

Since I've not personally encountered a Halo ".map" file, I couldn't tell you what their internal layout is. Hopefully through some Googling you might be able to find some documents which show the basic layout of a Halo ".map" file.
"


So I think Caleb1994 understands the purpose of a file extension now. I skipped explaining about Windows file association as he's probably figured that one out.
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 30th Nov 2008 17:42
P.S. If you look at a .dba file in notepad, it's just a text file.

~QJ
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Nov 2008 18:16 Edited at: 30th Nov 2008 18:18
Though stating this is superfluous, if you are using Dark Edit and look in the directory where you save any of your DBC scripts, you will notice that there is a duplicate file with the extension .tmp . This is a file that is constantly updated (when you compile) as you type in your main script. That allows DB to run whatever current state your program is in without you having to save it. So, .DBA and .tmp end up being essentially the same file. DarkBASIC doesn't care, to compile, it just needs a text file (which both of these are).

Enjoy your day.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 30th Nov 2008 22:53
oh i was wondering what that tmp file was thanks guys
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Dec 2008 22:17
same as the .~db

~QJ
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Dec 2008 00:28
oh then what's the -db for? If there the same
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 3rd Dec 2008 03:12 Edited at: 3rd Dec 2008 03:20
Just from experimenting with DarkEdit, I discovered...

In the Editor Options there is a checkbox labelled "Autosave Files Before Compiling". If you check (click OK), then compile or run you program - DarkEdit generates the ".~db" file. Presumably, in case your program locks up the computer?

Also, I've noticed that if you write a script and just run it. Rather than prompt you to save, DarkEdit saves it as DARKEDIT.TMP then runs it.

I don't Adam and believe it!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 3rd Dec 2008 03:19
ya mine try's but it always says

Can't create file "Darkedit.tmp"

but thats a good geuss

Login to post a reply

Server time is: 2025-06-07 17:10:48
Your offset time is: 2025-06-07 17:10:48