Custom filename endings (*.sav, *.lvl, *.gam, etc.)

Jatopian
09-06-2003, 05:33 PM
Hello, I have a problem.

I have seen many games that save files in a unique format, (e.g. *.sav, *.lvl, *.gam, etc.) and I was wondering how this was done. Do i simply save a text document with the new three-letter filename ending, or is it more complicated than that?

Can someone tell me how to do this?

-Jatopian

SnakeChomp
09-06-2003, 05:41 PM
Its as easy as saving a file with what ever extension you want to save it with. All files simply contain binary information, what you name them has no effect on what is stored inside. So yes it is basically just a file with a different ending. You can use VB's file commands (Open, Close, Put, Get etc) to make, put stuff into, and get stuff out of your own type of file.

Jatopian
09-06-2003, 05:48 PM
Its as easy as saving a file with what ever extension you want to save it with. All files simply contain binary information, what you name them has no effect on what is stored inside. So yes it is basically just a file with a different ending. You can use VB's file commands (Open, Close, Put, Get etc) to make, put stuff into, and get stuff out of your own type of file.
Thank you very much!

I suspected that was the case, but my logic centers are on strike right now. :p

Will I still be able to access the file with Word, Notepad, etc.?

-Jatopian

SnakeChomp
09-06-2003, 05:51 PM
Notepad can techincally read anything, but if the data contained in the file is not text, you won't get anything legible out of notepad. Same for word. If you take a .doc file and call it .xyz, word can still open it because it is formatted properly for word. If you take some file something.xyz with random data in it word obviously wont be able to open it.

Jatopian
09-06-2003, 06:24 PM
Notepad can techincally read anything, but if the data contained in the file is not text, you won't get anything legible out of notepad. Same for word. If you take a .doc file and call it .xyz, word can still open it because it is formatted properly for word. If you take some file something.xyz with random data in it word obviously wont be able to open it.

ok good thank you

4d5e6f
09-06-2003, 07:22 PM
how do you make the data appeared scrambled so that people cant simply change their settings in wordpad or notepad? encrypt it?

SnakeChomp
09-06-2003, 07:24 PM
Put your data into a user defined type, and save that user defined type to the file. Notepad wont be able to read it since its not text data (by read I mean output anything meaningful)

blindwig
09-07-2003, 12:30 AM
Put your data into a user defined type, and save that user defined type to the file. Notepad wont be able to read it since its not text data (by read I mean output anything meaningful)
Note that if your UDT contains strings, they will be readable in the file.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum