Jump to content



Photo
- - - - -

Analog Plunger Script Errors


  • Please log in to reply
8 replies to this topic

#1 imagamejunky

imagamejunky

    Addicted

  • Members
  • PipPipPip
  • 104 posts
  • Location:CA Bay Area

  • Flag: United States of America

  • Favorite Pinball: TZ, IJ, MM, TOTAN, CV, TAF, AFM, STTNG, T2

Posted 20 May 2013 - 10:54 PM

Hi Guys.

Today I started having a new problem with my favorite VP table TOTAN.  This error happens on both the original and the enhanced version.  What's strange is that I have played this table for quite a while and NOW this error comes up.

 

I get this error upon start up..

 

Subscript out of range line 307 AnPlNewPos

 

When I look at the script I find this..

 

Sub Plunger_Timer()
    If Plunger.MotionDevice > 0 Then
        Plungers(AnPlOldPos).alpha = 0
        AnPlNewPos = Plunger.Position \ 2
        Plungers(AnPlNewPos).alpha = 1
        PRefresh.State = ABS(PRefresh.state -1)
        AnPlOldPos = AnPlNewPos

 

 

Upon searching, I haven't found any posts discussing this problem.  I do see something similar with a post about Tommy but the script is different and doesn't include "alpha".

 

I'm using a Nanotech plunger.

 

Please help me out gurus. :)

Thanks

 

 



#2 imagamejunky

imagamejunky

    Addicted

  • Members
  • PipPipPip
  • 104 posts
  • Location:CA Bay Area

  • Flag: United States of America

  • Favorite Pinball: TZ, IJ, MM, TOTAN, CV, TAF, AFM, STTNG, T2

Posted 21 May 2013 - 07:45 PM

Anyone?

#3 imagamejunky

imagamejunky

    Addicted

  • Members
  • PipPipPip
  • 104 posts
  • Location:CA Bay Area

  • Flag: United States of America

  • Favorite Pinball: TZ, IJ, MM, TOTAN, CV, TAF, AFM, STTNG, T2

Posted 07 June 2013 - 04:43 PM

Now I'm using the new virtuapin plunger. I'm still getting this error with the totan tables. This sucks

#4 Noah Fentz

Noah Fentz

    'Rasslin' Fan

  • VPF Administrator
  • 12,282 posts
  • Location:South Lyon, MI

  • Flag: United States of America

  • Favorite Pinball: Whitewater

  • PS3 Gamer Tag: noahfentz


Contributor

Posted 07 June 2013 - 05:35 PM

I haven't gotten these errors, but I will certainly look into it.

 

Given that it's happening with either device, I'd have to say it's in the scripting. It must be returning a value < 0.


IdleReel.gif RumbleDMD.jpg HS2-DMD.jpg SBM.jpg ww_logo.jpg EK.jpg

 
T2.jpg Sorcerer.jpg Breakshot.jpg Firepower.jpg GorGar.jpg StarTrek.jpg


My Photobucket Resources
Whether You Believe You Can, Or You Can't, You Are Right." - Henry Ford
The future of pinball lives, it just needs to be nurtured!
If you're here to stab me in the back, you're going to have to get in line.


#5 PainkillerAlice

PainkillerAlice

    Multi-Level Madman

  • Platinum Supporter
  • 2,685 posts
  • Location:Indiana

  • Flag: United States of America

  • Favorite Pinball: I like multi-level pinball the most


  • Trophies:

Posted 07 June 2013 - 07:10 PM

Anyone?

One thing with asking for help: You must be patient. The person who may have the answer may not necessarily be on all the time, or even on a daily basis. We are a group of hobbyists that commune on this website to fuel our pinball entusiasm. :D


I could have been smart, but I never learned anything by being smart!

 

 


#6 kruge99

kruge99

    Pinball Wizard

  • VPF Staff
  • 3,901 posts
  • Location:Markham, Ont.

  • Flag: Canada

  • Favorite Pinball: Black Knight, High Speed and Pin*Bot



