world
view = 5
turf
icon = 'Turfs.dmi'
grass
icon_state = "grass"
background
title
icon = 'title.png'
density = 1
black
icon_state = "black"
obj/New
icon='newgame.png'
Click()
usr.loc = locate(2,2,2)
obj/Load
icon='loadgame.png'
Click()
Read(var/savefile/F = new())
obj/Delete
icon='delete.png'
Click()
Write(var/savefile/F = del())
mob/Logout()
Write(var/savefile/F = new())
...I got these errors:
main.dm:24:error:var/savefile/F:undefined var
main.dm:28:error:var/savefile/F:undefined var
main.dm:28:error:del :empty argument not allowed
main.dm:28:error::missing expression
main.dm:30:error:var/savefile/F:undefined var
what's wrong? What I want to do (you probably know) is to make 3 buttons on the title screen. New game, continue and delete. I've seen naruto games do it and stuff so I know it can be done. Did I misstype something or is there a better way to do this.
Well, first let's go over the path names. Don't use obj/New, because there's already a New() proc and this is gonna screw you up. Change it to obj/NewCharacter or such.
Now for the individual problems:
<font color="red">> main.dm:24:error:var/savefile/F:undefined var</font>
You're doing three things quite wrong here.
So really, you need to look up how to use savefiles.
<font color="red">> main.dm:28:error:var/savefile/F:undefined var
Some of the same problems are here, but there are brand new ones. As the compiler told you flat-out, you can't call del() without telling it what to delete. No, this does not tell it to delete a savefile. You may notice it doesn't say anywhere which savefile to delete, and even so you'd need to use fdel() for that. del() is for deleting objects in memory, not files.
Also, it's clear that you shouldn't be calling Write() here at all, since your goal is to delete, not save. And to save, you shouldn't be calling Write() directly.
<font color="red">> main.dm:30:error:var/savefile/F:undefined var</font>
Again the F var isn't initialized properly, and you shouldn't be calling Write() directly.
Lummox JR