ID:2167560
 
(See the best response by Nadrew.)
Why is the name var returning as null
what am I doing wrong. The interface as set up as you see here.
This only happens when I group wingets together in a list.
if(src&&client)
var/list/l = params2list(winget(src,null,"login.Username.text;login.Password.text"))
var/name = l["login.Username.text"]
var/pass = l["login.Password.text"]

var/savefile/F = new("Players/[src.ckey]/[name].sav")

var/list/S = new/list()
var/PasswordRight

F["Password"] >> PasswordRight
F["S"] >> S

if(!src || !src.client ||!src.ckey || src==null) return
if(!fexists("Players/[src.ckey]/[name].sav"))
alert(src,"No save file found","Invalid")
return
if(!name)
alert(src,"Please enter an account ID.","Invalid")
winset(src, "login.Username", "text-color=#000000;background-color=#B81717")
return
You should probably be checking if the savefile exists before you load the character, not after. I'd imagine a lot of your issues are coming from that.
In response to Nadrew
Still have the same problem
            var/list/l = params2list(winget(src,null,"login.Username.text;login.Password.text"))
var/name = l["login.Username.text"]
var/pass = l["login.Password.text"]

var/savefile/F = new("Players/[src.ckey]/[name].sav")

var/list/S = new/list()
var/PasswordRight

F["Password"] >> PasswordRight
F["S"] >> S

if(!fexists("Players/[src.ckey]/[name].sav"))
alert(src,"No save file found","Invalid")
return
if(!name)
alert(src,"Please enter an account ID.","Invalid")
winset(src, "login.Username", "text-color=#000000;background-color=#B81717")
return
if(!pass)
alert(src,"Please enter a password.","Invalid")
winset(src, "login.Password", "text-color=#000000;background-color=#B81717")
return
if(pass!=PasswordRight)
winset(src, "login.Password", "text-color=#000000;background-color=#B81717")
return
winset(src, "login.Username", "text-color=#2DB817;background-color=#2DB817")
winset(src, "login.Password", "text-color=#2DB817;background-color=#2DB817")
defaultWindow("main")
if(src&&client)src.client.LoadMob(S)
Best response
You didn't actually change anything, the check should always be above the savefile/F bit -- although that's probably not the problem.

Your usage of winget() is wrong. You'd want something like:

winget(src,"login.Username;login.Password","text")
I don't know the problem at hand but I do see some things you can fix.

1. As Nadrew suggested, you're going to need to properly use winget() in order to achieve anything. Also his note on when to make your checks seems pretty key as well.

2. Checking for src.client might be less cpu intensive then src&&client.

3. Your last check seems a little off, maybe just make it else src.client.LoadMob(S)

4. It looks to me like you're creating a save file without even checking for one, that meaning you over write previous save files on login.

5. Do players have a chance to set their name before this line of code? I don't see any reason why names would be coming up as anything besides null. And unless you have multiple characters per save file, you might as well just save under the player's key instead.