createfile? Any commands like this for creating a file?

Previous topic - Next topic

MrTAToad

Does the file already exist ?  If so, you will need to delete the file first.

Ian Price

Quote from: MrTAToad on 2010-Feb-14
Does the file already exist ?  If so, you will need to delete the file first.

No you don't. You can save over a file at any time. I've made multiple map/level editors and never had to delete previously saved data.

Not received email :( Can you try mrijprice AT googlemail DOT com or iprice AT supanet DOT com again.
I came. I saw. I played.

Amon

Hi, Just sent the project again. for some reason it won't let me send the zip file so i renamed the extension. Just rename the extension to zip when received.

Thanks for all the help. :)
- http://www.amon.co | Dev Tools - BlitzMax - Shiva Unlimited - Unity Pro - Carrara 8 Pro - Hexagon 2.2.5 - Blacksmith 3D Paint - FuturePaint Pro - Bryce 7 Pro.
I'm never wrong at all; I just discover 1000 ways that don't work!

Ian Price

Ok. Got the file and i see exactly where the problem lies.

You've used
Code (glbasic) Select
SETCURRENTDIR("Media") // seperate media and binaries?
at the start of your program, but when saving you use -

Code (glbasic) Select
LOCAL file$ = "..Media/data"+level+".map"

Remove the "...Media/" bit, as you've already specified the current folder.

Use -
Code (glbasic) Select
LOCAL file$ = "data"+level+".map"
and it works fine :)
I came. I saw. I played.

Amon

Arrrggggghhhh! :)

Thanks so much. So simple, yet drove me so mad. :D  :booze:
- http://www.amon.co | Dev Tools - BlitzMax - Shiva Unlimited - Unity Pro - Carrara 8 Pro - Hexagon 2.2.5 - Blacksmith 3D Paint - FuturePaint Pro - Bryce 7 Pro.
I'm never wrong at all; I just discover 1000 ways that don't work!

Ian Price

BTW Separate post for separate assistance

You can replace this whole section of code
Code (glbasic) Select
FOR xi = 0 TO mapwidth-1
FOR yi = 0 TO mapheight-1
IF map[xi][yi] = 0 THEN DRAWANIM 0,0,xi * 50, yi*50
IF map[xi][yi] = 1 THEN DRAWANIM 0,1,xi * 50, yi*50
IF map[xi][yi] = 2 THEN DRAWANIM 0,2,xi * 50, yi*50
IF map[xi][yi] = 3 THEN DRAWANIM 0,3,xi * 50, yi*50
IF map[xi][yi] = 4 THEN DRAWANIM 0,4,xi * 50, yi*50
IF map[xi][yi] = 5 THEN DRAWANIM 0,5,xi * 50, yi*50
IF map[xi][yi] = 6 THEN DRAWANIM 0,6,xi * 50, yi*50
IF map[xi][yi] = 7 THEN DRAWANIM 0,7,xi * 50, yi*50
IF map[xi][yi] = 8 THEN DRAWANIM 0,8,xi * 50, yi*50
IF map[xi][yi] = 9 THEN DRAWANIM 0,9,xi * 50, yi*50
IF map[xi][yi] = 10 THEN DRAWANIM 0,10,xi * 50, yi*50
IF map[xi][yi] = 11 THEN DRAWANIM 0,11,xi * 50, yi*50
IF map[xi][yi] = 12 THEN DRAWANIM 0,12,xi * 50, yi*50
IF map[xi][yi] = 13 THEN DRAWANIM 0,13,xi * 50, yi*50
IF map[xi][yi] = 14 THEN DRAWANIM 0,14,xi * 50, yi*50
IF map[xi][yi] = 15 THEN DRAWANIM 0,15,xi * 50, yi*50
NEXT
NEXT


With this -
Code (glbasic) Select

FOR xi = 0 TO mapwidth-1
FOR yi = 0 TO mapheight-1
DRAWANIM 0,map[xi][yi],xi * 50, yi*50
NEXT
NEXT
I came. I saw. I played.

Amon

That's a nice tip, thanks! :)

Really do appreciate it. Now to get on with my game. :) Ta!
- http://www.amon.co | Dev Tools - BlitzMax - Shiva Unlimited - Unity Pro - Carrara 8 Pro - Hexagon 2.2.5 - Blacksmith 3D Paint - FuturePaint Pro - Bryce 7 Pro.
I'm never wrong at all; I just discover 1000 ways that don't work!