Jump to content
  • 0

Request: Poker


Question

14 answers to this question

Recommended Posts

Posted

not to mention side bets... the other problem of course, is the ability to show the players their cards... BMP's aren't very useful here, since you can only show one at a time... so you would have to have an image for every possible combination... (lots o images... hooray!) and text based games, just aren't very fun...

Posted

not to mention side bets... the other problem of course, is the ability to show the players their cards... BMP's aren't very useful here, since you can only show one at a time... so you would have to have an image for every possible combination... (lots o images... hooray!) and text based games, just aren't very fun...

suggestion : create cutin that show multiple card / single card... it would be nicer...xD

  • Upvote 1
Posted

not to mention side bets... the other problem of course, is the ability to show the players their cards... BMP's aren't very useful here, since you can only show one at a time... so you would have to have an image for every possible combination... (lots o images... hooray!) and text based games, just aren't very fun...

suggestion : create cutin that show multiple card / single card... it would be nicer...xD

not to mention side bets... the other problem of course, is the ability to show the players their cards... BMP's aren't very useful here, since you can only show one at a time... so you would have to have an image for every possible combination... (lots o images... hooray!) and text based games, just aren't very fun...

suggestion : create cutin that show multiple card / single card... it would be nicer...xD

That's what I mean though, you can only show a single cutin else it gets replaced... so you would need an image for every possible card combination...

Cutins do not stack, they replace...

Posted

You would need to make a lot of if() statments and make it assign a number value for the total value of each hand. For example a pair gives 2 points, a full house give 10 points. So each players cards are rated and compared ot the other players hands based on that number value. Each card would need a specific face value and suit. I know this is posssible since I created a blackjack game that uses the same concept in detail. Again each hand would be a lot of if() statements. I might give this a go evetually against the computer, but as for multiplayer I probably won't do that. As they said it would be a crazy amount cutins. Unless I could make a varaible for each players hands that the other players could see. For example: .$P1Ace and .$P1Hearts. Then all the players can view cards and see that player 1 had had a Ace of Hearts. This gets into a lot of other issues like if two groups of people try to play at once...

Peopleperson49

Posted

1. Anyway, when I saw the script, if a person becomes the first person ($@tex_player$[1]), then the other players have to wait this person to start the game right?

What if for a reason she/he want to ruin the script, he could idle and not start the game at all, and the NPC can't be used until the function 'tex_reset' is being called, unless there's some kind of 'timeout' timer for that scenario.

2. Is it better to have a waitingroom for this kind of script? Or even warp all the registered player to one or more rooms (table), so it can hold multiple games at once.

Posted
the other problem of course, is the ability to show the players their cards... BMP's aren't very useful here, since you can only show one at a time... so you would have to have an image for every possible combination... (lots o images... hooray!) and text based games, just aren't very fun...

text names, rawr!

0eyWW.png

poring_w01,100,110,0	script	test	910,{
callsub C_initdeck;
callsub C_shuffledeck;
callsub N_debugdeck;
set .@card$, callsub(C_getnextcard);
mes ".@card$ = " + .@card$;
mes callsub(C_card2name,.@card$,1);
close;


// Card functions
C_card2name:
set .@suit$, substr(getarg(0), 0,0);
if (set(.@show_color, getarg(1,0)))
	set .@color$, (.@suit$=="h" || .@suit$=="d") ? "^FF0000" : "^000000";
return ((.@show_color ? .@color$ : "") + .denomination$[axtoi(substr(getarg(0), 1,1))] + " of " + getd(".suit_"+.@suit$+"$") + (.@show_color ? "^000000" : ""));

C_initdeck:
deletearray .deck$[0], 128;
setarray .deck$[0], "s2","s3","s4","s5","s6","s7","s8","s9","sA","sB","sC","sD","sE",
                    "h2","h3","h4","h5","h6","h7","h8","h9","hA","hB","hC","hD","hE",
                    "d2","d3","d4","d5","d6","d7","d8","d9","dA","dB","dC","dD","dE",
                    "c2","c3","c4","c5","c6","c7","c8","c9","cA","cB","cC","cD","cE";
return;

C_shuffledeck:
// generate the random order
for (set .@i,0; .@i < getarraysize(.deck$); set .@i,.@i+1) {
	while (set(.@rand,rand(1,getarraysize(.deck$))) == getd(".@__tmp_"+.@rand));
	setd ".@__tmp_"+.@rand, set(.@array[.@i],.@rand);
}
// arrange the cards in that order
copyarray .@deck$[0], .deck$[0],getarraysize(.deck$);
for (set .@i,0; .@i < getarraysize(.@array); set .@i,.@i+1)
	set .deck$[.@i], .@deck$[.@array[.@i]-1];
return;

C_orderbysuit:
// groups an array of cards by Suit then orders by value


C_getnextcard:
// returns the next card off the top of the deck (array element 0)
set .@card$, .deck$[0];
deletearray .deck$[0], 1;
return .@card$;


// Player functions
P_quitgame:
// npc keeps money




// NPC functions
N_debugdeck:
for (set .@i,0; .@i<getarraysize(.deck$); set .@i,.@i+1)
	set .@string$, .@string$ + .deck$[.@i]+",";
debugmes .@string$;
return;

OnInit:
set .suit_s$, "Spades";
set .suit_h$, "Hearts";
set .suit_d$, "Diamonds";
set .suit_c$, "Clubs";
setarray .denomination$[2], "2","3","4","5","6","7","8","9","10",
                            "Jack", "Queen", "King", "Ace";
set .hand_name$[10],"Royal Flush";
set .hand_name$[9], "Straight Flush";
set .hand_name$[8], "Four of a Kind";
set .hand_name$[7], "Full House";
set .hand_name$[6], "Flush";
set .hand_name$[5], "Straight";
set .hand_name$[4], "Three of a Kind";
set .hand_name$[3], "Two Pair";
set .hand_name$[2], "One Pair";
set .hand_name$[1], "High Card";
end;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...