Advertisement
Arngrim

Old Coney Island fixed

Dec 23rd, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.84 KB | None | 0 0
  1. '*****************************
  2. ' Old Coney Isand
  3. ' para JOLO
  4. ' (vale también para Leo :) )
  5. '*****************************
  6.  
  7. Option Explicit
  8. Randomize
  9.  
  10. On Error Resume Next
  11. ExecuteGlobal GetTextFile("controller.vbs")
  12. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  13. On Error Goto 0
  14.  
  15. LoadVPM "00990300", "GamePlan.vbs", 3.1
  16.  
  17. Dim cCredits
  18. cCredits = "Coney Island, GamePlan, 1979"
  19. Const cGameName = "coneyis"
  20.  
  21. Const UseSolenoids = 1
  22. Const UseLamps = 1
  23. Const UseGI = 0
  24. Const UseSync = 1
  25.  
  26. ' Standard vpinmame Sounds
  27. Const SCoin = "fx_coin"
  28.  
  29. ' Solenoids
  30.  
  31. SolCallback(8) = "bsTrough.SolOut"
  32. SolCallback(11) = "dtDrop.SolDropUp"
  33. SolCallback(15) = "bsSaucer.SolOut"
  34. SolCallback(16) = "vpmNudge.SolGameOn"
  35.  
  36. ' If you want chimes uncomment these lines:
  37. 'SolCallback(18) = "vpmSolSound ""fx_Chime4"","
  38. 'SolCallback(19) = "vpmSolSound ""fx_Chime3"","
  39. 'SolCallback(20) = "vpmSolSound ""fx_Chime2"","
  40. 'SolCallback(21) = "vpmSolSound ""fx_Chime1"","
  41.  
  42. ' not used in the script
  43. 'SolCallback(12) bumper 2
  44. 'SolCallback(13) bumper 3
  45. 'SolCallback(14) bumper 1
  46. 'SolCallback(9) left slingshot
  47. 'SolCallback(10) right slingshot
  48.  
  49. '**************
  50. ' Flipper Subs
  51. '**************
  52.  
  53. SolCallback(sLRFlipper) = "SolRFlipper"
  54. SolCallback(sLLFlipper) = "SolLFlipper"
  55.  
  56. Sub SolLFlipper(Enabled)
  57. If Enabled Then
  58. PlaySound SoundFX("fx_flipperup", DOFContactors), 0, 1, -0.1, 0.15
  59. LeftFlipper.RotateToEnd
  60. Else
  61. PlaySound SoundFX("fx_flipperdown", DOFContactors), 0, 1, -0.1, 0.15
  62. LeftFlipper.RotateToStart
  63. End If
  64. End Sub
  65.  
  66. Sub SolRFlipper(Enabled)
  67. If Enabled Then
  68. PlaySound SoundFX("fx_flipperup", DOFContactors), 0, 1, 0.1, 0.15
  69. RightFlipper.RotateToEnd
  70. Else
  71. PlaySound SoundFX("fx_flipperdown", DOFContactors), 0, 1, 0.1, 0.15
  72. RightFlipper.RotateToStart
  73. End If
  74. End Sub
  75.  
  76. Sub LeftFlipper_Collide(parm)
  77. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.1, 0.15
  78. End Sub
  79.  
  80. Sub Rightflipper_Collide(parm)
  81. PlaySound "fx_rubber_flipper", 0, parm / 10, 0.1, 0.15
  82. End Sub
  83.  
  84. '**************
  85. ' Table Init
  86. '**************
  87.  
  88. Dim bsTrough, dtDrop, bsSaucer
  89.  
  90. Sub Table1_Init
  91. On Error Resume Next
  92. With Controller
  93. .GameName = cGameName
  94. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
  95. .SplashInfoLine = cCredits
  96. .Games(cGameName).Settings.Value("rol") = 0 '1= rotated display, 0= normal
  97. .HandleMechanics = 0
  98. .ShowDMDOnly = 1
  99. .ShowFrame = 0
  100. .ShowTitle = 0
  101. End With
  102. On Error Goto 0
  103. Controller.SolMask(0) = 0
  104. vpmTimer.AddTimer 2000, "Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
  105. Controller.Run
  106.  
  107. ' Press F6 during the game to change the dip switches
  108. ' destruk dip switches - awards extra ball
  109. 'Controller.Dip(0) = (0 * 1 + 1 * 2 + 0 * 4 + 0 * 8 + 0 * 16 + 0 * 32 + 0 * 64 + 0 * 128) '01-08
  110. 'Controller.Dip(1) = (0 * 1 + 0 * 2 + 0 * 4 + 0 * 8 + 0 * 16 + 0 * 32 + 0 * 64 + 1 * 128) '09-16
  111. 'Controller.Dip(2) = (0 * 1 + 1 * 2 + 0 * 4 + 0 * 8 + 0 * 16 + 0 * 32 + 0 * 64 + 0 * 128) '17-24
  112. 'Controller.Dip(3) = (1 * 1 + 1 * 2 + 1 * 4 + 0 * 8 + 0 * 16 + 1 * 32 + 1 * 64 + 0 * 128) '25-32
  113.  
  114. ' Jolo dip switches - awards extra game
  115. 'Controller.Dip(0) = (0 * 1 + 0 * 2 + 0 * 4 + 0 * 8 + 0 * 16 + 0 * 32 + 0 * 64 + 0 * 128) '01-08
  116. 'Controller.Dip(1) = (0 * 1 + 0 * 2 + 0 * 4 + 0 * 8 + 1 * 16 + 0 * 32 + 0 * 64 + 1 * 128) '09-16
  117. 'Controller.Dip(2) = (0 * 1 + 1 * 2 + 0 * 4 + 0 * 8 + 0 * 16 + 0 * 32 + 0 * 64 + 0 * 128) '17-24
  118. 'Controller.Dip(3) = (1 * 1 + 1 * 2 + 1 * 4 + 0 * 8 + 1 * 16 + 1 * 32 + 1 * 64 + 1 * 128) '25-32
  119.  
  120. ' Nudging
  121. vpmNudge.TiltSwitch = swTilt
  122. vpmNudge.Sensitivity = 5
  123. vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot)
  124.  
  125. ' Trough
  126. Set bsTrough = New cvpmBallStack
  127. With bsTrough
  128. .InitSw 0, 11, 0, 0, 0, 0, 0, 0
  129. .InitKick BallRelease, 80, 6
  130. .InitEntrySnd "fx_Solenoid", "fx_Solenoid"
  131. .InitExitSnd SoundFX("fx_ballrel", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
  132. .Balls = 1
  133. End With
  134.  
  135. ' Left Eject Hole
  136. Set bsSaucer = New cvpmBallStack
  137. With bsSaucer
  138. .InitSaucer sw24, 24, 136, 28
  139. .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_kicker", DOFContactors)
  140. .KickForceVar = 3
  141. .KickAngleVar = 1
  142. End With
  143.  
  144. ' Drop targets
  145. set dtDrop = new cvpmdroptarget
  146. With dtDrop
  147. .InitDrop Array(sw31, sw32, sw35, sw36, sw4, sw10, sw17), Array(31, 32, 35, 36, 4, 10, 17)
  148. .initsnd "", SoundFX("fx_resetdrop", DOFContactors)
  149. '.CreateEvents "dtDrop" 'done manually in the script because of the 3d mesh droptargets animation.
  150. End With
  151.  
  152. ' Main Timer init
  153. PinMAMETimer.Interval = PinMAMEInterval
  154. PinMAMETimer.Enabled = 1
  155.  
  156. ' Map lights into array
  157. vpmMapLights aLights
  158. End Sub
  159.  
  160. Sub table1_KeyDown(ByVal Keycode)
  161. If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
  162. If keycode = RightTiltKey Then Nudge 270, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
  163. If keycode = CenterTiltKey Then Nudge 0, 6:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
  164. If keycode = PlungerKey Then PlaySound "fx_PlungerPull", 0, 1, 0.1, 0.05:Plunger.Pullback
  165. If vpmKeyDown(keycode) Then Exit Sub
  166. End Sub
  167.  
  168. Sub table1_KeyUp(ByVal Keycode)
  169. If keycode = PlungerKey Then PlaySound "fx_plunger", 0, 1, 0.1, 0.05:Plunger.Fire
  170. If vpmKeyUp(keycode) Then Exit Sub
  171. End Sub
  172.  
  173. ' Slings
  174. Dim LStep, RStep
  175.  
  176. Sub LeftSlingShot_Slingshot
  177. PlaySound SoundFX("fx_slingshot", DOFContactors), 0, 1, -0.05, 0.05
  178. LeftSling4.Visible = 1
  179. Lemk.RotX = 26
  180. LStep = 0
  181. vpmTimer.PulseSw 15
  182. LeftSlingShot.TimerEnabled = 1
  183. End Sub
  184.  
  185. Sub LeftSlingShot_Timer
  186. Select Case LStep
  187. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  188. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  189. Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:LeftSlingShot.TimerEnabled = 0
  190. End Select
  191.  
  192. LStep = LStep + 1
  193. End Sub
  194.  
  195. Sub RightSlingShot_Slingshot
  196. PlaySound SoundFX("fx_slingshot", DOFContactors), 0, 1, 0.05, 0.05
  197. RightSling4.Visible = 1
  198. Remk.RotX = 26
  199. RStep = 0
  200. vpmTimer.PulseSw 34
  201. RightSlingShot.TimerEnabled = 1
  202. End Sub
  203.  
  204. Sub RightSlingShot_Timer
  205. Select Case RStep
  206. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
  207. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
  208. Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:RightSlingShot.TimerEnabled = 0
  209. End Select
  210.  
  211. RStep = RStep + 1
  212. End Sub
  213.  
  214. 'Switches, targets, triggers
  215.  
  216. Sub Drain_Hit:Playsound "fx_drain":bsTrough.AddBall Me:End Sub
  217. Sub RubberBand5_Hit:vpmTimer.PulseSw 9:End Sub
  218. Sub RubberBand6_Hit:vpmTimer.PulseSw 9:End Sub
  219. Sub RubberBand7_Hit:vpmTimer.PulseSw 9:End Sub
  220. Sub RubberBand8_Hit:vpmTimer.PulseSw 9:End Sub
  221. Sub RubberBand9_Hit:vpmTimer.PulseSw 9:End Sub
  222. Sub RubberBand10_Hit:vpmTimer.PulseSw 9:End Sub
  223. Sub RubberBand14_Hit:vpmTimer.PulseSw 9:End Sub
  224. Sub sw12_Hit:Controller.Switch(12) = 1:End Sub
  225. Sub sw12_unHit:Controller.Switch(12) = 0:End Sub
  226. Sub sw13_Hit:Controller.Switch(13) = 1:End Sub
  227. Sub sw13_unHit:Controller.Switch(13) = 0:End Sub
  228. Sub sw14_Hit:Controller.Switch(14) = 1:End Sub
  229. Sub sw14_unHit:Controller.Switch(14) = 0:End Sub
  230. Sub sw16_Hit:Controller.Switch(16) = 1:DOF 102, DOFOn:End Sub
  231. Sub sw16_unHit:Controller.Switch(16) = 0:DOF 102, DOFOff:End Sub
  232. Sub sw16a_Hit:Controller.Switch(16) = 1:DOF 101, DOFOn:End Sub
  233. Sub sw16a_unHit:Controller.Switch(16) = 0:DOF 101, DOFOff:End Sub
  234. Sub sw18_Hit:Controller.Switch(18) = 1:End Sub
  235. Sub sw18_unHit:Controller.Switch(18) = 0:End Sub
  236. Sub Target1_Hit:vpmTimer.PulseSw(19):PlaySound SoundFX("fx_target", DOFContactors), 0, 1, 0.1, 0.15:End Sub
  237. Sub Target2_Hit:vpmTimer.PulseSw(20):PlaySound SoundFX("fx_target", DOFContactors), 0, 1, 0.1, 0.15:End Sub
  238. Sub Bumper1_Hit:vpmTimer.PulseSw(21):PlaySound SoundFX("fx_bumper", DOFContactors), 0, 1, -0.1, 0.15:End Sub
  239. Sub Bumper2_Hit:vpmTimer.PulseSw(22):PlaySound SoundFX("fx_bumper", DOFContactors), 0, 1, 0.1, 0.15:End Sub
  240. Sub Spinner1_Spin:vpmTimer.PulseSw(23):End Sub
  241. Sub sw24_Hit:PlaySound "fx_kicker_enter", 0, 1, -0.05, 0.05:bsSaucer.AddBall 0:End Sub
  242. Sub sw25_Hit:Controller.Switch(25) = 1:End Sub
  243. Sub sw25_unHit:Controller.Switch(25) = 0:End Sub
  244. Sub sw27_Hit:Controller.Switch(27) = 1:End Sub
  245. Sub sw27_unHit:Controller.Switch(27) = 0:End Sub
  246. Sub sw28_Hit:Controller.Switch(28) = 1:End Sub
  247. Sub sw28_unHit:Controller.Switch(28) = 0:End Sub
  248. Sub sw29_Hit:Controller.Switch(29) = 1:End Sub
  249. Sub sw29_unHit:Controller.Switch(29) = 0:End Sub
  250. Sub sw30_Hit:Controller.Switch(30) = 1:End Sub
  251. Sub sw30_unHit:Controller.Switch(30) = 0:End Sub
  252. Sub Bumper3_Hit:vpmTimer.PulseSw(33):PlaySound SoundFX("fx_bumper", DOFContactors), 0, 1, 0, 0.15:End Sub
  253. Sub sw37_Hit:Controller.Switch(37) = 1:End Sub
  254. Sub sw37_unHit:Controller.Switch(37) = 0:End Sub
  255. Sub sw38_Hit:Controller.Switch(38) = 1:End Sub
  256. Sub sw38_unHit:Controller.Switch(38) = 0:End Sub
  257. Sub sw39_Hit:Controller.Switch(39) = 1:End Sub
  258. Sub sw39_unHit:Controller.Switch(39) = 0:End Sub
  259. Sub sw40_Hit:Controller.Switch(40) = 1:End Sub
  260. Sub sw40_unHit:Controller.Switch(40) = 0:End Sub
  261.  
  262. 'droptargets
  263. Sub sw31_Dropped():dtDrop.Hit 1:End Sub
  264. Sub sw32_Dropped():dtDrop.Hit 2:End Sub
  265. Sub sw35_Dropped():dtDrop.Hit 3:End Sub
  266. Sub sw36_Dropped():dtDrop.Hit 4:End Sub
  267. Sub sw4_Dropped():dtDrop.Hit 5:End Sub
  268. Sub sw10_Dropped():dtDrop.Hit 6:End Sub
  269. Sub sw17_Dropped():dtDrop.Hit 7:End Sub
  270.  
  271. Sub Table1_Paused:Controller.Pause = True:End Sub
  272. Sub Table1_UnPaused:Controller.Pause = False:End Sub
  273. Sub Table1_Exit:Controller.Stop:End Sub
  274.  
  275. '******************
  276. ' RealTime Updates
  277. '******************
  278.  
  279. Set MotorCallback = GetRef("RealTimeUpdates")
  280.  
  281. Sub RealTimeUpdates
  282. RollingUpdate
  283. 'GIUpdate
  284. End Sub
  285.  
  286. 'General Illumination
  287.  
  288. Set LampCallback = GetRef("GIUpdate")
  289.  
  290. Sub GiON
  291. Dim x
  292. For each x in aGiLights
  293. x.State = 1
  294. Next
  295. l53b.State = 2
  296. End Sub
  297.  
  298. Sub GiOFF
  299. Dim x
  300. For each x in aGiLights
  301. x.State = 0
  302. Next
  303. l53b.State = 0
  304. End Sub
  305.  
  306. Dim OldGiState
  307. OldGiState = 0 'start witht he Gi off
  308.  
  309. Sub GIUpdate
  310. If Controller.Lamp(53) <> OldGiState Then
  311. OldGiState = Controller.Lamp(53)
  312. If Controller.Lamp(53) = 0 Then
  313. GiOff
  314. Else
  315. GiOn
  316. End If
  317. End If
  318. End Sub
  319.  
  320. ' *********************************************************************
  321. ' Supporting Ball & Sound Functions
  322. ' *********************************************************************
  323.  
  324. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  325. Vol = Csng(BallVel(ball) ^2 / 1000)
  326. End Function
  327.  
  328. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  329. Dim tmp
  330. tmp = ball.x * 2 / table1.width-1
  331. If tmp> 0 Then
  332. Pan = Csng(tmp ^10)
  333. Else
  334. Pan = Csng(-((- tmp) ^10) )
  335. End If
  336. End Function
  337.  
  338. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  339. Pitch = BallVel(ball) * 20
  340. End Function
  341.  
  342. Function BallVel(ball) 'Calculates the ball speed
  343. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  344. End Function
  345.  
  346. '*****************************************
  347. ' JP's VP10 Rolling Sounds
  348. '*****************************************
  349.  
  350. Const tnob = 1 ' total number of balls in this table is 4, but always use a higher number here because of the timing
  351. ReDim rolling(tnob)
  352. InitRolling
  353.  
  354. Sub InitRolling
  355. Dim i
  356. For i = 0 to tnob
  357. rolling(i) = False
  358. Next
  359. End Sub
  360.  
  361. Sub RollingUpdate()
  362. Dim BOT, b
  363. BOT = GetBalls
  364.  
  365. ' stop the sound of deleted balls
  366. For b = UBound(BOT) + 1 to tnob
  367. rolling(b) = False
  368. StopSound("fx_ballrolling" & b)
  369. Next
  370.  
  371. ' exit the sub if no balls on the table
  372. If UBound(BOT) = -1 Then Exit Sub
  373.  
  374. ' play the rolling sound for each ball
  375. For b = 0 to UBound(BOT)
  376. If BallVel(BOT(b) )> 1 AND BOT(b).z <30 Then
  377. rolling(b) = True
  378. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  379. Else
  380. If rolling(b) = True Then
  381. StopSound("fx_ballrolling" & b)
  382. rolling(b) = False
  383. End If
  384. End If
  385. Next
  386. End Sub
  387.  
  388. '******************************
  389. ' Diverse Collection Hit Sounds
  390. '******************************
  391.  
  392. Sub aMetals_Hit(idx):PlaySound "fx_metalhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  393. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber_band", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  394. Sub aRubber_Posts_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  395. Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  396. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  397. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  398. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  399. Sub adroptargets_Hit(idx):PlaySound SoundFX("fx_droptarget", DOFContactors), 0, 1, pan(ActiveBall), 0.15:End Sub
  400. Sub alanes_Hit(idx):PlaySound SoundFX("fx_sensor", DOFContactors), 0, 1, pan(ActiveBall), 0.15:End Sub
  401.  
  402. 'Gameplan
  403. 'added by Inkochnito
  404. Sub editDips
  405. Dim vpmDips:Set vpmDips=New cvpmDips
  406. With vpmDips
  407. .AddForm 700,400,"Gameplan - DIP switches"
  408. .AddFrame 2,5,190,"Maximum credits",&H07000000,Array("5 credits",0,"10 credits",&H01000000,"15 credits",&H02000000,"20 credits",&H03000000,"25 credits",&H04000000,"30 credits",&H05000000,"35 credits",&H06000000,"40 credits",&H07000000)'dip 25&26&27
  409. .AddFrame 210,97,190,"High game to date award",&HC0000000,Array("no award",0,"1 credit",&H40000000,"2 credits",&H80000000,"3 credits",&HC0000000)'dip 31&32
  410. .AddFrame 210,5,190,"Special award",&H10000000,Array("extra ball",0,"replay",&H10000000)'dip 29
  411. .AddFrame 210,51,190,"Balls per game",&H08000000,Array("3 balls",0,"5 balls",&H08000000)'dip 28
  412. .AddChk 2,140,150,Array("Play tunes",32768)'dip 16
  413. .AddChk 2,155,150,Array("Match feature",&H20000000)'dip 30
  414. .AddChk 2,170,150,Array("Free play",&H00000080)'dip 8
  415. .AddLabel 30,200,300,20,"After hitting OK, press F3 to reset game with new settings."
  416. .ViewDips
  417. End With
  418. End Sub
  419. Set vpmShowDips=GetRef("editDips")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement