ID:138923
 
Code:
There's a bit of it, sorry. First there is the object code for when it is clicked.
        Click()
if(usr.Turn == 1)
if(Safety == 1)
if(src.LandCheck() == 1)
usr << output("You cannot kill on the first turn!","Chat")
return
else
Safety = 0
var/turf/T = usr.loc
T.density = 1
T.icon_state = "destroyed"
usr.Move(src.loc)
spawn(0) usr.Land()
usr.ClearTrackers()
for(var/mob/M in world)
if(M == usr.Foe)
var/mob/P = M
P.Turn = 1
P.Create_Trackers()


When you click the tracker, if it's your turn, you jump to it. And my LandCheck() works fine. The problem is that it doesn't make person's foe create the trackers. Here is the code showing how the foe is set.

var
White // White Player
Black // Black Player

White()
set hidden = 1
if(White)
if(White != src)
src << output("White is taken!","Chat")
if(Black)
src << output("Black is already taken too! You will have to wait until next round!","Chat")
else
src << output("You will have to play as Black","Chat")
Black = src
else
if(Black == src)
Black = null
White = src
for(var/mob/M in world)
M.UpdateWB()
src.CloseColour()
return

Black()
set hidden = 1
if(Black)
if(Black != src)
src << output("Black is taken!","Chat")
if(White)
src << output("White is already taken too! You will have to wait until next round!","Chat")
else
src << output("You will have to play as White","Chat")
White = src
else
if(White == src)
White = null
Black = src
for(var/mob/M in world)
M.UpdateWB()
src.CloseColour()
return

Start()
set hidden = 1
if(Game == 0)
if(White && Black)
for(var/turf/T in block(locate(2,2,1),locate(9,9,1)))
SpawnTurfs += T
for(var/mob/M in world)
if(White == M)
M.icon_state = "w[M.Piece]"
var/turf/P = pick(SpawnTurfs)
SpawnTurfs -= P
M.Move(P)
M.Foe = Black
if(Black == M)
M.icon_state = "b[M.Piece]"
var/turf/P = pick(SpawnTurfs)
SpawnTurfs -= P
M.Move(P)
M.Foe = White

Problem description:
(Hmmm, I should probably handle the moving with a player verb now that I think of it...) Anyway the person joins and their mob becomes White or Black. When the game starts, their foe is set to that mob. Which brings us back to my object code, me trying to make the foe do something.
var
White // White Player
Black // Black Player

White()
set hidden = 1


What is this?


You are not being very clear on what you want in the first place.
In response to ANiChowy
Global variables. The verbs belong to mob, and the reason they have hidden = 1 is because I like to have a little redundancy to make sure things work. The verbs are used through macroes. My issue is that clicking the object does not make the other person start their turn.
In response to Lugia319
What it looks like to me is that you're trying to create a board game. Or something similar. Either way, you've got players taking turns, and it looks like you're currently handling that with a variable that mobs hold and then building procs around that variable.

Generally, that is horrible design for game handling. I suggest using some type of datum. It will make your life so much easier, and eliminate most of the headache!

game_handler
var/list/players = list()
var/gametype // bitflag for the gametype
// etc...


Something like that, perhaps?
In response to ANiChowy
I'll give it shot. Time to re-code this, yet again!
In response to Lugia319
Post here again if you have troubles.