ID:266292
 
I am making a card game(I hav not decided what it is going to be about yet) and I am having trouble making a persons hand only viewable to them. Also I was wondering how the client would tell what deck and hand belonged to who. I was thinking about using vars to assign them a number ID, but I don't know how to add one to the last one given.
Please Help!!!
Air King

[EDIT]
I think I am going to make it about summoning creatures and calling forth spells with magical stones.
Have you played Una? If not, you might want to give it a try just to see if it gives you any ideas. Basically, every card is an object. The deck is a list containing those objects. When a player has a particular card, it just goes into his/her contents list (ie, card.loc = player). The statpanel then just shows all of the cards in the player's contents.
Duel Monsters?

OoOoOoOoOoOo that would be cool!

you could try the image() proc

with it you could make only you see an image, or both of you

its a pretty cool proc]

-Edward Wong Hau Pepelu Tivrusky 1st



In response to Pillsverry
Pillsverry wrote:
Duel Monsters?

OoOoOoOoOoOo that would be cool!

you could try the image() proc

with it you could make only you see an image, or both of you

its a pretty cool proc]

-Edward Wong Hau Pepelu Tivrusky 1st




I have tried that, but can't seem to get it, can you give me an example?
In response to Air Mapster
Air Mapster wrote:
Have you played Una? If not, you might want to give it a try just to see if it gives you any ideas. Basically, every card is an object. The deck is a list containing those objects. When a player has a particular card, it just goes into his/her contents list (ie, card.loc = player). The statpanel then just shows all of the cards in the player's contents.

Oh yeah I forgot about this game, I forgot that you could locate it in the usr's contents Thanks!!! I think i will try that!
In response to Air _King

var/Box
Box = image (/obj/card/whatever, locate(usr.loc))
usr << Box

just change:

/obj/card/whatever to what ever you want to show

usr.loc to what ever X,Y,Z you want it to show at

-Edward Wong Hau Pepelu Tivrusky 1st
In response to Pillsverry
Ok, I have the coding part under control, now How would you suggest I decide what goes into the user's deck? Should I make them Choose in a draft?
Air _King wrote:
I am making a card game(I hav not decided what it is going to be about yet) and I am having trouble making a persons hand only viewable to them. Also I was wondering how the client would tell what deck and hand belonged to who. I was thinking about using vars to assign them a number ID, but I don't know how to add one to the last one given.

There are basically three ways to see only your hand: Creating images with image(), printing cards in the stat panel, or using the browser. Both images and stat panels may have certain advantages, or you may want to use both, in different ways. However, with the stat panel you're limited to one icon per card, whereas in the main window you can make multi-tile card images that look better.

As for letting players choose their decks, that's an even bigger interface issue. Considering the sheer number of images you'd have to create for that, I recommend going with a stat panel interface, or using the browser. One method I think might be nice would be to use the stat panel to switch between categories of cards, then have all the cards in that category display as mini-icons in the main window. You'll still need some place to display what's in your deck, though.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Air _King wrote:
I am making a card game(I hav not decided what it is going to be about yet) and I am having trouble making a persons hand only viewable to them. Also I was wondering how the client would tell what deck and hand belonged to who. I was thinking about using vars to assign them a number ID, but I don't know how to add one to the last one given.

There are basically three ways to see only your hand: Creating images with image(), printing cards in the stat panel, or using the browser. Both images and stat panels may have certain advantages, or you may want to use both, in different ways. However, with the stat panel you're limited to one icon per card, whereas in the main window you can make multi-tile card images that look better.

As for letting players choose their decks, that's an even bigger interface issue. Considering the sheer number of images you'd have to create for that, I recommend going with a stat panel interface, or using the browser. One method I think might be nice would be to use the stat panel to switch between categories of cards, then have all the cards in that category display as mini-icons in the main window. You'll still need some place to display what's in your deck, though.

Lummox JR

How would you do it in the browser? Also I would I make it randomly decide a stack of cards and keep track of the order? I was thinking just create a new obj each time and overlap the others maybe? There is one problem with that, How would I code it so it draws the top card?
In response to Air _King
Air _King wrote:
How would you do it in the browser?


For this you should look up the browse() proc.
In response to Nadrew
Nadrew wrote:
Air _King wrote:
How would you do it in the browser?


For this you should look up the browse() proc.

Thanks Nadrew!!!
In response to Air _King
Air _King wrote:
Nadrew wrote:
Air _King wrote:
How would you do it in the browser?


For this you should look up the browse() proc.

Thanks Nadrew!!!


No problem, the browse proc is one of the best and funest things to experiment with, you can do alot with it like world records/who verbs and alot more.
In response to Nadrew
Nadrew wrote:
Air _King wrote:
Nadrew wrote:
Air _King wrote:
How would you do it in the browser?


For this you should look up the browse() proc.

Thanks Nadrew!!!


No problem, the browse proc is one of the best and funest things to experiment with, you can do alot with it like world records/who verbs and alot more.

Sure is fun and I have thought of a ton of things to do with it, but when I put usr<<browse("[contents]") it outputs /list when I have stuff in their contents, why?
In response to Air _King
Air _King wrote:
Sure is fun and I have thought of a ton of things to do with it, but when I put usr<<browse("[contents]") it outputs /list when I have stuff in their contents, why?

Because contents is a list. You'll need to use a for() loop and add it to a string, then give it to the usr.
In response to Vortezz
Vortezz wrote:
Air _King wrote:
Sure is fun and I have thought of a ton of things to do with it, but when I put usr<<browse("[contents]") it outputs /list when I have stuff in their contents, why?

Because contents is a list. You'll need to use a for() loop and add it to a string, then give it to the usr.

This is what I have:

mob
verb
see_hand()
usr << browse("[usr.contents]")for(contents in usr)

And i get:
Cards.dm:91:error: for: expected end of statement

I don't think I'm using it right I looked it up, but i didn't understand how to use it in this case.
In response to Air _King
Air _King wrote:
Vortezz wrote:
Air _King wrote:
Sure is fun and I have thought of a ton of things to do with it, but when I put usr<<browse("[contents]") it outputs /list when I have stuff in their contents, why?

Because contents is a list. You'll need to use a for() loop and add it to a string, then give it to the usr.

This is what I have:

mob
verb
see_hand()
usr << browse("[usr.contents]")for(contents in usr)

And i get:
Cards.dm:91:error: for: expected end of statement

I don't think I'm using it right I looked it up, but i didn't understand how to use it in this case.

Read what he said in terms of multiple lines:

var/string //make a string
for(var/obj/O in usr) //use for loop
string += "[O] " //add it to the string
usr << browse(string) //then give it to the user