Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Need help perfecting card game

Need help perfecting card game

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Dralnu   USA  (277 posts)  Bio
Date Wed 01 Jun 2005 03:58 AM (UTC)
Message
Trying to decide how to make a cardgame (something similar to poker, or a CCG for something to do on long runs, or to break up the monotony of killing, questing, and killing some more). I'd like to be able to use one deck of cards, and allow people to play things like Poker, Rummy, Spades, ect., just for something to do.

Nothing like drinking a beer with your best pipe, and laying cards with your friends to make you run out of money...
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Thu 02 Jun 2005 04:11 PM (UTC)
Message
What you could start off doing is make a new obj type, have v0 (or something) be the card value. (King would be 10 or 1 etc) Then code in some commands like shuffle, deal and so on. Just a basic overview.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #2 on Thu 02 Jun 2005 05:28 PM (UTC)
Message
I was honestly thinking something more long the lines of ASCii (or whatever it is) mapping. Individual items like that would make for a rather odd set-up, since for games like poker, or if you are playing rummy and you lay the cards down, mob w/ spec_janitor walks by and steals half the deck. Not something cool. Replacing a deck of cards every run or two would be a bit annoying.

One of these days I'll learn to be more specific on my first post
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Thu 02 Jun 2005 06:10 PM (UTC)
Message
That'd be quite difficult. I'd have some problems doing it myself. I wouldn't suggest attempting it if you aren't experienced. Or getting some direct help.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #4 on Thu 02 Jun 2005 06:28 PM (UTC)
Message
I've got Txzeenath on Yahoo to help me some, but if you know a way you could do it other then ASCii, require only one object, and being able to deal/draw/discard/ect. without having to make an object for each individual card, I'd appretiate it.
Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #5 on Thu 02 Jun 2005 08:54 PM (UTC)
Message
There is a blackjack snippet out there, that will help you most of the way, have a look at it, if you cannot find it let me know, i will find the link or email you the code.

Peace.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #6 on Thu 02 Jun 2005 08:56 PM (UTC)
Message
MudMagic.com. I'll look into it when I get a chance
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #7 on Thu 02 Jun 2005 10:19 PM (UTC)
Message
Quote:

mob w/ spec_janitor walks by and steals half the deck

That wouldn't be hard to remedy you know :P

~Nick Cash
http://www.nick-cash.com
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #8 on Thu 02 Jun 2005 10:51 PM (UTC)
Message
Plus it is also alot more to keep up with, and god forbid you lose a card. Plus, I just want to do something besides with objects (I'd still require one to play, just one instead of 53...)
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #9 on Fri 03 Jun 2005 12:15 AM (UTC)
Message
Janitor mob solution is as simple as not setting the take flag on the item.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #10 on Fri 03 Jun 2005 12:20 AM (UTC)
Message
Janitor mob solution is as simple as not puting the take flag on the object


Question: How would a person pick up the cards if, say, the container was destroyed? The jan mob solution is a flag to make the item untakable by a mob with the spec_janitor applied to it, and I'd rather do it another way anyways then requiring 53 items for one card set.
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #11 on Fri 03 Jun 2005 10:50 AM (UTC)
Message
Then dont have 53 items. Have the dealer mpoload whatever cards the player is dealt (if you have cards at all, thats another matter entirely) and keep a running total of his own cards. Even simpler still, have the code maintain the running total for player and dealer and skip objects entirely. But the *simple* solution to fixing objects so janitor mobs dont grab them is just not to set the take flag (ala fountains) and not either write a new flag or rewrite an existing one. As for picking up cards if the container is destroyed, you dont - have the mob check every minute or so for the container in the room and purge the room if it doesnt exist. Of course, if the container is a room object, Im curious as to how it would be destroyed but thats for another day...

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #12 on Fri 03 Jun 2005 03:46 PM (UTC)
Message
keeping a running total is what I want to do, but just want to use an item to make it a little more realistic. Once I get around to it, I'm probably going to play around with the blackjack snippet and see if I cann't make it do what I want it to do.
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #13 on Sun 05 Jun 2005 09:01 PM (UTC)

Amended on Mon 06 Jun 2005 12:44 AM (UTC) by Dralnu

Message
Got the Blackjack snippet, and from the looks of it, it seems incomplete.
In any case, working on modifying the cards struct that came with it, changing things to a more defined state


const struct mycards allcards[52]={
{2c, "2 of clubs"},
{2h, "2 of hearts"},
{2d, "2 of diamonds"},
{2s, "2 of spades"},

Just curious if this setup will work, or if I'm going to have to change everything around...

Edit #1

Or would using something like

{021, "2 of clubs" },
{031, "3 of clubs" },

work better?

Edit #2

Cleaned up the code for the blackjack snippet some. Looking through it, it has added in cards_[insert difrent word here] to flag players as playing or not playing. Question is, do I need to add fields to save these flags, or can I set cards_notplaying to a default somehow?
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


33,719 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.