ID:155804
Mar 16 2011, 3:38 am
|
|
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.
|
Mar 16 2011, 3:41 am
|
|
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
|
|
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
|
|
When each piece is created (within their New proc), I would establish who owns them there with a simple variable.
mob So when you create each chess piece, just make sure you pass the right mob into the new proc. |
In response to Spunky_Girl
|
|
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 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
|
|
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 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 |
In response to Spunky_Girl
|
|
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
|
|
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() |