The NEW Build Your Own Arcade Controls
Main => Software Forum => Topic started by: Visitor Q on March 24, 2009, 10:30:40 pm
-
When ever I try to play Safe Cracker in VP Mame I get the following error.
Line:671
Variable is undefined: 'KeyStartButton'
Any idea what I need to do to correct this so that I can enjoy this game?
Thanks!
Sub SC_KeyUp(ByVal keycode)
If keycode = keyStartButton Then Plunger.Fire ' reset the plunger, the first ball must be launch by the player
If vpmKeyUp(keycode) Then Exit Sub
If keycode = PlungerKey Then Plunger.Fire
If keycode = 16 Then
Controller.Switch(56)=False
End If
If keycode = 17 Then
Controller.Switch(57)=False
End If
If keycode = 18 Then
Controller.Switch(58)=False
End If
End Sub
-
Anyone have any ideas?
-
"keyStartButton" looks to be a variable which should be set to a constant value somewhere in the code, however, the code cannot locate it so it has no idea what the value of "keyStartButton" is when the game starts. Based on the code it seems when the player presses the "start button" then the plunger fires thus sending the ball into the play field. Since the value of the "start button" is unknown then the code cannot figure out when the player pressed the start button.
Two lines lower in the code it seems pressing the plunger key button will make the plunger fire as well thus sending the ball into the play field as well.
So, my quick recommendations to you is to:
1) comment out (or remove) the following line from the code so you can start the game by pressing the plunger button instead of by pressing the start button.
If keycode = keyStartButton Then Plunger.Fire
OR
2) Figure out a keycode to associate with a "start" button on your panel and change the following line :
If keycode = keyStartButton Then Plunger.Fire
to be
If keycode = <<new keycode integer value>> Then Plunger.Fire