ID:167672
 
I am making a board game i want to know how to make it so you can't move other peoples pieces, i am using a drag and drop movement because people have a lot of pieces (like a tactics game) right now you can move all objs on the map, i want them only to move one color.

also i am using a text overlay (modified but not my own) and i want to know how only you can see your piece stats, right now all stats are wide open.
Using checkers as an example, set a color var for the player. Next, set one for the piece. then, when the player because a color, have it check to see if the piece it clicked had the same color var as the piece. If yes, continue, if not, stop.

mob/var/color
obj/var/color

obj
Black_Piece
icon = 'blah'
icon_state = "blah"
color = "Black"
Click()
if(usr.color != "Black")
usr << "You aren't black!"
else
//continue here

White_Piece
//same stuff
color = "White"
Click()
if(usr.color != "White")
usr << "You aren't white!"
else
//continue here

mob/verb/Join_Game()
switch(input("Which team do you want to join?","Team")in list("Black","White"))
if("Black")
usr.color = "Black"
if("White")
usr.color = "White"


Something like that. The invis part, well, there is many way to do that. I'll let you figure it out. Just a quick little thing I whipped up in 5 mins. Just an example.
In response to Pyro_dragons
thanks...i needed to arange it abiy but it worked wonders... now i only need that invisible thing and i can start testing
In response to Pyro_dragons
Pyro_dragons wrote:
Using checkers as an example, set a color var for the player. Next, set one for the piece. then, when the player because a color, have it check to see if the piece it clicked had the same color var as the piece. If yes, continue, if not, stop.

mob/var/color
> obj/var/color
>
> obj
> Black_Piece
> icon = 'blah'
> icon_state = "blah"
> color = "Black"
> Click()
> if(usr.color != "Black")
> usr << "You aren't black!"
> else
> //continue here
>
> White_Piece
> //same stuff
> color = "White"
> Click()
> if(usr.color != "White")
> usr << "You aren't white!"
> else
> //continue here

mob/verb/Join_Game()
switch(input("Which team do you want to join?","Team")in list("Black","White"))
if("Black")
usr.color = "Black"
if("White")
usr.color = "White"</dm>

Yet far superior:
atom/var/color

obj
piece
Click()
if(usr.color != color)
usr << "You aren't [color]!"
return
//continue here

Lummox JR
In response to Lummox JR
thank lummox...srry for the asshole comment, its just some had said something really mean to me because i asked a question on one of these forums and i got really mad...i can tell you do know what your doing
In response to Lummox JR
one more thing...anything on how to make overlays invisible to everyone but the person who made it
i figured out how to only move and click on one color, but now i want to make it so you cant change colors...... still need help with making over lays invisible to everybody but the person who created it
In response to Dmingmage
Dmingmage wrote:
one more thing...anything on how to make overlays invisible to everyone but the person who made it

For that you need to use images. Look up image() or the /image datum in the reference; it should be most helpful. Short demonstration:
mob
var/tmp/image/HPbar
var/tmp/image/MPbar

Login()
..()
HPbar = new(icon='HPbar.dmi', loc=src)
HPbar.pixel_y=40
MPbar = new(icon='MPbar.dmi', loc=src)
MPbar.pixel_y=32
src << HPbar
src << MPbar

In response to Lummox JR
Lummox JR wrote:
Pyro_dragons wrote:
Using checkers as an example, set a color var for the player. Next, set one for the piece. then, when the player because a color, have it check to see if the piece it clicked had the same color var as the piece. If yes, continue, if not, stop.

mob/var/color
> > obj/var/color
> >
> > obj
> > Black_Piece
> > icon = 'blah'
> > icon_state = "blah"
> > color = "Black"
> > Click()
> > if(usr.color != "Black")
> > usr << "You aren't black!"
> > else
> > //continue here
> >
> > White_Piece
> > //same stuff
> > color = "White"
> > Click()
> > if(usr.color != "White")
> > usr << "You aren't white!"
> > else
> > //continue here

mob/verb/Join_Game()
switch(input("Which team do you want to join?","Team")in list("Black","White"))
if("Black")
usr.color = "Black"
if("White")
usr.color = "White"</dm>

Yet far superior:
atom/var/color
>
> obj
> piece
> Click()
> if(usr.color != color)
> usr << "You aren't [color]!"
> return
> //continue here

Lummox JR

Yeah Yeah, of course what you come up with is shorter and better than mine. But then you've been suing BYOND longer than I have so I guess that would make sense. Lol.
In response to Pyro_dragons
i always code longer...im not your reg. neewb...i did this years ago and stopped...nbow i forgot everything
In response to Dmingmage
I'm not a n00b. I've been doing this for like 6 or 7 months now, so I know quite a bit. I'm often found helping n00bs. Ask around. Lummox is just better than I am at this. So are a lot of people. But I'm not a n00b, so don't call me one.
In response to Pyro_dragons
im sorry if you tookit that way i wasn't calling you a noob, i was saying i do it the hard way too....im really srry if thats how you took it...iwas calling my self kindof a noob, where i just forgot everything so now im starting off small again in my Stratego game (all the help your giving me)
In response to Dmingmage
It's ok. I just get tired of being called a noob all the time, even if its a noob calling me one(not that you are). I just want to PK those bastards over and over again. But they always run to a non PVP zone.

Anyway, it's no problem, it's just annoying.