ID:148830
 
The following code is errored:

turf
TitleScreen1
icon = 'surround.dmi'
density = 1
TitleScreen2
icon = 'surround.dmi'
icon_state = "spawn"
New
icon = 'New.bmp'
Click()
switch(input("What engine do you want?","Engine","b1") in list("Battle1(standard)","Battle2(Advanced)"))
if("Battle1(standard)")
switch(input("What armor do you want?","Armor","Beginner") in list("Beginner","Intermediate","Advanced"))
if("Beginner")
usr.overlays += /obj/Armor1
if("Intermediate")
usr.overlays += /obj/Armor2
usr.move_delay += 1
if("Advanced")
usr.overlays += /obj/Armor3
usr.move_delay += 2
if("Battle2(advanced)")
usr.move_delay = 2
switch(input("What armor do you want?","Armor","Beginner") in list("Beginner","Intermediate","Advanced"))
if("Beginner")
usr.overlays += /obj/Armor1
if("Intermediate")
usr.overlays += /obj/Armor2
usr.move_delay += 1
if("Advanced")
usr.overlays += /obj/Armor3
usr.move_delay += 2
Load_Player
icon = 'Load.bmp'
Click()
var/savefile/F = new(key) // Where error is flagged
Read(F)
return


It gives these errors:

loading RoboWars.dme
RoboWars.dm:49:error:key:undefined var
RoboWars.dm:49:new :warning: This appears like the old syntax for new(). The type is now passed like this: new Type(args). You can leave out the type if assigning a variable of the same type.

RoboWars.dmb - 1 error, 1 warning (double-click on an error to jump to it)
I dont know for exact but i sugest uncaping your New turf mabye make it CreateNew. Because New is a built in proc. For the key part if thats the load char? then i sugesst changing it to ckey instead of key.


~Kros~
In response to K'ros Trikare
The error is still there, still persistant.
In response to Drafonis
try this

var/savefile/F = new("players/[src.ckey].sav")
Read(F)

tell me if that works.
In response to K'ros Trikare
That won't work. You're forgetting that in Click(), src is the thing being clicked, not the player doing the clicking. The Click() proc is one of the few procs where you should be using usr. The line should read:
var/savefile/F = new("[usr.ckey].sav")
usr.Read(F)
In response to K'ros Trikare
Now it says src.ckey: unidentified var
In response to WizDragon
Yeah forgot about the click...but there dosnt need to be usr.read(f) i dont think.
In response to K'ros Trikare
Thanks, WizDragon.
In response to Drafonis
Now, from this code:

CreateNew
icon = 'New.png'
Click()
switch(input("What engine do you want?","Engine","b1") in list("Battle1(standard)","Battle2(Advanced)"))
if("Battle1(standard)")
switch(input("What armor do you want?","Armor","Beginner") in list("Beginner","Intermediate","Advanced"))
if("Beginner")
usr.overlays += /obj/Armor1
if("Intermediate")
usr.overlays += /obj/Armor2
usr.move_delay += 1
if("Advanced")
usr.overlays += /obj/Armor3
usr.move_delay += 2
if("Battle2(advanced)")
usr.move_delay = 2
switch(input("What armor do you want?","Armor","Beginner") in list("Beginner","Intermediate","Advanced"))
if("Beginner")
usr.overlays += /obj/Armor1
if("Intermediate")
usr.overlays += /obj/Armor2
usr.move_delay += 1
if("Advanced")
usr.overlays += /obj/Armor3
usr.move_delay += 2


It only executes the engine part, not the Armor.
In response to Drafonis
Im guessing you'll want to be adding 'new /obj/Armor1 (usr.loc)'.
-DogMan
In response to Dog Man
Not correct, Dog Man. I want the armors to be overlays.
In response to K'ros Trikare
It depends on what he wants to load. If he wants to load the object, then src.Read(F) will work fine. But if he wants to load the player, then usr.Read(F) is necessary.
In response to Drafonis
Drafonis wrote:
Now, from this code:

CreateNew
icon = 'New.png'
Click()
switch(input("What engine do you want?","Engine","b1") in list("Battle1(standard)","Battle2(<font color=red>A</font>dvanced)"))
if("Battle1(standard)")
switch(input("What armor do you want?","Armor","Beginner") in list("Beginner","Intermediate","Advanced"))
if("Beginner")
usr.overlays += /obj/Armor1
if("Intermediate")
usr.overlays += /obj/Armor2
usr.move_delay += 1
if("Advanced")
usr.overlays += /obj/Armor3
usr.move_delay += 2
if("Battle2(advanced)")
usr.move_delay = 2
switch(input("What armor do you want?","Armor","Beginner") in list("Beginner","Intermediate","Advanced"))
if("Beginner")
usr.overlays += /obj/Armor1
if("Intermediate")
usr.overlays += /obj/Armor2
usr.move_delay += 1
if("Advanced")
usr.overlays += /obj/Armor3
usr.move_delay += 2</xms>

It only executes the engine part, not the Armor.

You forgot to make both the "advanced"s capitalized. You also don't need 3 switch statements. You should be able to get away with only 2 if you work right.