Login()
if(usr.first_login == 0)
usr.first_login = 1
var/island = rand(1,5)
switch(island)
if(1)
var/locx = rand(1,14)
var/locy = rand(1,27)
usr.Move(locate(locx,locy,1))
if(2)
var/locx = rand(1,21)
var/locy = rand(73,100)
usr.Move(locate(locx,locy,1))
if(3)
var/locx = rand(92,100)
var/locy = rand(43,63)
usr.Move(locate(locx,locy,1))
if(4)
var/locx = rand(87,100)
var/locy = rand(240,247)
usr.Move(locate(locx,locy,1))
if(5)
var/locx = rand(188,201)
var/locy = rand(151,162)
usr.Move(locate(locx,locy,1))
Ok, that works.. now i need it to make you start out where you last were, before you logged out.. Heres what i have.
else
usr.Move(locate(usr.lasty,usr.lastx,1))
Logout()
world << "<b>[usr] logs out."
usr.lastx = usr.x
usr.lasty = usr.y
del(usr)
And for some reason, when you login with an old character, you start at 1,1,1... Any ideas?
-Rcet
Well, aside from not closing the <B> tag, there's one big problem: You're deleting the mob instead of moving it to null. The changes you store in lastx and lasty aren't saved becaues you immediately delete the mob right afterward. You have to safe the mob right at that point, then delete it--or else move it to null.
[EDIT]
You should also consider using a list to store starting turfs. Much simpler than a switch() statement, you could run a proc in world.New() that stores those turfs in a list, and then in Login() you could set the loc like this:
Lummox JR