-
Re: Flickering Buttons: How Do I Get Rid Of Them?
You also say "The oldBlueCardValue (in this case) is supposed to read the CardRank (as in the FillCardRank) and not the card sequence values (24, 13, 29, 21, etc.)".
In all other cases oldBlueCardValue is the 24, 13, 29, 21, etc., so why is this case different?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
That doesn't happen now. If that is what should happen shouldn't we fix that problem first?
Yes, we should fix this problem.
Quote:
Originally Posted by
MartinLiss
In all other cases oldBlueCardValue is the 24, 13, 29, 21, etc., so why is this case different?
I shall explain more clearly:
It's possible that when the King of Clubs was the original base card, and called it higher, the result was the 2 of Clubs.
When the blue player won the next question, the contestant was supposed to start from the King of Clubs. But instead, it actually continued from where it left off with the last card revealed, being the 2 of Clubs. That is why, despite starting from the King of Clubs, and despite the fact that it was called lower, and it was a 5 of Hearts, it actually set off the LowerWrongCards sub as if it read that 5 of Hearts is higher than 2 of Clubs, and not 5 of Hearts being lower than the King of Clubs.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Okay let's fix the "king of clubs" problem. I want to make sure I understand how it should work.
Let's say that after the shuffles are done that the first blue cards in the deck are
King of Clubs
2 of Clubs
5 of hearts
10 of clubs
and the first red cards are the
10 of hearts
3 of hearts
2 of hearts
king of clubs
6 of diamonds
So after the king of clubs shows up for the blue player and he guesses higher and the 2 of clubs shows up which makes his guess wrong, if I understand you correctly the 1st red card dealt to the red player should be the king of clubs.
Here's my question. If we show the king of clubs, what do we do with the order of the cards in the red deck? Note that in my example decks above the red king of clubs is meant to be dealt as the 4th red card and not the first. Do we
1) Swap the red 10 of hearts with the red king of clubs, or
2) Replace the blue deck with the red deck and sometime later reshuffle the blue cards, or
3) Skip to the 4th card in the red deck so that the next red card after the king of clubs should be the 6 of diamonds, or
3) Something else?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
Here's my question. If we show the king of clubs, what do we do with the order of the cards in the red deck? Note that in my example decks above the red king of clubs is meant to be dealt as the 4th red card and not the first. Do we
1) Swap the red 10 of hearts with the red king of clubs, or
2) Replace the blue deck with the red deck and sometime later reshuffle the blue cards, or
3) Skip to the 4th card in the red deck so that the next red card after the king of clubs should be the 6 of diamonds, or
3) Something else?
There really is no problem with the King of Clubs. That problem is fixed. But to answer your question, the deck starting with the King of Clubs is only for testing purposes. The same first few blue cards (starting with the King of Clubs) should be used as RedCards(#) also.
Quote:
Originally Posted by MartinLiss
So after the king of clubs shows up for the blue player and he guesses higher and the 2 of clubs shows up which makes his guess wrong, if I understand you correctly the 1st red card dealt to the red player should be the king of clubs.
That is correct. Again, it's for testing purposes.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I understand about the king of clubs. The cards I talked about were only an example. Just to be sure that I understand, let me try another example.
First 3 cards in the blue deck
7 of spades
8 of spades
9 of spades
First 3 cards in the red deck
10 of hearts
jack of hearts
queen of hearts
When the 7 of spades comes up the blue player guesses lower and is wrong.
Question #1: Is the following what should happen next?
The red card deck is replaced by the blue card deck and so the red card deck becomes
7 of spades
8 of spades
9 of spades
The blue card deck is shuffled so the first few cards could be anything, for example
2 of spades
3 of spades
4 of spades
Question #2:
The Red player whose turn it is now has seen the fact that the card after the 7 of spades is the 8 of spades. So if we give the red player the 7 of spades to start with, isn't he/she going to know that the next card is higher?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Here are the answers:
Quote:
Question #1: Is the following what should happen next?
The red card deck is replaced by the blue card deck and so the red card deck becomes
7 of spades <== oldRedCardValue should be recorded as 06
8 of spades <== oldRedCardValue should be recorded as 07, but only briefly. As the card is removed, the oldRedCardValue should be reset to 06.
9 of spades <== When the contestant wins his next question (or the next question he wins), he starts from the 7 of Spades (oldRedCardValue should be 06 at this point, until the player guesses higher, then the oldRedCardValue should become 08 (for 9 of Spades); but if the player guesses lower than the 7 of Spades, the oldRedCardValue is set at 08 but for only a very brief period, then the 9 of Spades is removed, leaving only the 7 of spades with the oldRedCardValue being reset to 06 (as in the card rank)
And I think this task should be done with random cards eventually. The card sequence value (0 to 51) is not the primary element in determining the oldRedCardValue or the oldBlueCardValue. It is the value in the Card Rank (01 to 13) that is the primary key.
Quote:
Question #2:
The Red player whose turn it is now has seen the fact that the card after the 7 of spades is the 8 of spades. So if we give the red player the 7 of spades to start with, isn't he/she going to know that the next card is higher?
Because the fact being the 7 of Spades vs. the 8 of Spades, we only call the card lower just for testing purposes. Of course we know it's going to be higher. But after a successful testing of the cards, the cards should be done randomly once shuffled.
And the oldRedCardValue (and the blue) should be reset, and should be fixed in the RemoveCards sub. You might want to check it out.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I'm sorry but you didn't answr my questions in post #305.
Let's forget about old card values for now. Let's just assume that the 2 of spades shows up for the blue player and he stupidly guesses lower and so it becomes the red players turn. What should the red player see for the first two of his cards?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
I'm sorry but you didn't answr my questions in post #305.
Let's forget about old card values for now. Let's just assume that the 2 of spades shows up for the blue player and he stupidly guesses lower and so it becomes the red players turn. What should the red player see for the first two of his cards?
I'm sorry, but I don't understand the questions clearly, and I don't think it has anything to do with the problem I am trying to fix.
But to answer Question #1 to the best of my knowledge, the red deck does is not supposed to be replaced with the blue deck, or vice versa. The same red deck is used for each individual round.
Quote:
Originally Posted by MartinLiss
Let's forget about old card values for now. Let's just assume that the 2 of spades shows up for the blue player and he stupidly guesses lower and so it becomes the red players turn. What should the red player see for the first two of his cards?
For testing purposes, the same sequence as the blue player's deck of cards. To sum it up, the 2 of Spades should be the first (base) card for the red player.
Did I answer Question #2 in this post? If I didn't, I apologize. I just couldn't understand the question well.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Let me try to explain visually what I am asking one more time.
In the following the two rows are the cards that we see in the game. Also in the following something like "7s" means that a player can see the seven of spades and "(8s)" means that the 8 of spades is one of the next few cards in the deck that are set up to be shown.
1) The guessing starts and it is blue's turn
(10h) (Jh) (Qh) (2c) (Qd)
7s (8s) (9s) (Kh) (4d) (Jc)
2) The blue player sees the 7 of spades and he/she guesses lower
(10h) (Jh) (Qh) (2c) (Qd)
7s 8s (9s) (Kh) (4d) (Jc)
Since the 7 of spades is not lower than the 8 of spades it becomes the red player's turn.
Can you show me what the two rows of cards should look like when the red player takes over both before and after the red player's first guess?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
The answer to your question (and thanks for providing a visual example):
1) The blue player finishes his/her turn, and the red player guessing starts as it is red's turn
10h (Jh) (Qh) (2c) (Qd)
7s (8s) (9s) (Kh) (4d) (Jc)
2) The red player sees the 10 of hearts and he/she guesses lower
10h Jh (Qh) (2c) (Qd)
7s 8s (9s) (Kh) (4d) (Jc)
Since the Jack of hearts is not lower than the 10 of hearts the game goes to the next question (Question #2 in this case).
The red player can still win the first question. If a red player guesses the numeric answer in the first survey question (like, 3, for example), the blue player guesses, say, higher, and the result is 2, which means the answer would be lower, and the red player wins control of the first play of the cards.
1) The guessing starts and it is red's turn
10h (Jh) (Qh) (2c) (Qd)
(7s) (8s) (9s) (Kh) (4d) (Jc)
2) The red player sees the 10 of hearts and he/she guesses lower
10h Jh (Qh) (2c) (Qd)
(7s) (8s) (9s) (Kh) (4d) (Jc)
Since the Jack of Hearts is not lower than the 10 of Hearts, the blue player has a free turn at the cards.
1) The blue guessing starts as it is blue's turn
10h (Jh) (Qh) (2c) (Qd)
7s (8s) (9s) (Kh) (4d) (Jc)
2) The blue player sees the 7 of Spades and he/she guesses lower
10h Jh (Qh) (2c) (Qd)
7s 8s (9s) (Kh) (4d) (Jc)
Since the 8 of spades is not lower than the 7 of spades, both players have had their turn at the cards with no success, and the game moves on to Question #2.
I hope this clears things up a bit.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Thanks for bearing with me. I understand now how it should work.
I got confused somewhere along the way and thought that if, say, the blue player sees the Kc, guesses higher, and he/she loses his/her turn, that the the Kc should be come the card that the red player starts with.
I understand now that no cards get switched that way.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Well, at least there's some progress now.
I look forward to getting the updated code in the hopefully near future.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I found 2 more bugs. In both HigherRightCards and LowerRightCards we were always using the name of the red player so change those subs like below.
If you run the code after making this change is what you described in post #299 is still a problem? If so send me your code so that I can compare it with mine.
Code:
Private Sub LowerRightCards()
SetDialog lblDialog(1).Caption & vbCrLf & "Yes! It is lower!"
Me.Refresh
PlaySound App.Path & "\sounds\ding.wav", ByVal 0&, SND_SYNC Or SND_FILENAME
'new4 bug
' SetDialog RName & ", Higher or Lower?"
If WhosTurn = RedPlayer Then
SetDialog RName & ", Higher or Lower?"
Else
SetDialog BName & ", Higher or Lower?"
End If
cmdChangeCd.Visible = False
cmdChangeCd.Enabled = False
cmdHigherCds.Visible = True
cmdHigherCds.Enabled = True
cmdLowerCds.Visible = True
cmdLowerCds.Enabled = True
' This is where the freeze button stays only briefly after the second card on the row is revealed. The Freeze button stays fixed when or after the third card on the row is revealed.
cmdFreezeRCd.Visible = True
cmdFreezeRCd.Enabled = True
End Sub
Private Sub HigherRightCards()
SetDialog lblDialog(1).Caption & vbCrLf & "Yes! It is higher!"
Me.Refresh
PlaySound App.Path & "\sounds\ding.wav", ByVal 0&, SND_SYNC Or SND_FILENAME
'new4 bug
' SetDialog RName & ", Higher or Lower?"
If WhosTurn = RedPlayer Then
SetDialog RName & ", Higher or Lower?"
Else
SetDialog BName & ", Higher or Lower?"
End If
cmdChangeCd.Visible = False
cmdChangeCd.Enabled = False
cmdHigherCds.Visible = True
cmdHigherCds.Enabled = True
cmdLowerCds.Visible = True
cmdLowerCds.Enabled = True
' This is where the freeze button stays only briefly after the second card on the row is revealed. The Freeze button stays fixed when or after the third card on the row is revealed.
cmdFreezeRCd.Visible = True
cmdFreezeRCd.Enabled = True
End Sub
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I went ahead and added most of the code necessary to have the computer be the blue player. This computer player makes random higher/lower guesses for the questions and odds-based guesses for the higher/lower cards.
The computer player could be made a lot smarter (by cheating) since the answers to the questions are in the files we read and of course we know the next card that's going to come up.
I don't think it would be fun to play against the computer if the computer was 100% right all the time but we could set it's "smartness" to someplace between it's current 50% and 100%.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
And not only did you do a good job with adding the AI player, but also I am impressed with how you were able to successfully fix the oldRedCardValue (and maybe oldBlueCardValue) problem with regards to executing the appropriate subs.
I will try a few more test runs tomorrow, and I will give a definite progress report hopefully by tomorrow night.
Oh, and I am considering adding avatar players for the contestant podiums. I am using images of avatars I have retrieved from Second Life for the game. I am also considering using a series of names for a certain gender (in this case, female). I do prefer to have the program select a female name from a random set of 14 female names. Here is the code I have thus far:
Code:
Private Sub BComputer_Click()
Dim CPUName As Integer
Randomize
'ai
Select Case CPUName
Case Peggy
BName.Text = "Peggy"
Case Rachelle
BName.Text = "Rachelle"
Case Deborah
BName.Text = "Jessica"
Case Shannon
BName.Text = "Shannon"
Case Stacy
BName.Text = "Stacy"
Case Jasmine
BName.Text = "Jasmine"
Case Kelly
BName.Text = "Kelly"
Case Ciara
BName.Text = "Ciara"
Case Erika
BName.Text = "Erika"
Case Danielle
BName.Text = "Danielle"
Case Lindsay
BName.Text = "Lindsay"
Case Misty
BName.Text = "Misty"
Case Nikki
BName.Text = "Nikki"
Case Robyn
BName.Text = "Robyn"
End Select
BName.Enabled = False
gbComputerPlaying = True
End Sub
How do I allow the program to select from the 14 female names at random?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Thanks:)
Code:
Private Sub BComputer_Click()
'ai
Dim CPUName As String ' Note String
Dim strNames(12) As String
strNames(0) = "Peggy"
strNames(1) = "Rachelle"
strNames(2) = "Jessica"
strNames(3) = "Shannon"
strNames(4) = "Stacy"
strNames(5) = "Jasmine"
strNames(6) = "Ciara"
strNames(7) = "Erika"
strNames(8) = "Danielle"
strNames(9) = "Lindsay"
strNames(10) = "Misty"
strNames(11) = "Nikki"
strNames(12) = "Robyn"
'Randomize You don't need this because there is already one in the program
CPUName = strNames(Int((UBound(strNames) - 1) * Rnd))
BName.Enabled = False
gbComputerPlaying = True
End Sub
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I tried the code, and it doesn't seem to work. I click the Computer Plays option for the blue player, and I cannot randomly choose a name, as I get the default name (in my case, "Peggy") all the time.
Also, I don't think it's necessary to have the RName and BName text boxes set to SetFocus, as I believe doing so may cause the blue player name to not be selected at random.
I'll send you the files and see what can be done about it.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Code:
Private Sub BComputer_Click()
'ai
Dim strNames(12) As String
strNames(0) = "Peggy"
strNames(1) = "Rachelle"
strNames(2) = "Jessica"
strNames(3) = "Shannon"
strNames(4) = "Stacy"
strNames(5) = "Jasmine"
strNames(6) = "Ciara"
strNames(7) = "Erika"
strNames(8) = "Danielle"
strNames(9) = "Lindsay"
strNames(10) = "Misty"
strNames(11) = "Nikki"
strNames(12) = "Robyn"
BName.Text = strNames(Int((UBound(strNames) - 1) * Rnd))
BName.Enabled = False
gbComputerPlaying = True
End Sub
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
BTW why only women's names for the blue player? I know the avatar is currently a woman but won't that eventually be changed?
In any case my thoughts about the computer player are these. As I said above, the current ai gets things right about 50% of the time. I thought it would be fun to implement giving the human player a choice of several computer opponents of varying intelligence like the following
HAL 9000 - 80%
Deep Blue - 60%
MAC CPU - 40%
PC CPU - 20%
Coin Flip -0%
where the percent is the percentage of the time where the computer cheats by looking at the answer or looking at the next card before it is shown.
In case you don't know HAL 9000 was the name of the evil ai in the movie 2001: A Space Odyssey and Deep Blue is the name of an IBM computer that was the first one to defeat a reigning chess world champion.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
In case you don't know HAL 9000 was the name of the evil ai in the movie 2001: A Space Odyssey and Deep Blue is the name of an IBM computer that was the first one to defeat a reigning chess world champion.
I knew about the 2001: A Space Odyssey computer, as I remember learning that on a certain game show, or most likely a clue in a crossword puzzle. And I remember learning about Deep Blue on the game show Where In The World is Carmen Sandiego? back in 1991 (the first season of the series, to be exact).
I will be using Male names/avatars eventually. It's just building them in one step at a time.
Also, I do need some more help, though...
I need to know how to use public integers in a global module - so that I could carry information from form to form. It turns out that I may need to use separate forms for each round after all. I have the Round 1, Round2B, and Round2R forms thus far (Round2B means the last question in Round 1 was answered by the red player and the blue player would start off Round 2. Vice versa for Round2R form).
The integers whose corresponding information I would like to carry from form to form are:- RWin
- BWin
- RDScore
- BLScore
Quote:
Originally Posted by MartinLiss
In any case my thoughts about the computer player are these. As I said above, the current ai gets things right about 50% of the time. I thought it would be fun to implement giving the human player a choice of several computer opponents of varying intelligence like the following
HAL 9000 - 80%
Deep Blue - 60%
MAC CPU - 40%
PC CPU - 20%
Coin Flip -0%
That would be a great idea, Martin! Allow for varying percentages so that sometimes an AI player will be wrong, have a low probability of being right, or be very highly right.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Could you explain in detail why you feel you need to use separate forms for each round?
Global variables that you can use to pass data from form to form are easy to implement. Just put things like
Code:
Public BLScore As Integer ' if integer is the right type
in GameEssentials.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by MartinLiss
Could you explain in detail why you feel you need to use separate forms for each round?
Perhaps because it's easier for me to keep track instead of having to go through large volumes of code?
Also, this morning, I realized a problem with the executing of the wrong vs. right subs again - only this time it occurs somewhere in round two, and when both rounds 1 and 2 are consolidated onto one form. I also discovered that using the NameCard function in the GameEssentials may not work on a consolidated form or on multiple forms, but it may work better using the NameCard as a private function on each sub. That may be why I might be having all these issues with setting off the wrong subs vs. the right subs.
And thanks for the help on the Public variable. :)
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
BTW, I did a test run with the public variables. While the blue player did win the first round (the first form), and added $100 to the blue player's score plus added 1 to the BWin, when Round2 form was set off, the variables didn't carry over.
Is it possible I have to place the following into the Form_Load section:
Code:
RWin = RWin
BWin = BWin
RDScore = RDScore
BLScore = BLScore
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
To give you a visual example of why the information is not carrying over to subsequent forms, is it okay if I send you the latest files in the morning?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
JonSea31
BTW, I did a test run with the public variables. While the blue player did win the first round (the first form), and added $100 to the blue player's score plus added 1 to the BWin, when Round2 form was set off, the variables didn't carry over.
Is it possible I have to place the following into the Form_Load section:
Code:
RWin = RWin
BWin = BWin
RDScore = RDScore
BLScore = BLScore
No. If you create a Public variable in GameEssentials named (for example) BLScore and in Form1 (for example) you do BLScore = 100, then the value of 100 is available to any form or any code module from that point on. So if for example you did MsgBox BLScore in Form2 you would see 100.
-
1 Attachment(s)
Re: Flickering Buttons: How Do I Get Rid Of Them?
I made several mistakes in the CSInfo form when I added cboCPU. I've attached a form with corrected code that you should use instead of my old one.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Also, I am still struggling to figure out how to carry information over from form to form - like how many rounds the blue (or red) player has won thus far, and the cash totals (including bonuses for exact guesses). But there must be a way to carry over such information without having to rely on Label captions. Can I get some help on this? I tried to code it, but to no avail.
And thanks for the latest delivery, Marty. ;)
-
1 Attachment(s)
Re: Flickering Buttons: How Do I Get Rid Of Them?
I've attached an example.
You didn't answer my question which was "Why do you think you need multiple forms"?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
You didn't answer my question which was "Why do you think you need multiple forms"?
Actually, I think I did. But sorry for misleading by ending what I answered with with a question mark. Here was my response:
Quote:
Originally Posted by
JonSea31
Perhaps because it's easier for me to keep track instead of having to go through large volumes of code?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Assuming you have multiple forms for games/questions that are mostly the same, you will most likely wind up with much more code to maintain than if you have only one form. But it's your choice of course.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Talking about the $100 exact guess bonus, here is what happens now. Red player's name is Marty, Blue Players name is Fred.
- Game starts
- Question is: "Do you keep a secret stash of cookies?"
- Marty guesses 5 (which is exactly right)
- Blue player says higher (or lower, it doesn't matter)
- Program says: "Marty got it right on the nose! Fred wins a $100 bonus"
That comes from this line of code:
Code:
SetDialog RName & " got it right on the nose! " & BName & " wins a $100 bonus!"
BName in that line should be RName, right?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
^ Ah, I see what you mean.
Yes, the BName should be RName on that line.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Okay that line (or one like it with a $500 bonus) occurs 4 times in the app and I've changed them in my copy. All 4 now refer solely to the red player. Can the blue player ever get a bonus?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
Okay that line (or one like it with a $500 bonus) occurs 4 times in the app and I've changed them in my copy. All 4 now refer solely to the red player. Can the blue player ever get a bonus?
Both players should have an equal chance to receive a $100 (or $500) bonus (including the AI player).
And btw, I did do a revamp of the code, and it allows each player a fair chance of winning the $100/$500 bonus for an exact guess.
And as for the AI player and its intelligence level, I say "Deep Blue" is the route to go. At least it will allow a slightly higher probability - a ratio of 60:40 - of the AI player being right.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
JonSea31
Both players should have an equal chance to receive a $100 (or $500) bonus (including the AI player).
And btw, I did do a revamp of the code, and it allows each player a fair chance of winning the $100/$500 bonus for an exact guess.
And as for the AI player and its intelligence level, I say "Deep Blue" is the route to go. At least it will allow a slightly higher probability - a ratio of 60:40 - of the AI player being right.
My idea for the computer player was to allow the human player to choose the computer he plays against, rather than there being just one.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
You are missing the code to display the "on the nose" message for the blue player. You should add that in your version of the code.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
You are missing the code to display the "on the nose" message for the blue player. You should add that in your version of the code.
I'm already a step ahead on that one. I did that yesterday, in fact.
I also replaced the "BName" with "RName" on what you pointed out in Post #331.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
BTW, I decided that the "Deep Blue" AI player cheat percent level of 60% being right is probably the best route to go in this game. That will put some excitement into the game, and at least doing that will allow the AI player to have almost an equal chance to win or lose (and a very slim margin between 60% right/40% wrong).
However, is there any way I could use the cheat percent level of 60% with these players?
Code:
Private Sub BComputer_Click()
'ai
Dim strNames(13) As String
strNames(0) = "Peggy"
strNames(1) = "Rachelle"
strNames(2) = "Deborah"
strNames(3) = "Jessica"
strNames(4) = "Shannon"
strNames(5) = "Stacy"
strNames(6) = "Jasmine"
strNames(7) = "Ciara"
strNames(8) = "Erika"
strNames(9) = "Danielle"
strNames(10) = "Lindsay"
strNames(11) = "Misty"
strNames(12) = "Nikki"
strNames(13) = "Robyn"
BName.Text = strNames(Int((UBound(strNames) - 1) * Rnd))
BName.Enabled = False
gbComputerPlaying = True
End Sub
Also, I am going to use Male AI Players, and that is what the other combo box on the CSInfo form is designed for - it is designed for selecting the male or female AI player (yes, the human player can choose the male or female player in this game, but when the gender is chosen, it randomly selects a name for that particular gender.
I just revamped some of the code (though I tweaked it on a Notepad document, but is not on the code yet):
Code:
Private Sub BComputer_Click()
'ai
Dim strFNames(13) As String
Dim strMNames(13) As String
strFNames(0) = "Peggy"
strFNames(1) = "Rachelle"
strFNames(2) = "Deborah"
strFNames(3) = "Jessica"
strFNames(4) = "Shannon"
strFNames(5) = "Stacy"
strFNames(6) = "Jasmine"
strFNames(7) = "Ciara"
strFNames(8) = "Erika"
strFNames(9) = "Danielle"
strFNames(10) = "Lindsay"
strFNames(11) = "Misty"
strFNames(12) = "Nikki"
strFNames(13) = "Robyn"
strMNames(0) = "Paul"
strMNames(1) = "Ryan"
strMNames(2) = "Devon"
strMNames(3) = "Jonathan"
strMNames(4) = "Steve"
strMNames(5) = "Scott"
strMNames(6) = "James"
strMNames(7) = "Chris"
strMNames(8) = "Evan"
strMNames(9) = "David"
strMNames(10) = "Louis"
strMNames(11) = "Michael"
strMNames(12) = "Nick"
strMNames(13) = "Robert"
BName.Text = strFNames(Int((UBound(strFNames) - 1) * Rnd))
BName.Text = strMNames(Int((UBound(strMNames) - 1) * Rnd))
BName.Enabled = False
gbComputerPlaying = True
End Sub
Now how do I allow the strFNames to appear when the user selects the female option on the combo box, and same for the male option for strMNames? And remember, it's better to use 60% cheat percent all the way for the AI player. It's great to be consistent.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Well any time gbComputerPlaying is True you know the computer is playing. So all you need to do is to just replace
Code:
If gbComputerPlaying Then
gintCheatPct = cboCPU.ItemData(cboCPU.ListIndex)
End If
with
Code:
If gbComputerPlaying Then
gintCheatPct = 60
End If
EDIT: Actually instead of doing gintCheatPct = 60, you could just make gintCheatPct a Const with a value of 60.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
If that last post confuses you, please let me know.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
^ Didn't confuse me at all. Thanks.
Now, on to adding the AI gender. I explained in my last post how I would like to use the names of AI gender players (male names for male gender, and female names for female gender). Also, I plan on using some audio files that mention "he"/"she", "him"/"her", which is why gender players are good in this aspect.
Also, human players can be set to allow either gender to play, but they have to select an avatar of the same gender from a dropdown menu (which will be worked on later).
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
In post #338 you show code that creates to arrays of names, one for male and the other female. Unless you want to show the user two separate lists, there's no need to do that.
Do you still have the code where I assigned 0, 20, 40, 60 and 80 values to cboCPU ItemData values? If so you could do something similar. Using (and changing) the names in cboCPU you could do this:
Code:
cboCPU.AddItem "Peggy"
cboCPU.ItemData(0) = 0 ' where 0 = female
cboCPU.AddItem "Ryan"
cboCPU.ItemData(1) = 1 ' where 1 = male
'etc
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Thinking about the computer player names, why would anyone want to choose one name over the other if they all play the same way? If you don't want different cheat levels then why not have just one computer name and give it a level of 60.
If you haven't thought about this already, here's an idea for the human player selection. When they enter or choose a name, display a form that contains thumbnails of all the available avatars and let them pick the one they want. This should be remembered from game to game and there should also be a facility to change avatar without changing the name.
When you send me your new code, include a few avatars and I could do that coding for you if you like.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I have to work on creating contestant avatars, and that may take a few days. I will consider putting in 6, maybe 7, avatars for each gender. I do have 2 done already for each gender (including the individual male and female avatars in the last many deliveries), so I will only need to come up with 5 more for each gender.
As for the AI player's avatar, maybe that avatar player can be chosen at random, but given a choice of 3 random names for each gender.
I know that the Wheel of Fortune game for basic computers back in the 1980s used different names for their corresponding gender. Basic versions of Jeopardy!, Classic Concentration, and Card Sharks had the contestants' names and their corresponding avatar based on their gender randomly selected for the computer player. Human players could choose their avatar and their name, as they have that option.
Quote:
Originally Posted by MartinLiss
Do you still have the code where I assigned 0, 20, 40, 60 and 80 values to cboCPU ItemData values?
I believe I do still have it (gotta love doing frequent backups). I will edit that part very soon.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
While I will be creating some more contestant avatars in the coming days, I have another dilemma I'd like to figure out.
Every time a contestant becomes the champion by winning two out of three rounds, I get a type mismatch error on the line bolded in red in the following code:
Code:
GetMatchWinCue2
RWinTotal = RWinTotal + 1
Wait 2000
SetDialog "Congratulations, " & RName & "! You are the champion!"
BFreezeBar.Visible = False
RFreezeBar.Visible = False
For i = 0 To 4
RCard(i).Visible = False
BCard(i).Visible = False
Next
For i = 0 To 1
lblRName(i).Visible = True
lblBName(i).Visible = True
RScore(i).Visible = True
BScore(i).Visible = True
Next
lblRNameBar.Visible = False
lblBNameBar.Visible = False
RBorder.Visible = True
BBorder.Visible = True
cmdHigherCds.Visible = False
cmdHigherCds.Enabled = False
cmdLowerCds.Enabled = False
cmdLowerCds.Visible = False
cmdFreezeCd.Visible = False
cmdFreezeCd.Enabled = False
Set RBorder.Picture = RDBorderDim
Set BBorder.Picture = BLBorderDim
Set QPodium.Picture = QCard4
QPodium.Visible = True
RedAvatar.Visible = True
Set RedAvatar.Picture = MaleAV1
BlueAvatar.Visible = True
Set BlueAvatar.Picture = FemaleAV1
XB.Visible = True
For lngblink = 1 To 16
Set Picture1.Picture = RDBkgdFlash
Set XR.Picture = RedX
XR.Visible = True
Wait 200
Set Picture1.Picture = BkgdBothDim
Set XR.Picture = BlankX
XR.Visible = True
Wait 200
Next
Set XR.Picture = RedX
XR.Visible = True
Wait 500
RDScore = RDScore + 100
For i = 0 To 1
RScore(i).Caption = "$" & RDScore
Next
ChampMoney = RDScore
ChampName = CSInfo.RName.Text
Wait 2000
SetDialog RName & " will be playing the Money Cards in just a minute..."
Wait 3000
If BLScore = 0 Then
SetDialog BName & ", you played a fine game, and we have some lovely parting gifts for you and our thanks for being here."
Else
SetDialog BName & ", you played a great game, and you have $" & BLScore & ", and our thanks for being here!"
End If
Wait 3000
SetDialog "Now, let's go to the Money Cards!"
Wait 3000
If Gameplay = 1 Then
MC86.Show
ElseIf Gameplay = 2 Then
MC88.Show
End If
I have a global variable in the GameEssentials9 module, and it says:
Code:
Public ChampName As Integer
Where did I go wrong, and why did I receive the Type Mismatch error? Should the "Integer" really be something else?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Integers are numbers and so since you want to store text in it you should have done
Public ChampName As String
(I would name it gstrChampName. Where "g" is for global and "str" is for String. In that way by looking at it you know 1) that it's it is in a code module and has global scope, and 2) that it contains a string).
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I haven't been creating the contestant avatars much this past week, as I was busy enhancing the "Card Sharks Challenge Game" form files to allow for a scoring format that is not exactly like the game show but very darn close.
Also, I learned very recently that Card Sharks (the game show) is played similar to the popular card game Acey Deucey. I downloaded a sample code for Acey Deucey somewhere on the Internet just now, and I am going to assess it to see if it functions the way I prefer it to, and if the code is better than my version (originally created by technorobbo, btw), I will probably consider using that code by copying/pasting it onto my code (assuming I do a backup first, which I have).
However, are there other Acey Deucey VB games that I could download somewhere?
As for the show, I found out it's returning to Game Show Network on April 1st (and it's no April Fool's joke, btw).
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Martin, sorry I have been delayed on creating the avatars, but I have been working on repairing the code to allow the higher/lower calls to function properly. I'll do a series of thorough test runs before the weekend, and see what happens from there.
In the meantime, I was working on the Money Cards form and updating it to reflect the newer version of code (which I got from an Acey Deucy game I downloaded last Sunday). However, there are a few problems with the newer version of the Money Cards form:
1. When a contestant changes his/her card on any of the 3 rows, and that card is changed to a Joker, the Joker should be replaced, and the red card back should display, and the contestant should be able to have the option to change the same card (or another of the remaining available), or stick with the card and call it higher or lower.
2. When the third card on the second row (CurrentSlot = 7) is revealed, the MC(8) picture automatically moves to the MC(9) slot when really the contestant should have the option to call it higher or lower (or change it if the cmdChangeMC button is enabled and not used on that row).
I am sending you the updated code by PM, and you can see for yourself where I may have went wrong, and what else needs to be fixed.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
I fixed part of the code where the card at the end of a row gets moved to the beginning of the next row yesterday. But the replacing of the card whenever a Joker gets revealed is still a problem to me.
When a joker is revealed after the player calls the next card higher or lower, or when a joker is revealed on the first card of the bottom row at the start of the Money Cards:
- The card should be replaced and not revealed, and the contestant should have the option to call higher, lower, or change (if a contestant had not changed on that row already).
When a joker is revealed during a card changing transaction:
- the empty change card slot (1, 2, or 3) should be reloaded by replacing the sp#-empty.gif with the sp#-full, and the contestant should have the right to change the same card or any other spare card available. The new card result should not be revealed at all unless prompted.
I'll be sending the updated files later today, so some work will already have been done on the Money Cards forms.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Just discovered now that when a Joker is revealed on the turn of the next card, that sngCard is recorded as 14 (for Joker), after getting an Ace on the first card on the bottom row (in CurrentSlot = 1). I wagered $200 lower than the Ace (sngCard = 13), and the next card result (in CurrentSlot = 2) was a Joker (sngCard = 14). The sngCard should be cleared immediately or, if possible, not given a numeric value such as 14. At least, you could try giving it a string name such as strMoneyCd = Joker, so that a non-numeric value would be recorded as potentially higher or lower. When a joker is revealed, the card should be reloaded showing the back of the card and the contestant should be prompted to re-bet his/her money and call the next card higher or lower than the previous card value in the last slot.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Martin, just want to ask you: did you receive my last PM delivery? You haven't replied to me lately, so I presume you're busy with other projects as of lately?
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Yes I did and I'm going to download it now. I am busy but if you have a specific problem you want me to look at please post it or refer me back to a previous post and I'll try to take a look.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
The zip is missing Eggcrate.ttf. It runs okay if I comment out the line that uses it so I don't need a whole new zip, just that file.
-
1 Attachment(s)
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
MartinLiss
The zip is missing Eggcrate.ttf. It runs okay if I comment out the line that uses it so I don't need a whole new zip, just that file.
Attached. :)
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Okay I have the file.
Let me make a suggestion that will decrease the amount of code in the project. Currently you have Dim-ed sngCard1 As Single, sngCard2 As Single, sngCard3 As Single, sngCard4 As Single, sngCard5 As Single, sngCard6 As Single, sngCard7 As Single, sngCard8 As Single, sngCard9 As Single, sngCard10 As Single and you have code like this
Code:
Private Function CallChange()
If CurrentSlot = 1 Then
Call GetCard
sngCard1 = sngCard
sngCardSuit1 = sngCardSuit
MC(1).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard1
ElseIf CurrentSlot = 2 Then
Call GetCard
sngCard2 = sngCard
sngCardSuit2 = sngCardSuit
MC(2).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard2
ElseIf CurrentSlot = 3 Then
Call GetCard
sngCard3 = sngCard
sngCardSuit3 = sngCardSuit
MC(3).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard3
ElseIf CurrentSlot = 5 Then
Call GetCard
sngCard5 = sngCard
sngCardSuit5 = sngCardSuit
MC(5).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard5
ElseIf CurrentSlot = 6 Then
Call GetCard
sngCard6 = sngCard
sngCardSuit6 = sngCardSuit
MC(6).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard6
ElseIf CurrentSlot = 7 Then
Call GetCard
sngCard7 = sngCard
sngCardSuit7 = sngCardSuit
MC(7).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard7
ElseIf CurrentSlot = 9 Then
Call GetCard
sngCard9 = sngCard
sngCardSuit9 = sngCardSuit
MC(9).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard9
End If
End Function
If you replaced those Dims for sngCard1 through sngCard10 with Dim sngCard(1 to 10) As Single (and do the same for sngCardSuit1 through sngCardSuit10) you could change the function to this
Code:
Private Function CallChange()
Call GetCard
sngCard(CurrentSlot) = sngCard
sngCardSuit(CurrentSlot) = sngCardSuit
MC(CurrentSlot).Picture = LoadPicture(App.Path & strCard)
oldCardValue = sngCard(CurrentSlot)
End Function
BTW, since CallChange doesn't return any value, you should make it a Sub instead of a Function.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Just to provide an update on the progress of the game development (I'm surprised I didn't make a post to this thread in April):
- The problem with the card values is most likely resolved now - thanks to an Acey Deucey code sample I got from the Internet. Using some elements from Acey Deucey, and realizing that Card Sharks is based on Acey Deucey, I solved the problem for the most part.
- I also consolidated the Money Cards with the Main Gameplay onto one form. There are also control arrays for many images, labels, and other stuff - just to trim down the unnecessary controls.
- I now added a video opening this past weekend.
- This past week, I added a way to randomize the question types (Audience Poll, Educated Guess, and "Out of 100 People" Questions) so that there won't have to be a structured format for the questions, but more random question types throughout the game.
- I have also applied a card flipping animation using .GIF frames (12 images per card).
Now, there are only a few minor problems with the game development remaining:
- In the Jokers Car Game, there are two problems that I have to have fixed at some point very soon. More to come on that later.
- The avatar players will be developed very soon. I have developed some still avatar images (5 female and 3 male), and more will be developed in the coming weeks.
- With the AI player (the blue player), the AI player can only guess higher or lower, and/or guess the number during the survey questions. The AI player should also be able to call the cards higher or lower or decide to freeze if the card is not favourable. Same higher/lower guessing should apply for the Money Cards and the car game.
For the Main Gameplay:
- If the card is lower than 9 (not including 9) but higher than 5 (not including 5), the AI player should call it higher or freeze.
- If the card is higher than or equal to 9, but lower than a Jack (not including the Jack), the AI player should choose to call the next card lower or freeze.
In the Money Cards form:
- If the card is lower than 9 (not including 9) but higher than 5 (not including 5), the AI player should call it higher, or change the card on the row if he/she hadn't changed already.
- If the card is higher than or equal to 9, but lower than a Jack (not including the Jack), the AI player should call it lower, or change the card on the row if he/she hadn't changed already.
Martin, if you have time to help me some more, please let me know. :)
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Quote:
Originally Posted by
JonSea31
Just to provide an update on the progress of the game development (I'm surprised I didn't make a post to this thread in April):
- The problem with the card values is most likely resolved now - thanks to an Acey Deucey code sample I got from the Internet. Using some elements from Acey Deucey, and realizing that Card Sharks is based on Acey Deucey, I solved the problem for the most part.
- I also consolidated the Money Cards with the Main Gameplay onto one form. There are also control arrays for many images, labels, and other stuff - just to trim down the unnecessary controls.
- I now added a video opening this past weekend.
- This past week, I added a way to randomize the question types (Audience Poll, Educated Guess, and "Out of 100 People" Questions) so that there won't have to be a structured format for the questions, but more random question types throughout the game.
- I have also applied a card flipping animation using .GIF frames (12 images per card).
Now, there are only a few minor problems with the game development remaining:
- In the Jokers Car Game, there are two problems that I have to have fixed at some point very soon. More to come on that later.
- The avatar players will be developed very soon. I have developed some still avatar images (5 female and 3 male), and more will be developed in the coming weeks.
- With the AI player (the blue player), the AI player can only guess higher or lower, and/or guess the number during the survey questions. The AI player should also be able to call the cards higher or lower or decide to freeze if the card is not favourable. Same higher/lower guessing should apply for the Money Cards and the car game.
For the Main Gameplay:
- If the card is lower than 9 (not including 9) but higher than 5 (not including 5), the AI player should call it higher or freeze.
- If the card is higher than or equal to 9, but lower than a Jack (not including the Jack), the AI player should choose to call the next card lower or freeze.
In the Money Cards form:
- If the card is lower than 9 (not including 9) but higher than 5 (not including 5), the AI player should call it higher, or change the card on the row if he/she hadn't changed already.
- If the card is higher than or equal to 9, but lower than a Jack (not including the Jack), the AI player should call it lower, or change the card on the row if he/she hadn't changed already.
Martin, if you have time to help me some more, please let me know. :)
Tell me what your top-priority problem is and send me a link to the current code and I'll be happy to help if I can.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
Well, it turns out that there is significant progress as of lately. I decided to revamp the AI code so that it can allow the computer player to randomly select numbers from a certain range within the question type. While Martin's code is great, I think I can program the game to be almost similar to the MS-DOS and Commodore 64 versions of the Card Sharks game (released around 1988).
In other words, if a red human player guesses a numeric answer, if that numeric guess is 50 or less, the AI player would automatically guess higher. If the numeric guess is greater than 50, the AI player would automatically guess lower.
During the playing of the cards, if the AI contestant has first shot at the cards after winning the question, and that card was to be a 5 or under, that AI player would automatically guess higher than that card. If the card was to be a Jack or higher, the AI contestant would automatically guess lower. Anything in between (in this case, 6 to 10), the contestant would automatically change the card. If the contestant changed that card, the AI player would have to play it - no if's and's or but's. If a player ended up getting a 6 to 10 along the way, that player would automatically freeze.
When the AI player has a turn to answer a question, I think the AI is supposed to randomly select a number between 1 and 99 (1 to 10 for Audience Poll questions). I am faced with a dilemma, but I will try to fix it myself first.
Martin, when I have a key problem, I will send you a PM with a link to the updated project file with forms. :)
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
My first progress report in nearly two months, and this progress report shows some promising signs of things to come.
The major coding is very nearly completed. I am currently doing some minor fixes in order to make the game very close to perfect.
I am doing some test runs during most of July, and it looks very promising that my game will get the green light for release by the end of July or early August. I will have to create some more audio sounds from the show, and maybe even update some images to make the game realistic. Earlier this week, I added a flashing border as 2 separate frames to allow the lights to move to the contestant winning a game or the match. I may even do this to the Money Cards image also.
-
Re: Flickering Buttons: How Do I Get Rid Of Them?
August 5th update, and you'll be happy to hear the news...
The major coding will likely be completed by the weekend or early next week at the latest. Plus I have consolidated all the gameplay elements onto one form. This will really make things easier instead of having so many different forms.
I have also decided to scrap the avatar images - too much extra work that I don't even need.
So far, I have done test runs for the entire gameplay of the following game types (all with Human player vs. Human player):- Jokers Car Game
- Jokers Game for Young People's Week (with the Trip to Hawaii instead of a car)
- Range Board Car Game
- Showdown Game and Combined Money Cards/Car Game
I will be doing some test runs with the Computer player at some point over the weekend or the coming week.
Once the major coding is completed, I will be working on creating some more small .wav files, as well as touch up some of the images to make the game look more smooth and crisp.
I thank Martin and some other users for all the help they provided prior to last April, and it turns out that I didn't even need much help since I discovered the Acey-Deucey code lingering on the Internet, and Card Sharks is somewhat based on Acey-Deucey.