Release: Poker Table

Post your Custom Scripts or Packages.

Moderator: POL Developer

Post Reply
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Release: Poker Table

Post by *Edwards »

[Under construction]

Well, my actual project for a shard is definitively dead. But I got bored this weekend and went to the conclusion that I could transform my lazyness into some kind of great new feature for POL ( if not already built for any other private pol shard ). I know RunUO has it on atleast their main shards and shall now be available for POL soon!

I'm starting it right now so if you got any special feature requests for a poker table post it here. ( achievments, ranking, term of use, ... anything else? ).

If you believe it's a really bad idea you can also comment here. Oh and if you already made the game working for your own shard just warn me so I'm not losing my time :x and then SHARE IT!

See ya soon!

damn I'm going to add the beer license in-game :)
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Re: Release: Poker Table

Post by OldnGrey »

The WoD scripts has several games on it, all very simple - place a bet and lose when your cards don't work out.
What sort of features does the RunUO version have?
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: Release: Poker Table

Post by *Edwards »

I'm talking about an automated multiplayer poker table that you can play against reel players. I once dreamed to get the time to build it and then I saw it on the main RunUO shard. Not really a feature since I don't think admin will take it for the distro but atleast it will be a small addon if you ever wanted your players playing poker on your shard. :). I started it few hours ago already and it's going well for now. It is not blackjack in WoD?
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Re: Release: Poker Table

Post by OldnGrey »

WoD has the chessboard and pieces (gumps). No multiplayer games with enforced rules though.
The RunUO chess game is brilliant though.
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Release: Poker Table

Post by Pierce »

*Edwards wrote: Oh and if you already made the game working for your own shard just warn me so I'm not losing my time :x and then SHARE IT!
I've written such a script nearly 2 years ago. I never looked at it until now cause our players are not very good in describing bugs or testing :D and it's hard to find all running 3 or more clients on your own ;)

The main things should work but it surely will contain bugs cause poker isn't that easy to script. The script isn't optimized yet nor does it contain all features it should cause i first wanted to get it to work completly and then add more options/features.

To use this script you'll have to patch the bitmaps i drawed into the gumpart.mul and art.mul cause the script uses them.

To play there must be of course at least 2 Players and they must have 500 gp in their backpacks. To start the game someone has to press the gump button with the people on it. To update one has to press the update button (the one with the parchment roll on it). The X button leaves the game if you are not in the middle of the game.

If i forgot something, tell me :)
Attachments
poker.rar
(215.57 KiB) Downloaded 435 times
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: Release: Poker Table

Post by *Edwards »

Alright, let me re-organize these functions tonight and re-optimize the codes... Maybe next weekend I'll release it.

Thank you Pierce!
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: Release: Poker Table

Post by *Edwards »

Well, I might consider to use your system and fix it so it works with datafile, without bugs and with 10 places without using any special gumps or arts that complicate for anyone who would like to use it. Thanks a lot for distributing this. If you see any problems feel free to stop me. :)
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Release: Poker Table

Post by Pierce »

You're welcome. I usually don't stop people to do anything they want ;)
Grem
New User
Posts: 10
Joined: Thu Mar 16, 2006 9:50 am

Re: Release: Poker Table

Post by Grem »

How path files? What programs are necessary? Or where to download ready to look?

Update: find! mulEditor. *ok* *test script*
Last edited by Grem on Wed Apr 22, 2009 2:57 pm, edited 1 time in total.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: Release: Poker Table

Post by *Edwards »

Hehe as Pierce said ''poker isn't that easy to script'' but I am still on it in the weekends. The next steps before being completed:
- separate the flop/turn/river
- get money a variable :). Right now I can check, bet, raise or calls but there is no money on the table...
- define the winning hands
- and release!

Requirments: gump package distro097, pol097, client v.4
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Release: Poker Table

Post by Pierce »

@grem:
How path files? What programs are necessary? Or where to download ready to look?
If you mean my version. I suggest mulpatcher to add the pics to the .mul files. It's very simple and I named the pics where they belong as gump id or art id. There shouldn't be a conflict with original EA numbers.

Mulpatcher you can find here:
http://varan.uodev.de/
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Release: Poker Table

Post by Turley »

Pierce wrote: I suggest mulpatcher to add the pics to the .mul files.
tztztz
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Release: Poker Table

Post by Pierce »

Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Release: Poker Table

Post by Turley »

:)
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: Release: Poker Table

Post by MuadDib »

Dang skippy you recommend UOF. Best product on the market today for working with client files. :D
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: Release: Poker Table

Post by *Edwards »

Damn Pierce, winning hands are shame to script!!! I don't even see all the logic behind this... I could create tons of "if" statement but it wouldn't help anyone at all. Anyways....

Notice to Pierce if you ever read this again: I tested it with my system and I get errors few times. I'm just not sure of the answer.

If anyone helps I will of course appreciate but I just posted the references to my situation...
I'm actually stuck... lol and out of beers!

Code: Select all

