Here's the gist:
I'm building a game that involves permanent death. When the player dies, how would I go about resetting them to default after deleting their save file when they die and go to the game over screen?
![]() Apr 12 2015, 7:52 am
|
|
Just create a new /mob for the player and set the client to it, it's the easiest to start "fresh"
|
Make a new mob, and then move their client to that mob would probably be my suggestion. The viability of that may depend on your Login definitions.
|
die() Well, this isn't right :D There's something I'm missing because when it's a player who dies, I'm not being teleported and monsters around me keep attacking and dealing damage. |
Move() can fail for one, your better off using var/mob/Player/M=new /mob/Player(locate(12,29,4))
Also M.client=src.client to put the player into it. Also if you want to delete the original mob, just use "del src" after you move the player into the new mob, or else both mobs will stay in existence. And src.canmove is useless if you have no client in the mob, so I'm not sure why that's there, unless you want to stop the new mob from moving right away or something. |
Got it. yea my biggest problem was the M.client=src.client
the canmove was there to prevent the player from walking around on the game over screen, but the var is autoset at creation of a new player mob, so it WAS unnecessary |
There is also client.mob which does the opposite of mob.client. Setting client.mob will change that client's connection mob.
|