Hello.
I made a map editor. For some reason the game only seems to save the map data when I run it from inside DarkBasic Pro. If I run the EXE nothing shows up in the file it should be saving to. I did not move the exe outside of the project folder.
function savemap()
`get name from user
clear entry buffer
repeat
a$=entry$(1)
box (screen width() / 100) * 30,(screen height() / 100) * 30,(screen width() / 100) * 70,(screen height() / 100) * 70,RGB(0,0,128),RGB(0,0,128),RGB(0,0,128),RGB(0,0,128)
center text screen width() / 2,(screen height() / 100) * 40,"type save name"
center text screen width() / 2,(screen height() / 100) * 50,a$
sync
until returnkey()=1
set dir "saved maps/"
If File Exist(a$ + ".dat")=1
delete file a$ + ".dat"
Endif
open to write 1,a$ + ".dat"
`save map spacific data
write string 1,str$(mapmakerdata(0))
write string 1,str$(mapmakerdata(1))
write string 1,"breake"
`copy objects array
`save tile data
for y = 0 to mapmakerdata(1) - 1
for x = 0 to mapmakerdata(0) - 1
write string 1,str$(mymap(x,y,0))
write string 1,str$(mymap(x,y,1))
next x
next y
write string 1,"brake"
`write down how big the items array is
write string 1,str$(items(0,0))
`save object data
if items(0,0) > 0
`tell game there is stuff to load.
for a = 1 to items(0,0)
for c = 0 to objectarrayslots
write string 1,str$(items(a,c))
next c
write string 1,"write ai"
NEXT a
endif
write string 1,"now saving phase data"
`save phase data
for a = 0 to 40
write string 1,str$(phase(a,0))
write string 1,str$(phase(a,1))
write string 1,str$(phase(a,2))
NEXT a
close file 1
cd ".."
ENDFUNCTION /////////////////////////////////////////////////////////////////////////////////////////////
thanks