ID:149312
 
Why this wont work
obj/stoner
Click(obj/D)
var/obj/stoneb/A = usr.holdingb
var/obj/stoner/B
if(turn == "Red")
if(usr.holdingb)
if(src==usr.holdingb)
icon_state="Red"
usr.holdingb=null
else
if(src.name == "Red")
usr.holdingb = src
icon_state="RedS"
else
usr<<"This is not your chip"
else
for(B in oview(src,1)) break //find the first B nearby
if(B) //if there is a B nearby
if(B==D)
var/dir = get_dir(A, B) //find the dir from here to B
var/obj/C
for(C in get_step(B, dir)) break //find C in the same direction
if(C)
usr<<"Cant Jump"
else
step(A,dir)
step(A,dir)
del(B)
ChangeTurn()
else
usr<<"Sorry can not jump own chips"

the italisized code its the part thats not working, sorry cant get any more exsact than that.
--The angry at code Scoobert
What error message do you get? Remember to always post your error messages, it's really hard for us to debug something when we're not sure exactly what the problem you are having is.
Scoobert wrote:
Why this wont work
obj/stoner
Click(obj/D)
var/obj/stoneb/A = usr.holdingb
var/obj/stoner/B
if(turn == "Red")
if(usr.holdingb)
if(src==usr.holdingb)
icon_state="Red"
usr.holdingb=null
else
if(src.name == "Red")
usr.holdingb = src
icon_state="RedS"
else
usr<<"This is not your chip"
else
for(B in oview(src,1)) break //find the first B nearby
if(B) //if there is a B nearby
if(B==D)
var/dir = get_dir(A, B) //find the dir from here to B
var/obj/C
for(C in get_step(B, dir)) break //find C in the same direction
if(C)
usr<<"Cant Jump"
else
step(A,dir)
step(A,dir)
del(B)
ChangeTurn()
else
usr<<"Sorry can not jump own chips"

the italisized code its the part thats not working, sorry cant get any more exsact than that.
--The angry at code Scoobert

There's too much changing to make explaining it sane, so I'll just make the changes and mark them in white. =)


obj/stoner
<font color=white>Click()</font>
var/obj/stoneb/A = usr.holdingb
var/obj/stoner/B<font color=white> = src</font>
if(turn == "Red")
if(usr.holdingb)
if(src==usr.holdingb)
icon_state="Red"
usr.holdingb=null
else
if(src.name == "Red")
usr.holdingb = src
icon_state="RedS"
else
usr<<"This is not your chip"
else
<font color=white>if(A in oview(B,1)) //check to see if the piece the user is jumping with is near this piece being jumped</font>
var/dir = get_dir(A, B) //find the dir from <font color=white>A (the piece held) to B (this piece, the one being jumped)</font>
var/obj/C
for(C in get_step(B, dir)) break //find C in the same direction
if(C)
usr<<"Cant Jump"
else
step(A,dir)
step(A,dir)
<font color=white>src = null //allows ChangeTurn to run when I'm deleted... however:</font>
del(B)
ChangeTurn() <font color=white>//you shouldn't change the turn until the piece is done jumping all of the pieces it can jump!
//For now, it'll work, but you should, at some point, write a proc
// that actually makes sure the piece can't jump any more before
// ending the turn.</font>
else
usr<<"Sorry can not jump own chips"

Note that the indentation was changed a bit, and a few lines were removed entirely.
In response to ShadowWolf
there was no error at all, it just didnt work, i firgured spuzzem would know though because its a retrofit of something he showed me.
In response to Spuzzum
Thanks that helped if it works, right now im making a site for my games but i will try it out soon.
see your later.
--The thankful Scoobert
In response to Spuzzum
Worked like a charm, ill make sure to add you to something in my game to show you helped...ALOT.
--The should be better at code Scoobert