ID:154808
 
I'm still having some trouble seeing where the client comes into use in a BYOND game. I understand that when a player logs in, he, the client, is connected to the world.mob and gains control of that movable object. What I don't understand is where it comes into use other than that and macros?

Also, if I may add, how could one make a procedure that when one logs into a game, the game checks if said person already has a savefile or not?
When you connect to a world, a single client is created along with a default mob. Nothing about that mob is intrinsically linked to the player, except through the client. If the game then generates another mob and sets that mob's key = to the player's, the same client object is still there. The original mob can be deleted and the client will remain intact. In such a situation, any information that needs to be stored throughout the whole session should be associated with the client rather than the mob.

Example: a board game with limited players might have mob/spectator as the default world.mob type. When a player actually joins the game in progress (instead of watching or waiting), they're connected instead to a mob of type mob/player. The original mob is deleted, the client remains, and can have vars tracking their in-game name, current local stats, whatever.
In response to AlexandraErin
Thank you very much. I suspected that's what the client did, but you verified it. About the save-check procedure, though. How would one check if a savefile connected to a certain client is present?
In response to Pinnacle
Upon logging in, you could use this;

if(fexists("savefile_directory/[src.ckey].sav"))

That would check is a savefile is present and you could choose to load it, delete it, over write it, whatever you choose.