ID:155804
 
I'm not sure how I should go about doing this...I have about 20 mobs that each player will automatically own when they join the game. I want to be able to distinguish ownership, in a decent way. AKA, with the least code possible. Can anyone point me in the right direction? Thanks.
You're going to need to elaborate. What do you mean "...about 20 mobs that each player will automatically own when they join the game"? What do you mean by "distinguish ownership"?
In response to Spunky_Girl (#1)
Alright.

This is a chess-style game. There will actually only be 20 mobs for both people, with about 5 different kinds of mobs that each player will have.

I don't want the person on the "Black" team to be able to move the "White" team's pieces, and vise versa.
In response to OrangeWeapons (#2)
When each piece is created (within their New proc), I would establish who owns them there with a simple variable.
mob
chess_piece
var/mob/owner
New(loc,mob/a)
..()
src.owner = a

So when you create each chess piece, just make sure you pass the right mob into the new proc.
In response to Spunky_Girl (#3)
I'm actually planning on using the client for personal variables...unless you can tell me how to do this, I'll attempt to mod it. Probably will only take a second, but I may be wrong.

    var/client/owner
New(client/a)
..()
src.owner = a


I think that will be work-able. Thanks

Edit: Wait a second...I'm getting confused now...hmm....I'll attempt to work this out.
In response to OrangeWeapons (#4)
Unless you want the chess piece appearing at a null location (since clients do not have a contents list), you will need to leave the loc argument like I did.
mob/chess_piece
var/client/owner
New(loc,client/a)
..()
src.owner = a


EDIT
And since this is a chess game, I assume you're using the Click() proc on these chess pieces as well.
mob/chess_piece
Click()
var/client/c = usr.client
if(c) //sanity check ~ habbit
if(src.owner == c)
//whatever stuff
In response to Spunky_Girl (#5)
My brain isn't wrapping around this logic...

When you create a new instance of a mob, the client becomes the owner. How do you know which client should be made the owner, or which client you should even refer to?
In response to OrangeWeapons (#6)
When you start the game and establish which player is which color, you then get their clients and create the pieces, passing the location of where the pieces should be created at, and the client of the player.

I'm not sure what you're having issues with :\

EDIT
Example of how to create a chess piece via a client verb
client/verb/new_game()
new /mob/chess_piece/rook(locate(1,1,1),src) //let's say that 1,1,1 is the bottom left corner of the board