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 / help with save/load!

Author
Message
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 6th May 2005 09:08
i am making a snowboarding game but cannot figure out how to save and load for the story. none of the tutorials or examples have helped.

if you help, your name will (if you want) be included on the game when i sell it.

thank you!!!!!

program 'till your brain comes out your ears, and never give up.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th May 2005 20:41
To store it in a file:

for example:



and to load the data you just stored:



Every time you use the "open to write" command, it will create a new file in your current directory. Wich means you will need to delete it every time you want to save the data.
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 7th May 2005 07:52
thank you!!!!!!!!!!!

however, being the beginner that i am, i'll need to know how to delete a file... heh heh..........

program 'till your brain comes out your ears, and never give up.
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 8th May 2005 00:32 Edited at: 8th May 2005 00:32
To delete a file just type:

I think that should work.
Any way good luck with your game!!

Cheers,
Capt. America
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 8th May 2005 00:34
Also I have a very quick question.
What does a float actualy do?
What kind of file is it?

Cheers,
Capt. America
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 8th May 2005 02:30
thank you!!!!!!!!!!!!!!

if you want your name on the game, e-mail me (you dont have to if you dont want to)

by the way: i have no clue what a float is.

tell me (by post) if my e-mail doesn't work or show up. I might have misspelled...

program 'till your eyes get glazed over, and never give up.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th May 2005 20:37
a float is a decimal. for ex: 0.2536 or 123.456.
At least that's what i think...
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 10th May 2005 07:48
hey!!!!!!!!!!!!!!!! how come my e-mail address didn't show!?! hmmmmmm.......
thanks anyway, i'll try with the e-mail again.....

program 'till your eyes get glazed over, and never give up.
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 10th May 2005 07:50
so thats what a float is. I thought it was some kind of bitmap....

program 'till your eyes get glazed over, and never give up.
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 10th May 2005 09:05
another question. i'm also working on a game for the puzzle compo, but i need to know how to do certain collision.
like this:
if object collision (1,31)
gosub crud (a badly named subroutine)
endif


i already have the basic collision worked out, but this is confusing.

program 'till your eyes get glazed over, and never give up.
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 11th May 2005 09:24
also:
i'm so dumb. my e-mail was here the whole time!!!!!!!!!!!

program 'till your eyes get glazed over, and never give up.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 11th May 2005 10:31 Edited at: 11th May 2005 10:32
Did you also know that there is an "edit post" button? What exactly are you trying to do with your collision? You need to be more specific. Are you confused with how subroutines work or are you trying to write a collision routine?

KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 11th May 2005 11:27
2 things:
one: i know about the edit post button; i'm not that new
two: i already have the normal collision on, so the stuff is solid, but this one doesn't work. it isnt gosubbing crud like it should.

program 'till your butt falls off, and never give up.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 11th May 2005 12:08
Quote: "one: i know about the edit post button; i'm not that new"

Then why didn't you use it?

I can see two reasons your gosub isn't working.
1: Your If condition never turns out to be true
2: You don't have a return at the end of your gosub.

A little code would really help me to help you.

KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 11th May 2005 12:20 Edited at: 11th May 2005 12:34
okay. here is what it is. if you need more, say so.
this same coding except it has collision data worked last time.

you said: a little code. if you need more, say.
a little specifications would help me help you help me.
ps:
i've edited this 4 times!!!!!!!!!!

pps: my IF is true. (i've edited 5 times!!!!!!!)

ppps: the full code will come soon. (i have edited 6 times!!!!!!)

program 'till your butt falls off, and never give up.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 11th May 2005 22:21
I'll definitely need more than that. All I can tell from that is that if object 1 collides with object 31 then to gosub crud. But I have no way of telling if object 1 and 31 will ever collide. At least I need the "crud" subroutine.

Oh, and congratulations on figuring out the edit button, lol.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 11th May 2005 23:19
Make sure you close an open file before trying to delete

Good lcuk with the game!

[url=www.lightningstudios.co.uk][/url]
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 12th May 2005 05:22
ok. ill do that as soon as i can. but it might take a few days, cuz i have access to about 5 computers. 1 is a pc. the pc is the only one [/u]without internet access. except about once a week, when im near its air port. it might take a few days.

program 'till your butt falls off, and never give up.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 13th May 2005 00:22
I wrote some tutorials for saving and loading game data, you can check them out if want. Here's the link:

http://www.freewebs.com/underworld1020/tutorials.htm

KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 13th May 2005 09:18
thanks.

program 'till your butt falls off, and never give up.
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 13th May 2005 09:31
awesome tutorial. i am just confused about 1 thing; how do you save programming? like a lot. not just 1 line.

program 'till your butt falls off, and never give up.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 13th May 2005 10:15
I'm not sure if I get what you mean...like saving the actually code that you wrote in DarkBasic?

KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 16th May 2005 05:15
yeah. and load it to make it run or something. but i dont really need that right now, so dont worry.

program 'till your butt falls off, and never give up.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 16th May 2005 21:14
Well, if you want to make your project into a .exe file, then all you do is go to file, then make final. This will create a .exe file that contains everything that your project uses including the code. And you can run this file anywhere even if you tried to run it on someone elses computer it would still run.

KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 17th May 2005 08:00 Edited at: 2nd Jun 2005 09:28
ok.... but then i would have a problem. if people wanted to get the game on their desktop, they would see the .exe. if they were stuck on 1 part, they could skip it. then, it would look rrrrreeeeeeeaaaaaaalllllllllyyyyyyyy cheesy. unless i put it in a seperate folder, i couldn't do that.

ps: hyrichter, the full code will be here in about 5 min.

pps: make that about 5 weeks. but, i think that i have figured out that collision.

ppps: Underworld, i mean like in dude the snowman, or riftspace, or every single commercial quality game in the universe.

EDIT: YAYYYYYYYYY!!!!!!!!!!!!!!!!!!!! IVE FIGURED OUT ALL THIS STUFF!!!!!!!!!!! wheeeeeee!!!!!!!!!!!! yay!

program 'till your butt falls off, and never give up.

Login to post a reply

Server time is: 2025-05-23 02:20:45
Your offset time is: 2025-05-23 02:20:45