Posted 07 June 2013 - 07:19 PM

There is minor spelling mistake that I have been nagging JPSalas to fix but he's been awefully busy.

 

First, make sure you are loading up TOTAN_VP91x_3.3FS_Classic.vpt

 

Open the script and scroll down to line 293, and make sure it looks exactly like this:

 

'PinWizard Plunger script
'Turn on the Plunger timer if analog plunger is detected
Dim AnPlNewPos, AnPlOldPos
AnPlNewPos = 0:AnPlOldPos = 0
If Plunger.MotionDevice > 0 Then
    Plunger.TimerEnabled = 1
    Plunger.MechPlunger = 1
End If
Sub Plunger_Timer()
    If Plunger.MotionDevice > 0 Then
        Plungers(AnPlOldPos).alpha = 0
        AnPlNewPos = Plunger.Position \ 2
        Plungers(AnPlNewPos).alpha = 1
        PRefresh.State = ABS(PRefresh.state -1)
        AnPlOldPos = AnPlNewPos
    End if
End Sub

 

Good luck!

 

 

Best Regards,

Todd.


[proud owner of a Williams Solar Fire]

- It's called "The American Dream" because you have to be asleep to believe it.
George Carlin
- Truly great madness cannot be achieved without significant intelligence.
Henrik Tikkanen
- "Reality check, Michelle, Talk about composure, Total lack of. He's a man-- About-- 12 Feet Tall--"
Carrie Kelly
Posted Image

#7 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 07 June 2013 - 08:24 PM

Another thing to try is the following...
Sub Plunger_Timer()
    If Plunger.MotionDevice > 0 Then
        Plungers(AnPlOldPos).alpha = 0
        AnPlNewPos = INT(Plunger.Position \ 2)
        Plungers(AnPlNewPos).alpha = 1
        PRefresh.State = ABS(PRefresh.state -1)
        AnPlOldPos = AnPlNewPos
    End if
End Sub

The INT should force it to round down to 12 and not up to 13 when the plunger is pulled fully back (which is where I believe the problem to lie)

Or, if that doesn't work, then try...
 
Sub Plunger_Timer()
    If Plunger.MotionDevice > 0 Then
        Plungers(AnPlOldPos).alpha = 0
        AnPlNewPos = INT(Plunger.Position \ 2)
        If AnPlNewPos > 12 Then AnPlNewPos = 12
        Plungers(AnPlNewPos).alpha = 1
        PRefresh.State = ABS(PRefresh.state -1)
        AnPlOldPos = AnPlNewPos
    End if
End Sub

The 12 is dependent on the 'Plungers' array, and may need to be adjusted to 11 depending on the number of images...

Edited by koadic, 07 June 2013 - 08:24 PM.


#8 imagamejunky

imagamejunky

    Addicted

  • Members
  • PipPipPip
  • 104 posts
  • Location:CA Bay Area

  • Flag: United States of America

  • Favorite Pinball: TZ, IJ, MM, TOTAN, CV, TAF, AFM, STTNG, T2

Posted 09 June 2013 - 05:09 AM

Thank you VERY much guys. I will try these suggestions when Im home Tuesday.

#9 imagamejunky

imagamejunky

    Addicted

  • Members
  • PipPipPip
  • 104 posts
  • Location:CA Bay Area

  • Flag: United States of America

  • Favorite Pinball: TZ, IJ, MM, TOTAN, CV, TAF, AFM, STTNG, T2

Posted 11 June 2013 - 04:10 AM

All fixed!

 

Thank you guys for your input.

 

Koadic, your second suggestion of adding " AnPlNewPos = INT(Plunger.Position \ 2) " and " If AnPlNewPos > 12 Then AnPlNewPos = 12 " did the trick.   I have played multiple games now after adding these script changes with no more errors.  Awesome!!

 

Kruge99, this script that you suggested is exactly how it was already written for both the classic and the enhanced versions.  I appreciate your advice though.

 

Thanks again.

TOTAN rocks!!