ID:146688
 
Code:
        Login()
if(usr.Dead == 1)
checkhost()
usr.frozen = 0
usr << sound('music/dq6-flute.mid',1)
world << "<B><font color = blue>The dead [src] has entered the world.</font color></B>"
usr.loc = locate(62,9,3)
return
if(usr.Dead == 0)
usr << sound(usr.Sound,1)
checkhost()
usr.loc = locate(14,26,2)
world << "<B><font color = blue>[src] has entered the world.</font color></B>"
..()


Problem description:

When someone kicks the bucket their dead variable gets set to one and their icon turns into a coffin. I added these if statements in the login to check if they're dead or alive upon login. Now, I know the previous codes outside here work, but the locate code here doesn’t. When the dead people log in their on the battle ground, not moved, but unfrozen and their music changed to the flute song.

so I know the problem lies within the locate verb


but I don’t know how to fix the locate thingy. If anyone could help it's be muchly appreciated.

Part of your problem here is usr abuse. While usr can be safe in Login() in some games, it is most definitely not safe in any game with saved characters. Therefore use src, which is guaranteed correct, not usr, which is not.

Another problem is those bogus ifs. if(usr.Dead==1) should be if(Dead), and although if(!Dead) beats if(usr.Dead==0) you'd be better off using else there.

Lummox JR
In response to Lummox JR
I made those changes that you suggested, but the locate verb still isnt working correctly, i'm still being left out on the battle field, as a lonly coffin that just can be tranported to coffin jail v__v
In response to Newen
Newen wrote:
I made those changes that you suggested, but the locate verb still isnt working correctly, i'm still being left out on the battle field, as a lonly coffin that just can be tranported to coffin jail v__v

I'd have to see all the changes you made to press further. In the meantime I also suggest fixing your HTML. You should never have spaces between an attribute (in this case color) and the = sign and the value. Also, the closing tag should have no attributes; it should just be </font>.

Lummox JR
In response to Lummox JR
        Login()
if(Dead)
checkhost()
src.frozen = 0
src << sound('music/dq6-flute.mid',1)
src.loc = locate(62,9,3)
world << "<B><font color=blue>The dead [src] has entered the world.</font></B>"
return
else
checkhost()
src << sound(usr.Sound,1)
src.loc = locate(14,26,2)
world << "<B><font color=blue>[src] has entered the world.</font></B>"
..()


I made the changes suggested to make the former code into what it is above, and i'm greatful :D

the locate code that i'm using, if i turn into a verb states that at the loc is jail17 turf. So i'm guessing i'm supposed to use somthing differnt there to make it believe that i'm supposed to goto that...or somthing... >__> but id ont know what...<font color=#CCCCCC>Thanks for the help :D and goodnight!</font>
In response to Newen
Change
if(Dead)
to
if(src.Dead)
In response to Artekia
It's if(src.dead) anyway. Byond assumes src.

Picking a particular turf by co-ordinates probably isn't a good idea. You'd want to do something like this:

src.Move(locate(/area/DeadZone))


and put /area/DeadZone where you want dead people to go (more then one square).
In response to Newen
It should be working. Check if you typed "Dead" correct, and if it is not "dead" instead.