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.
Last edited by JonSea31; Mar 11th, 2010 at 06:39 PM.
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:
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?
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:
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.
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.
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.
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?
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.
Last edited by JonSea31; Mar 12th, 2010 at 07:13 AM.
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.
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?
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):
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.
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).
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
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.
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.
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.
Last edited by JonSea31; Mar 13th, 2010 at 08:50 PM.
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?
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).
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).
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.
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.
Last edited by JonSea31; Mar 27th, 2010 at 12:55 PM.
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.
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?
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.
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
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.
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.
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.
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.
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.
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.