ID:1465393
 
EDITED:
Code:
obj/pieces/proc
check_jump_again()
var/obj/pieces/p
var/turf/t
for(var/d in diagonalstwo)
t = get_step(src,d)
if(!isturf(t)) continue
p = locate(/obj/pieces) in t
if(p&&p.type!=src.type)
t = get_step(t,d)
if(!isturf(t)) continue
p = locate(/obj/pieces) in t
if(p)
continue
return t
return 0

var/list/diagonalstwo = list(NORTHEAST, NORTHWEST)


Problem description:

1) Help me understand the above. Its for a checkers game checking if it has 1 or more moves. It can return t (turf) twice. I thought return stops all proc activity so for loop stops? Yet it doesn't? I didn't write this alone. I got help. I checked and this returns t twice if possible. How did that happen?

2) I want to create a card game so I want to make it so that you can see everyone's cards face down but then when the round ends, everyone's cards are seen faced up. I only know of invisibility and see_invisible procs but I don't know how I can use them for this.

3) How can I have players' names appear below their icons?
Well with question 1 if you ever get help please make sure that the person helping you either explains the code to you and makes sure you understand it or add comments. My advice here is to attempt this on your own that way you will know exactly what it does with-out anyone typing it for you, yeah of course people can still explain to you how to do it.

For the second question well I believe that you could use the for proc to display the front of the card to the user who's cards they are and the back of the cards to the user(s) who's cards they aren't. Then you could be able to expand on this and use the while proc to change all the users card icons to the front of the cards.

Now for the third question, there are many helpful demos' on how to do this is the developer resources section of the BYOND website. I have looked over this library and it demonstrates what you are looking for in a simple way. You will then be able to take this and build on it and change it in ways to make it however you wish for it to be.

Kind Regards,
King_Ed.
In response to King_ed
About #1) I need someone to explain how that code returns t twice.

About #2) How do I change the cards for different players?

About #3) I will look into that library
2. Image objects
About #1) I can not see why t returns twice. Ask the person who helped you i'm sure they would know.

About #2) Well I am not exactly sure but I think it should be along the lines of this:
mob/var
place1 = 0//I'm assuming for a card game you will have multiple places where users cards will show.
place2 = 0//I am only going to do it for 2 players.




mob/proc/Cards()
for(mob/M in players)
if(usr.place1 == 1)
for(var/obj/Cards/C in world)
C.icon = 'CardFront.dmi'
else
for(var/obj/Cards/C in world)
C.icon = 'CardBack.dmi'


I am not 100% sure if that code will work but it is worth a try. I believe more as in it won't work as I think it will change the icon for both of them but I don't have dream maker on my laptop so I am unable to test it.

About #3) Good, I think you should find it helpful.
If no one posts here anymore, I might post here again when I am actually making the card game.
Thank you for wasting my valuable time XD
In response to King_ed
Just hold I might even begin working on the card game today depending if my graphic artist will finish the deck today.
Cool.
Use break to stop loops.