mob/Login()
src.player=1
src.icon='base.dmi'
usr.Move(locate(7,95,2))
Problem description:
When i log in, instead of going to the right location i end up at 0,0,0
ID:264081
Jun 19 2008, 6:16 am
|
|
mob/Login() Problem description: When i log in, instead of going to the right location i end up at 0,0,0 |
In addition to what Pirion said, it might also be that those coordinates do not exist? Make sure you validate locate() returns back a turf before attempting to use it, because it can return 0 instead.
Regarding what Pirion said, if you need to rely on the movement system, a good (quick) alternative to the movement could be something like this: atom/movable/proc/forcemove(loc,dir) Also, you should not use a player variable to keep track of whether a mob is played-owned or not. To check if a player is currently logged into a mob you can simply check if its client variable isn't null (is a true value) A different check could also be done - check if the mob has a key, if so it belongs (or belonged) to a player. |
In response to Kaioken
|
|
I fixed it, the issue was the screen was dense so using
mob/Login() i got it to be all set, thanks anyway |
In response to Lt. Pain
|
|
While it's good that you got it to currently work, it does not mean the rest of my post was meaningless. Of course, you are free to ignore my advice at your peril, but it is still bad to use and set a player var on Login(), and icon too for that matter - which should be set at the object definition, not in a proc. To check if a mob is a player mob, either make players mobs in a subtype such as /mob/player and use istype() or check their client var.
|
setting location ignores if tile is dense(or has dense objects> or not.