function ValidateCards( data_elem, player_cards )

         //Main Hand
         var check_royalFlush := 0,
             check_straightFlush := 0,
             check_fourOfAKind := 0,
             check_fullHouse := 0,
             check_flush := 0,
             check_straight := 0,
             check_treeOfAKind := 0,
             check_twoPairs := 0,
             check_pair := 0,
             check_highCard;

         //The cards
         var first_card := data_elem.GetProp( "TCard1" ),
             second_card := data_elem.GetProp( "TCard2" ),
             third_cards := data_elem.GetProp( "TCard3" ),
             fourth_card := data_elem.GetProp( "TCard4" ),
             fifth_card := data_elem.GetProp( "TCard5" ),
             playerCard1 := player_cards[1],
             playerCard2 := player_cards[2];

         //Right now I'm testing with all the 7cards on the table for each players. I might fix later to read
         //the process flop-turn & || river to append in var the_cards
             
         var the_cards := {first_card, second_card, third_cards, fourth_card, fifth_card, playerCard1, playerCard2};
         
         var clubs := 0,
             diamonds := 0,
             hearts := 0,
             spades := 0;
             
         foreach card in the_cards
                 if( card[1] == "clubs" )
                         clubs += 1;
                         if( clubs >= 5 )
                                 check_flush := 1;
                                 break;
                         endif
                 elseif( card[1] == "diamonds" )
                         diamonds += 1;
                         if( diamonds >= 5 )
                                 check_flush := 1;
                                 break;
                         endif
                 elseif( card[1] == "hearts" )
                         hearts += 1;
                         if( hearts >= 5 )
                                 check_flush := 1;
                                 break;
                         endif
                 elseif( card[1] == "spades" )
                         spades += 1;
                         if( spades >= 5 )
                                 check_flush := 1;
                                 break;
                         endif
                 endif
                 
                 SleepMS(2);
         endforeach
         
         var cardValue := array{},
             i;
         
         for( i:=1; i<=the_cards.Size(); i+=1 )
                 var tempCard := the_cards[i],
                     the_card := tempCard[2];
                     
                 cardValue.Append( the_card );
                 
                 SleepMS(2);
         endfor
         
         //stuff to identify Straight, HighCard, Pairs, here...
         
         


         if( check_royalFlush )
                 Broadcast( "check_royalFlush oh and by the way YOU SUCK! ..." ); //To be removed
                 return 1;
         elseif( check_straightFlush )
                 Broadcast( "check_straightFlush" );
                 return 1;
         elseif( check_fourOfAKind )
                 Broadcast( "check_fourOfAKind" );
                 return 1;
         elseif( check_fullHouse )
                 Broadcast( "check_fullHouse" );
                 return 1;
         elseif( check_flush )
                 Broadcast( "check_flush" );
                 return 1;
         elseif( check_straight )
                 Broadcast( "check_straight" );
                 return 1;
         elseif( check_treeOfAKind )
                 Broadcast( "check_treeOfAKind" );
                 return 1;
         elseif( check_twoPairs )
                 Broadcast( "check_twoPairs" );
                 return 1;
         elseif( check_pair )
                 Broadcast( "check_pair" );
                 return 1;
         else
                 Broadcast( "check_highCard" );
                 return 1;
         endif
         
         return 1;
endfunction
Data_elem is the reference to the datafile pokertable element ( You can use different poker tables with different settings ).

Property of each TableCards & PlayersCards are array. First param is the string color name ( clubs, diamonds, hearts, spades ) and the second param is the card value ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q ,K , A ).
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Release: Poker Table

Post by CWO »

What errors are you getting?

There is no such card as 1.. The ace is 1 and 13...

We can all work together on code changes here
http://www.cwo333.com/pastebin/index.php?show=52

just submit the changes and post the new link here.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: Release: Poker Table

Post by *Edwards »

I posted a code that I barely understand from Pierce's pkg. It's supose to determine pair, 2pairs, 3of a kind, 4for of a kind, fullhouse. If you want to test on a live shard you can work with the var cardValue := array{}. Set as many cards you want inside this array and call it after the for loop who uses it.

Ex.: cardValue := { 2, 4, 4, 2, 7. 8, 8, A, A, A J, Q};

http://www.cwo333.com/pastebin/index.php?show=53

The code itself seems to work but only a few times. I mean, sometimes he won't read anything from the cardValue. He should tells 2 pairs but finally he didn't found anything...
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Release: Poker Table

Post by CWO »

http://www.cwo333.com/pastebin/index.php?show=61

hopefully its kinda easy...
the main things to know here:

variable besthand contains the constant number for the best combination of that player's hand.
If (player1's besthand > player2's besthand)
player 1 wins.
end

now in ties of best hand the variable handvalues which is an array comes in.

Code: Select all

if (player1's besthand == player2's besthand)
     if (player1's handvalues[1] > player2's handvalues[1])
          player 1 wins
     endif
     if (player1's handvalues[1] == player2's handvalues[1])
          evaluate if handvalues[2] is different.
          then handvalues[3] and so on...
          until handvalues == 0. In this case, its a complete tie.
     endif
endif
Grem
New User
Posts: 10
Joined: Thu Mar 16, 2006 9:50 am

Re: Release: Poker Table

Post by Grem »

no new versions ?
Daichi
New User
Posts: 3
Joined: Tue Nov 18, 2008 6:19 pm

Re: Release: Poker Table

Post by Daichi »

i would love new versions :)
Joram
New User
Posts: 9
Joined: Thu Aug 12, 2010 8:06 am

Re: Release: Poker Table

Post by Joram »

Hello,

Is this project died? please i need more info. Thanks
Post Reply