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.

Newcomers DBPro Corner / making my own file types

Author
Message
Kivu_Rako
20
Years of Service
User Offline
Joined: 10th May 2004
Location:
Posted: 2nd Nov 2004 04:24
ok. i want to make my own file types in DBP, like every game does, they make their own files. i dont want my save files to be .txt, so how would i make them my own file? like a .TLGS file or anything?
i've wondered about this for a while. i know games created with dbp have their own file save types and file types. So is this a plugin or a series of commands i havent put together?

thanks in advance.

"geez, its probably a noobish mistake too!"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd Nov 2004 05:40
just name it to whatever extension
then you write the data, read the data with whatever programmatic mechanism you like (text, binary, morse, whatever)


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Kivu_Rako
20
Years of Service
User Offline
Joined: 10th May 2004
Location:
Posted: 2nd Nov 2004 06:37
what do you mean?
like
"
string$=str$(rnd(100))
set cursor 1,1
print "new string: ";string$
if file exist("myfile.lgs")=1
open to read 1,"myfile.lgs"
read string 1,oldstring$
print "old string: ";oldstring$
else
print "no old string"
make file "myfile.lgs"
open to write 1,"myfile.lgs"
oldstring$=string$
write string 1,oldstring$
endif
wait key
"
because that doesnt work for me. what am i doing wrong?
p.s. i have never worked with files, so help is much appreciated

"geez, its probably a noobish mistake too!"
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 4th Nov 2004 10:50
Hope this help



You can do it if you try
Teh Missingz0rs
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United Kingdom
Posted: 4th Nov 2004 18:00
Y'see, the file extentions don't actually matter... You could just save a file as "FILE" if you wanted to.

<a href="http://modcamera.mrdictionary.net">MoDCAMeRa</a>
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 6th Nov 2004 05:17
when you use open to write, just specify a filename with whatever extension you want, e.g.


the .EXT i put stands for extension, but you could use any extension, standing for anything. e.g.

.msf - my save file
.dec - my initials
.mum - cos i love my mummy
.pfs - pink fluffy scarves(my granny knits them)
.ygp - you get the picture



Part of solving the problem is actually noticing that the problem is there in the first place

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Nov 2004 06:44
.ygTp

you're not limited to 3 spaces


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Kivu_Rako
20
Years of Service
User Offline
Joined: 10th May 2004
Location:
Posted: 6th Nov 2004 12:08
thanks for all the help guys, i wasn't using the open to write or open to read commands right. I appreciate the help, as now my games save files are .lgs! so hopefully nubs wont realize they can open it with wordpad and change their save files....

"geez, its probably a noobish mistake too!"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Nov 2004 20:33
they'll figure it out, especially since you announced it here


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Teh Missingz0rs
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United Kingdom
Posted: 7th Nov 2004 00:32
This is where you learn about the wonderful art of encryption.

If you wanted to keep a word hidden in a save file, for example, you could get a string (Say, "APPLE") and break it into seperate characters (using a FOR loop) and then write the ASCII value for each character to a file.

<a href="http://modcamera.mrdictionary.net">MoDCAMeRa</a>
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 7th Nov 2004 01:27
^Bad^

Shift the ASCII values and modify the positions of the charecters in the string.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Teh Missingz0rs
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United Kingdom
Posted: 7th Nov 2004 02:13
I think Ilya works for the FBI computer security division.

<a href="http://modcamera.mrdictionary.net">MoDCAMeRa</a>
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 7th Nov 2004 03:33
lol @ Teh Missingz0rs

HOw exactly would you modify the positions? WRite it back at like, (rnd) positions? I remember seeing this somewhere...

AMD Athlon XP 3000+, S3 Deltachrome s8, 512 PC3200 RAM, 160 GB HD
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Nov 2004 04:23
you could use an offset but youd have to store that somewhere and if you think the exe is safe your kidding yourself. Also ascii offset will be broken in 2 seconds. You may deter the noobz0rz but anyone determined to break that will. Mnem was experimenting with fairly decent encryption that went well beyond ascii offset and challenged this forum to break it, and people did, fairly easily, I havent used a period in quite a bit, maybe I will soon, or not, hmmm, ok, here's one.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Teh Missingz0rs
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United Kingdom
Posted: 7th Nov 2004 23:39 Edited at: 7th Nov 2004 23:42
DB is hardly uncrackable.

