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 / savegame not saving as name

Author
Message
Daniel wright 2311
User Banned
Posted: 28th Nov 2011 21:00 Edited at: 28th Nov 2011 21:01
name$+"savegame\.dat is not saving as name$+"savegame\.dat
it is just saving as .dat with no name at all. in the input i put my name as input name$, so my function should save the file as the name i put into the input .dat,so what am i doing wrong?




my signature keeps being erased by a mod So this is my new signature.
Westmere
16
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 28th Nov 2011 21:09
You are basically saving your game in a directory called name$+"savegame" with the filename ".dat".

You need to get rid of the "\" that will save it in your current directory with the filename name$+"savegame.dat"

If you intend to save it to a directory named savegame with the name name$+".dat" you need to use this form: "savegame\"+name$+".dat"


nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 28th Nov 2011 21:12
you need to change this

FUNCTION SaveGameobjects()

to this

FUNCTION SaveGameobjects(name$)
Daniel wright 2311
User Banned
Posted: 28th Nov 2011 21:17 Edited at: 29th Nov 2011 21:11
this did not work, it was saving the file in the right dir in the first place but it will not name it at all, i did try your way to thinking mabey but it still saves as a empty name.

my signature keeps being erased by a mod So this is my new signature.
Daniel wright 2311
User Banned
Posted: 28th Nov 2011 21:23
Quote: "you need to change this

FUNCTION SaveGameobjects()

to this

FUNCTION SaveGameobjects(name$) "


This works now,I should have seen it,thanks for helping my friend.

my signature keeps being erased by a mod So this is my new signature.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Nov 2011 02:22
Hope I can get more light in ths save game area... os it as simple as this... how about using ini files?

Daniel wright 2311
User Banned
Posted: 29th Nov 2011 21:01
Quote: "Hope I can get more light in ths save game area... os it as simple as this... how about using ini files?"


Dark basic pro understands many diffrent file types,ini and or dat files are the most common for us.It is very simple to save and load anything at anytime,even arrays,whole arrays of info with just save array command.

my signature keeps being erased by a mod So this is my new signature.

Login to post a reply

Server time is: 2026-07-10 03:58:52
Your offset time is: 2026-07-10 03:58:52