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 / Saving/making files

Author
Message
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 17th Jun 2003 23:55
I am having trouble understanding a few things.

The game I am trying to create at the moment requires lots of files. Some text files, some data files, etc. Some text files need to be present from the start, others are created on the fly. If I want to create a file called 'file1' I simply type MAKE FILE "file1". What I don't understand is where will it be created on the players hardrive?

Can I create files within folders on the hardrive? For instance, what if I want text files to be saved in a folder called 'Text Files' how would I do that? Also, can somebody explain to me what the 'configure EXE settings' panel is about in DBPro....what do the media options mean?

Thanks in advance
Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 18th Jun 2003 00:11
on its own as you havewritten... it will be created in the current directory (i.e. where the exe that is running is stored).
unless you specify otherwise (i.e. give the drive letter and path(e.g. C:/program files/my crappy game thats full of bugs/file1"))

hehe joke

Info Q.&statments corect@da time of going to pres. I acept 0 responsibility for typos gramaticaly incorect txt swering or pety complant tht u hve so just piss off unles u r anserin da Q.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 18th Jun 2003 00:15
Normal EXE creates a normal exe with no media attched inside it
Small EXE and pack file creates a very small EXE and a file with .PAK extension when you add the size of them up they come to the normal exe size
Installer type EXE.....i have yet to work out
EXE with attached media is an exe that contains any media that you tell it to include using the add button in the meida pane. f you click compress attached media it will make the media take up less space (compress it) and if you click encrypt it is SUPPOSED to encrypt it or garble it up so that no hacker in the world can possibley get at your media [coughs] [img] [/img]

Info Q.&statments corect@da time of going to pres. I acept 0 responsibility for typos gramaticaly incorect txt swering or pety complant tht u hve so just piss off unles u r anserin da Q.
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 18th Jun 2003 00:20
Thanks....so I just need to include the whole path in "" when I want to save a file then?

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 18th Jun 2003 03:03
As far as I know you can use it in the same way as when you load images,objects etc.
paths are relative to the exe directory unless they have a drive letter in
"file.txt"
"textfiles\file.txt"
"c:\stuff\file.txt"

I am not sure if you can use "..\" to go back a directory. Try it yourself and see if it works.
"..\file.txt" should put file.txt in the projects directory if the exe was in /dbpro/projects/file/
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 18th Jun 2003 16:20
OK,
I in my directory where my project is currently saved, I have 3 folders:
HOME\
SYSTEM\
MESSAGES\
In each of these folders are files (text files). How do I include them in the final exe of my game? Also, during the game, new files get created and stored in these folders...will they be stored in a folder of the same name on the players HDD once he has installed my game? I am so confused....I played around with the add media button but you can only add individuals files, not whole folders

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
Bloodshot
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United Kingdom
Posted: 18th Jun 2003 16:30 Edited at: 18th Jun 2003 16:41
If you create a file using this file name:

FILENAME$="Test.dat"

It will normally be created in your Project Folder (where you have your current project open that's using it)

If you want to place it somewhere else, use the full path:

FILENAME$="C:\My Documents\Test.dat"

Check out Section 4 (File Commands) in the Online help for other useful commands like: Get Dir$, Make Directory etc...

Make Directory would need to be used like in the example below if you want to create sub-directories within other directories, where none exist in the first place: (i.e. You can't do the third command without executing lines 1 and 2 first!)

FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 18th Jun 2003 16:42 Edited at: 18th Jun 2003 16:43
OK, I'm not being very clear here:
When I have finished making my game and start to distribute it, how does it install? I get the impression that there is just 1 exe file and thats it....no game folder, no nothing. I wonder if it is possible to create a game folder when the player installs my game. That game folder is where I want these folders and files to be created during runtime. I say this because the game creates a folder (its title being that players username) and in that folder creates files and folders relevant to that player. If the player starts another new game with a different username, the game will create another new folder (this time titled with the new username) and in THAT folder saves the files relevant to that user.
Does that make sense? I'm fairly comfident with making files, etc but I am not sure about what happens once the game is stuck on a CD for instance and shipped to people!! Its all well and good saving it in my projects file whilst i'm coding!

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
Willy
23
Years of Service
User Offline
Joined: 17th Jun 2003
Location: Ohio
Posted: 18th Jun 2003 20:19 Edited at: 18th Jun 2003 20:28
Something has to copy your distributed game from the CD, including your .EXE file.
If the purchaser uses Windows Explorer to copy the files to a folder,
then that's where they are going to go.
Which is why most software distributions include a "Setup.exe" file.
The Setup program is what creates folders, and copies files.
You can do that with DarkBasic Pro - NOT in your game EXE file! (You can, but you really need a separate program to do the copy and install.)
Or, you can write the installer with Visual Basic, or C, or C++.
Or, you can find freeware/shareware/commercial installers on the Internet. (Such as InstallShield)
Or - you can include a "Readme.txt" file on the CD, and tell your user how and where you want things copied.
Or - you can use PKZip or maybe even WinZip to Zip everything up for your distribution. Those packages have the ability to create folders, and put files into those folders on the install drive.

If you want to get really tricky, look at creating a file to do "Autorun", so the user doesn't even have to find, or click on "Setup". (I'm sure you have done this many, many times!) DBPro isn't any different than all the other software packages out there, (not just games)....

Unfortunately, there isn't an "install" button that does all that for you. Like many other things, it's kind of a "do it yourself" kit...
[b])

Willy
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 18th Jun 2003 20:52
Thanks Willy, just what I was looking for. One more thing...what does the 'Installer type EXE' option in the project settings tab do? I clicked it and then ran the EXE but nothing happened.

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 20th Jun 2003 14:37 Edited at: 20th Jun 2003 14:51
Well thats obtrusive to use absolute path in that manner...
If you are making a game, you want to use a relative path.
Unless of course you want the added feature of detecting the directory you are under...

if path exist("dorner")=0
make directory "dorner"
endif
wait key
cd "dorner"
print "in dorner"
wait key

Better questions:
-How; without using RGT zip tools (because some of us bought from darkbasicpro.com) kinda makes me wish I had a "tooth fairy" (officially)
-How do we install the game to a specific folder in the program files and add it to the program files and windows user directory?
using the
windir$()
if path exist("profiles")?
-How do I get my program into the proper current profile user name?

My guess?
Third party, not RGT, because they won't even sell the zip tools.

Login to post a reply

Server time is: 2026-07-11 14:55:00
Your offset time is: 2026-07-11 14:55:00