I made a simple 2D game a while a go, and gave a BlitzBasic friend an EXE copy.

He gave it back to me a few days later, after rearranging the grid of every level to spell TOM SUX and changing the credits to read "Learn Blitz2D, it's better".

<a href="http://modcamera.mrdictionary.net">MoDCAMeRa</a>
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 8th Nov 2004 04:21
You can make your own type of file with my encryption algorithm in the codebase. The title in the codebase is called "Fool proof encryption". With that encrytpion system no one can open your file unless the have the proper seed value.The system works by replacing the bytes with different bytes and you can specify the extension you want.


Click the sig
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 8th Nov 2004 11:58
Another useful method of encryption is to have certain characters you know you won't use and add those to make it look all jumbled, then ignore them when it comes to reading them.

Song of the whenever i feel like updating it....
Where dead bullies go, by Sugarplastic
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 10th Nov 2004 04:34 Edited at: 10th Nov 2004 04:36
Quote: "Another useful method of encryption is to have certain characters you know you won't use and add those to make it look all jumbled, then ignore them when it comes to reading them.
"


So in other words what you are saying is:

Suppose this is the file:


How you would encrypt it would be
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thﮒ◊▫╘║≥♫┬ese arỈỬẨểỵ‾e thکỉẺ۹٪ى۵٧٣e DaתףהبґѓҰшжбуrkBASГЇЋЎцгдҒӨIC foПЏυτΣΏБπΧΦrums
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[edit]Since the characters didn't show up correctly the second file example does not have code tags so the characters are shown.[/edit]

Could you tell me how you would *cough* decrypt *cough* this file. And how this file would not be used or read by others. Because encryption is to make the data unreadable to the human eye, and so the data is only visible to the people who know how to decrypt the file.

For more information do a search in the general forum and search for the term "encrypt" with no quotation marks. And then click on cattlerustlers thread, and then if you want you can click on other threads as well.


Click the sig
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Nov 2004 16:28
why encrypt? Just write the data as bytes and not strings. Makes editing the file in notepad kinda hard. Not exactly the most secure, but it makes editing it without knowing the format a real pain in the arse.

"eureka" - Archimedes
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 11th Nov 2004 20:13
Quote: "Not exactly the most secure,"


But encryption is all about being secure, you are trying to get so nobody can access the file with out proper authorization.


Click the sig
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 11th Nov 2004 23:44
Well, what im saying is, have a certain select few characters put off to the side. So, if you wanted to encrypt "Hello World", and you put aside the letters i,k,q,c, and p. Now you could write it as "Hikellcop Wkoiiqrpkqd" Then when you go to read it, you set it to ignore i,k,q,c, and p. Do you understand?

Song of the whenever i feel like updating it....
Where dead bullies go, by Sugarplastic
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Nov 2004 05:22 Edited at: 12th Nov 2004 05:26
we ought to have a AI bot that plants thes posts at the bottom of the appropriate thread since they come around every few weeks, just make your own file extension up to idebtify the file to your program and so it knows that .sav is a savegame and .map is a levelmap etc, you can use bytes or strings or whatever you like, just read em back in the same order as what you wrote em, as for encryption, heres a simple example app that encrypts a bitmap into a .xxx file (an own named filetype), you can`t read the bitmap unless you have the key, for more security you could encrypt it several times with different keys, that way the complexity increases by the power of whatever number range you use for each pass....



Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 13th Nov 2004 02:12
The code that mentor posted is what I built my encryption system on. But I modified it so they are functions rather than a complete program. And right now I am working on a way to make programs only able to be run if the drive serial number with encryption is present, if the drives serial is not found the file will just shut down.


Click the sig

Login to post a reply

Server time is: 2024-11-11 21:22:46
Your offset time is: 2024-11-11 21:22:46