Register    Login    Forum    FAQ    PinSimDB.org

Board index » Welcome to GoPinball » General Discussion




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Push button variable strength plunger
 Post Posted: Sun Jul 19, 2015 8:31 pm 
Offline
User avatar

Joined: Thu Jul 01, 2010 3:02 pm
Posts: 301
I'm trying to figure out how to create a variable strength "digital" plunger? Currently the Dragons Keep pin has a bow which pulls back the longer you press the spacebar, then launches when you release.

Obviously not visually a normal plunger, but interactively it is.

Script wise a plunger object has the methods I need: Pull(percentage) and LetGo().

Visually I would just have a "Launch" button on the table and use the "down" to start the pull-back, and the "up" to release the plunger. I don't want the plunger to be visible on the outside of the table cabinet. Inside is fine as I can hide the plunger shaft with a surface and put a Bow toy above it.

Is it possible to drastically change the plunger model and it still work?

If anyone has thoughts on that I'd be glad to hear them!

-mark


Top 
 Profile  
 
 Post subject: Re: Push button variable strength plunger
 Post Posted: Mon Jul 20, 2015 8:48 am 
Offline
User avatar

Joined: Fri Sep 09, 2011 9:14 pm
Posts: 142
You can use a very small plunger rubber and the arrow model (Toy) over it, it should still work.

If not, once I used a "plunger" which was not a plunger, for a table test.

It was a toy with the plunger model, plus some invisible EM-Kickers with different strength.
When you "pull" the plunger with a counter (and a timer), the toy moves, and when you release the key, the toy backs to its position and one EM-Kicker or another depending on the same counter will punch the ball.

Code:
Dim objPlunger : Set objPlunger = New C_Plunger

Sub FuturePinball_KeyPressed(ByVal KeyCode)
   If (fpGameInPlay = True) Then

      ' (Other Keys)

      If (KeyCode = GetKeyCode(PlungerKey)) Then
         objPlunger.Pull()
      End If

   End If
End Sub

Sub FuturePinball_KeyReleased(ByVal KeyCode)
   If (fpGameInPlay = True) Then

      ' (Other Keys)

      If (KeyCode = GetKeyCode(PlungerKey)) Then
         objPlunger.LetGo()
      End If

    End If
End Sub

Class C_Plunger
   Public Speed
   Public MaxZ
   Public Counter
   Public oriZ

   Private Sub Class_Initialize
      Speed = 10
      MaxZ = 100
      Counter = 0
      oriZ = Plunger.Tz
   End Sub

   Public Sub Pull()
      PlungerTimer.Enabled = True
   End Sub

   Public Sub LetGo()
      PlungerTimer.Enabled = False
      Counter = Counter \ 100
      Plunger.MoveTo Plunger.Tx, Plunger.Ty, oriZ, 1000 * Counter
      If (Counter > 0) Then
         PlaySound "PlungerRelease"
         Select Case Counter
            Case 1 :    EmPlunger1.SolenoidPulse()
            Case 2 :    EmPlunger2.SolenoidPulse()
            Case 3 :    EmPlunger3.SolenoidPulse()
            Case 4 :    EmPlunger4.SolenoidPulse()
            Case 5 :    EmPlunger5.SolenoidPulse()
            Case 6 :    EmPlunger6.SolenoidPulse()
            Case 7 :    EmPlunger7.SolenoidPulse()
            Case 8 :    EmPlunger8.SolenoidPulse()
            Case Else : EmPlunger9.SolenoidPulse()
         End Select
         Counter = 0
      End If
   End Sub
End Class

Sub PlungerTimer_Expired()
   objPlunger.Counter = objPlunger.Counter + PlungerTimer.Interval
   Dim Tz, Speed, MaxZ, oriZ
   Speed = objPlunger.Speed
   MaxZ = objPlunger.MaxZ
   oriZ = objPlunger.oriZ
   Tz = Plunger.Tz + Speed
   If Tz > (oriZ + MaxZ) Then
      Tz = (oriZ + MaxZ)
   End If
   If (Tz > Plunger.Tz) Then
      Plunger.MoveTo Plunger.Tx, Plunger.Ty, Tz, 500
   End If
End Sub


The great part of this method is that EM-Kickers can have plunger lane too.

The only problem I found is with the collision of the invisible EM-Kickers. When you use "lots" of models with a similar collision very near or exactly in the same place sometimes you will get a bug; some of the collision shapes are not displayed on their position but in the center of the table.

So if you want to try it first test all the invisible-EM kickers and if all works fine, you can start making the arrow.


Top 
 Profile  
 
 Post subject: Re: Push button variable strength plunger
 Post Posted: Mon Jul 20, 2015 6:00 pm 
Offline
User avatar

Joined: Thu Jul 01, 2010 3:02 pm
Posts: 301
Thanks Wecoc. I had tried this with a group of solenoids previously and definitely had some issues of collisions being that they were in the exact location. Let me try with the EM-kicker as well.

I love all the scripting magic that you've shared BTW. Have you experimented a lot with Execute commands that generate the vbscript Class objects dynamically? I wanted to create Future Pinball object arrays but have it "hidden" behind dynamically generated vbscript classes.

thanks!
-mark


Top 
 Profile  
 
 Post subject: Re: Push button variable strength plunger
 Post Posted: Tue Jul 21, 2015 4:24 pm 
Offline
User avatar

Joined: Mon Feb 27, 2012 10:39 am
Posts: 1908
just a tought, inverting normals on an object make some par of it appear invisible, maybe try that.
or just replace the plunger with a very small cube textured black.

_________________
add me to SKYPE : steve.paradis49


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 4 posts ] 

Board index » Welcome to GoPinball » General Discussion


Who is online

Users browsing this forum: No registered users and 10 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to: