code conversion

fastdraw

Inserted Coin
Joined
Dec 16, 2015
Messages
230
Reaction score
164
Points
56
Favorite Pinball Machine
afm mm cv
what is the conversion of this code to VP : DT= drop target : DTL= lumiere


resolved

had to replace drop target by a wall



Sub DT1_Hit()
AddScore 1000: DTL1.State = 1: DT1.SolenoidOn: CheckDT
End Sub

Sub DT2_Hit()
AddScore 1000: DTL2.State = 1: DT2.SolenoidOn: CheckDT
End Sub

Sub DT3_Hit()
AddScore 1000: DTL3.State = 1: DT3.SolenoidOn: CheckDT
End Sub

Sub CheckDT()
Dim x
If DTL1.State *DTL2.State *DTL3.State = 0 Then Exit Sub
For x = 1 To 3: Eval("DT" &x).SolenoidOff: Eval("DTL" &x).State = 0: Eval("DT" &x).PopDown: Next
End Sub

Sub PulseDT()
dt1.solenoidPulse:dt2.solenoidPulse:dt3.solenoidPulse
End Sub
 
Last edited:
Solution
Not sure about vpx but shivaengine had very simple routines and no eval or exeecute code, which will slow down a computer. Code will work for vp9.9. Your on your own after that.

From shivaengine1.8
ResetTargets() Goes in your New Ball subroutine

Code:
'********************************************
Rem ***         Drop Targets              ***
'********************************************
' Note, the TargetABCCheck sub is in the Reset and Checking Section
' after the Hit Event section

Sub TargetA_Hit() ' Target A was hit

    If tilt = False then				' If we don't tilt
		TargetA.IsDropped = True 		' Drop the target
	    PlaySound "targetdropping"
	    LightA.State = 1		 		' Light target A light
	    addscore 1000 				' Add 1000 points...
Man, 10+ years goes by fast.

It almost looks like you can now add colons ":" between contiguous statements now, like we used to do back with 8-bit BASIC, back in the day.

I guess this is one of the many new differences between VPX and older versions?
 
this code comes from fp,
I do not know the equivalence of popdown (FP) with vpx.
so the easiest way is to code the walls in DT. it's disarmingly simple.
there is a fpvpx script, which I do not know its usefulness?
maybe better compatibility for fp to vpx table conversion?
 
Not sure about vpx but shivaengine had very simple routines and no eval or exeecute code, which will slow down a computer. Code will work for vp9.9. Your on your own after that.

From shivaengine1.8
ResetTargets() Goes in your New Ball subroutine

Code:
'********************************************
Rem ***         Drop Targets              ***
'********************************************
' Note, the TargetABCCheck sub is in the Reset and Checking Section
' after the Hit Event section

Sub TargetA_Hit() ' Target A was hit

    If tilt = False then				' If we don't tilt
		TargetA.IsDropped = True 		' Drop the target
	    PlaySound "targetdropping"
	    LightA.State = 1		 		' Light target A light
	    addscore 1000 				' Add 1000 points to the score
	    TargetABCCheck() 				' Check to see if all targets have been hit
    Else						' If we do tilt
    	TargetA.IsDropped = True 			' Drop the target
    	PlaySound "targetdropping"			' Play the sound, but no points or lights
    End If
    
End Sub ' End of Sub TargetA_Hit

'********************************************

Sub TargetB_Hit() ' Target B was hit

    If tilt = False then				' If we don't tilt
		TargetB.IsDropped = True 		' Drop the target
	    PlaySound "targetdropping"
	    LightB.State = 1		 		' Light target B light
	    addscore 1000				' Add 1000 points to the score
	    TargetABCCheck() 				' Check to see if all targets have been hit
    Else						' If we do tilt
	    TargetB.IsDropped = True 			' Drop the target
	    PlaySound "targetdropping"			' Play the sound, but no points or lights
    End If
    
End sub ' End of Sub TargetB_Hit

'********************************************

Sub TargetC_Hit() ' Target C was hit

    If tilt = False then				' If we don't tilt
	TargetC.IsDropped = True 			' Drop the target
	PlaySound "targetdropping"
	LightC.State = 1				' Light target C light
	addscore 1000 					' Add 1000 points to the score
	TargetABCCheck() 				' Check to see if all targets have been hit
    Else						' If we do tilt
	TargetC.IsDropped = True 			' Drop the target
	PlaySound "targetdropping"			' Play the sound, but no points or lights
    End If
    
End sub ' End of Sub TargetC_Hit


'********************************************

Sub ResetTargets() 'resets drop targets

    TargetA.IsDropped = False
    LightA.State = 0
    TargetB.IsDropped = False
    LightB.State = 0
    TargetC.IsDropped = False
    LightC.State = 0
    PlaySound "Targetup"
    
End Sub ' End of Sub ResetTargets

'********************************************

'*** Drop Target Check Routines ***

Sub TargetABCCheck() 							' Check if all targets have been hit

    If LightA.state = 1 and LightB.state = 1 and LightC.state = 1 then ' If they have then
 	   TargetsABCTimer.Enabled = 1 						'1 = True
    End If
    
End Sub

'********************************************

Sub TargetsABCTimer_Timer()
       ResetTargets() 							' reset the targets and
       BonusCollectLight.State = 2					' Turn on the light to collect bonus at Red Ramp BonusCollectKicker
       addscore 25000 							' award 25,000 points
       TargetsABCTimer.Enabled = 0 					'0 = False
End Sub

'********************************************

I meant to put in shivaEngine series here, see if I can put in 1.8 for you now. Oh, it also has a very simple multiball example as well as other stuff. Code should be easy to translate to vpx

EDIT: https://pinballnirvana.com/forums/downloads.php?do=file&id=5526
 
Last edited:
Solution
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Chat Bot Mibs Chat Bot Mibs: Flipper Hermann has left the room.
      Back
      Top