Jump to content



Photo

Help with kicker delay/timer


  • Please log in to reply
18 replies to this topic

#1 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 16 December 2012 - 07:47 AM

I swear I've done this before without much trouble, but maybe I didn't because whatever I'm trying isn't working, seems like it should be simple though.  A kicker on a VPM table is firing too quickly for my liking.  The ball should land in there, sit for a second or two, then fire out.  Instead it just fires out as soon as its hit.

I would like to either delay it a bit at all times, or better yet I would actually only want to delay it (or delay it longer) when this kicker is locking a ball, but not sure if that is possible.  As for why it isn't holding as long as it would in real life, IDK, it must be an emulation issue (GamePlan).



#2 StevOz

StevOz

    Pinball Fan

  • VIP
  • 1,721 posts
  • Location:Nirvana

  • Flag: Australia

  • Favorite Pinball: Scared Stiff



Posted 16 December 2012 - 09:12 AM

Posting the relevant script and table name involved would provide the quickest and best solutions.

 

Either way I know a most exact emulation can be done via script to override any of the VPM scripts inadequacies, be they real or perceived.


Edited by StevOz, 16 December 2012 - 10:53 AM.

Files I have uploaded here...

 

http://www.vpforums....ownloads&mid=34


logoshort.gif


#3 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,307 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 16 December 2012 - 11:48 AM

The only game from GamePlan with Multiball is Cyclopes.  Just tried it here and it locks balls and kicks out correctly - ie

You light the lock, lock the ball, another ball is put into the plunger lane, you launch the ball, and on the first playfield switch hit from the ball in play it releases the locked ball.

 

From this video you see the top saucer, ball hits it, and nearly instantly after playing a sound it kicks the ball out.  So you must be talking about the lock system delay?

http://pinball.org/v...ideos/cyclopes/

 

If lock isn't lit it kicks the ball out immediately from the lock saucer when hit.

If yes, then if your trough switches are wrong, it'd see that there isn't another ball to put into play and release the locked ball too soon.  If the game is tilted then it releases the balls instantly.

Note - from same said video, the new ball isn't put into the plunger lane until the spinner stops spinning from the ball shot that was locked.


Edited by destruk, 16 December 2012 - 11:51 AM.

Build a fire, vipers love the heat.


#4 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 16 December 2012 - 08:51 PM

Yes when lock is not lit, I'm not as concerned about that.  I still think it fires a little too quickly, but the main thing is when lock is lit, like you see on the video, I was counting like at least 7-8 seconds of the bell going off before the new ball was kicked into the lane. 

Hmm, I never gave it any thought that the spinner might be causing the delay.  Not sure why the game needs to wait on that to finish.  But I think you must be right because later in that video, something causes the bell to only go off for a quick second but I couldn't tell what the hell it was (around the 4:20 mark).  Then later in the vid (around 5:13), after a bonus countdown, you then hear 2 quick spurts of ringing.  I would think it would be taking place of the knocker, given where it is firing, but I was almost certain this game had a knocker, I think its in the manual.  I'm not sure how to deal with this, I don't think, may need help sorting this out, sorry that it strays a bit from my OP.  I always thought that solenoid was either on or off.  What is controlling how long that bell stays ringing?

 

Btw, I ask because I'm about to release a new version that has a now correct sounding & long bell sound in it, but as of now it goes off for 7-8 seconds every time (cuz that is the length of the sound clip).  Yeah I may need help with that.  Never really encountered something like this before, & of course the bell alarm is pretty unique.  & the manual pages I have aren't very helpful with any details.

 

Also for future reference I still wouldn't mind knowing how one would generally go about adding a pause before solenoids fire.  Whatever I was trying with timers just wasn't working, but it could just be poor coding skills.


Edited by rob046, 16 December 2012 - 09:12 PM.


#5 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,307 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 16 December 2012 - 08:59 PM

The bell fires for variable lengths of time.  What you could do is use a timer to check the spinner spinning, and use goldwave or audacity to crop out the middle of your bell sample and loop it in the script.

Ie -

use playsound"bell",-1 to loop, and stopsound"bell" when the spinner doesn't spin within the timer expiration.

 

You can artificially delay anything you like with

Sub kicker_hit:vpmAddTimer,100,"bsSaucer.AddBall 0":End Sub

 

Where 100 is the delay in milliseconds and the line within quotes is what should happen after that delay

 

Or what would probably be more accurate would be to lower the friction on the spinner so it spins longer when a ball is locked.

 

If you want to ignore the bell solenoid on bootup, do what needs to be done for the early gottlieb system 80 games and mask the solenoids in table_init.

 

Controller.SolMask(0)=0
 vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to re-enable all the solenoids after 2 seconds
 

Edited by destruk, 16 December 2012 - 09:02 PM.
added bell info

Build a fire, vipers love the heat.


#6 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 16 December 2012 - 09:39 PM

I guess that could lengthen the bell in that case (though a loop of a shorter sample might not sound too good).  But this would, I suppose, fix me up & give me the short bursts I need the other times the bell fires.  I just hope I can get the loop to sound OK, because it will now be a loop of a short burst not even lasting 1 full second, so it might loop 8 times.
Also, if I go to a short burst, then the bell at startup won't be nearly as annoying.
 
I guess as long as the solenoids are numbered correctly everything should be OK.  Though I know gameplan has mismatched solenoid numbers in pinmame.  Not even sure how you guys figured out what was what.  I don't even remember how I figured out which solenoid controlled the bell years ago when I added it.  Maybe trial & error.  IRL, it is sol #15.  In VPM, I apparently came up with it being #31.
 
Thanks for the delay info.  I swear I knew that at one time but I guess I forgot.
& I want to release the update today so you can look at it then if you want.
Thanks.

Edited by rob046, 16 December 2012 - 10:08 PM.


#7 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 16 December 2012 - 10:06 PM

EDIT: I just asked a stupid question in this post.  Nevermind.  I'm an idiot. :(  Man I sure am rusty with some code.  basic 101 stuff has left my brain.


Edited by rob046, 16 December 2012 - 10:12 PM.


#8 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,307 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 16 December 2012 - 10:12 PM

Spinner1.TimerInterval=1000 'set timer for spinner to 1 second intervals
 
Sub Spinner1_Spin
    If Not Spinner1.TimerEnabled Then 'if this is the FIRST time the spinner was hit this sequence
         PlaySound "bell",-1 'begin playing the bell sound in a loop
    End If
    Spinner1.TimerEnabled=0 'disable timer for spinner so count is reset
    Spinner1.TimerEnabled=1 'enable spinner timer for 1 second interval set above
    vpmTimer.PulseSw xx 'pulse the spinner switch number
End Sub
 
Sub Spinner1_Timer
    Spinner1.TimerEnabled=0 'timer interval has expired without another spin of the spinner object, so disable the timer
    StopSound "bell" 'stop the lopping bell sound
End Sub

 

Something like that should be sufficient.  Maybe a timer interval of 500ms would be better but you'll have to test and see what you like.


Build a fire, vipers love the heat.


#9 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 16 December 2012 - 11:17 PM

Thanks.  I think I need to tie in the lock saucer somehow though, but only when lock is lit as well.  Because the spinner doesn't directly fire off the bell.  It seems to only signal when to stop the bell sound once the ball is in the lock.  So I also don't want the bell firing off when the ball is in that kicker either.  Only when the ball is in there AND lock is lit.  Though even with that, the lock light is a pulsing light so I'm not sure if coding something for when the light is lit would even work.  Damn this just got real confusing.

 

You know, I wonder if I wouldn't be better off just manually playing a longer version of the bell for when the ball is in the lock with lock light lit.  Just ignoring the spinner entirely, since we aren't even positive that the spinner stopping is what for sure stopped that sound.

So for the sub that controls that solenoid that I made...

 

Sub bellsound(enabled)
        If enabled and locklamp.state=1 and ballinlock=1 then playsound "longerbellsound"
        If enabled and locklamp.state=0 and ballinlock=0 then playsound "bell"
End Sub

 

Something along those lines.  I'll see what I can do.  I guess that would be a bit of a hack, but at least I wouldn't have to deal with any looping.  Plus like I said, do we even know for sure that the spinner stopping spinning is really stopping the bell?  Besides, I think that would work well because that spinner is going to spin about the same amount of times every time you make that shot, because it requires a clean shot to make it in the lock every time.


Edited by rob046, 16 December 2012 - 11:41 PM.


#10 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 16 December 2012 - 11:55 PM

The above actually works well!  However, for some reason the 2nd time I got multiball & locked a ball, the bell didn't go off.  Not sure why.  Maybe because that lamp blinks when on, & you need to hit it when its in its on state?  Isn't there a "if lightlock.LampStateBlinking=1"  or "LightStateBlinking" statment I can use?  According to VP, NO I can't!

But upon further review, I don't think I even need the lamp state to factor in.  If the ball is in the kicker, do longer sound, if not, then shorter sound.


Edited by rob046, 17 December 2012 - 12:02 AM.


#11 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,307 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 17 December 2012 - 12:17 AM

According to vp, you can use If lightlock.state=2 Then  ' for blinking...

I don't see what the problem is - I mean since a locked ball is kicked out when the next ball in play hits a switch, it's not something to obsess over IMO.  But I hope you can figure out a way to script it the way you want so you can use the methods in the future to solve other real problems.

I don't have the real machine - played it once at a pinball show a few years ago and wasn't paying much attention to details when I played it.  And I haven't looked at the videos that closely either, but it makes sense for the spinner to have something to do with it for these reasons -

1) It's a really old, ancient clunky type game

2) it doesn't have much ability to strobe and track more than three or four possible switch closures per cycle

3) the repetitive bell sound would make sense to fire randomly during the game due to rom code errors, ruleset errors, broken/defective wiring, as well as to build anticipation and excitement during the game.  Perhaps the bell shouldn't even be in the machine, but it is an oddity that pays off for the theme.


Edited by destruk, 17 December 2012 - 12:22 AM.

Build a fire, vipers love the heat.


#12 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 17 December 2012 - 12:32 AM

According to vp, you can use If lightlock.state=2 Then  ' for blinking...

I don't see what the problem is - I mean since a locked ball is kicked out when the next ball in play hits a switch, it's not something to obsess over IMO.  But I hope you can figure out a way to script it the way you want so you can use the methods in the future to solve other real problems.

 

I think I have things sorted out, or will figure it out the way I want, it just isn't pretty usually.  Even with that video there is still some mysteries with how & why that thing fires off sometimes.  I might need to track down an owner.

I think one issue is that I'm just not sure this solenoid is behaving like it should.  This bell is also firing off right when multiball starts as soon as both balls are in play.  It isn't supposed to do that, according to the game in the video.  I may just have to live with things being imperfect.  This thing is firing & not firing at times that it simply shouldn't.

Do you know if there is math or a chart that figures out proper gameplan solenoid numbers?  This is #15 in the manual, but of course solenoid #'s don't match up in VPM as I mentioned.  Is it all trial & error?



#13 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,307 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 17 December 2012 - 01:03 AM

To determine solenoid numbers, change showdmdonly to false in table_init and make sure your 'hidden' is also false if you're using it to hide the display, then enter the self tests and for the solenoid test the number that shows in the displays in the number from the manual, while the white numbers in the bottom right corner are the numbers vpm uses.

The solenoid test is # 18, so press 7 until test 18 shows up in the display and it will cycle in sequence all the solenoids from first to last.

1=10

2=15

3=1

4=2

5=9

6=4

7=5

8=8

9=6

10=7

11=3

12=11

13=12

14=13

15=31

16=16

17=32

 

That is used for all games to figure out what solenoids are what, when any kind of self-test is available for it.

As for discrepencies in videos and vpm, another possibility is that we don't have every rom revision for the game in vpm.

However unlikely, the rom used in the game in the video could be different, which makes tracking down errors that much more difficult.


Build a fire, vipers love the heat.


#14 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 17 December 2012 - 05:24 AM

I never knew that!  That might come in handy in the future.

 

I also got things working pretty much perfectly here, or at least good enough.

 

To do this, I still made use of your spinner timer idea, just in a different way.

I got 2 bell sounds, 1 long & 1 short.

AFAIK, that longer bell sound only seems to happen right as the ball is locked.  Whether what stops the bell is indeed the spinner stopping or not, that bell still seems to go off for 7 seconds or so, & so it doesn't really matter.  Which is all I did for the long bell, its just a 7 or 8 second sound clip.

All other bell sounds seem like short bursts.

So the code that makes everything work as it should is...

 

Sub bellsound(enabled)
        If ballinlock = 1 and locktimer=1 then playsound "longerbellsound"
        If ballinlock = 1 and locktimer=0 then playsound "bell"
        If ballinlock = 0 and locktimer=0 then playsound "bell"
End Sub

 

Yeah all 3 of those lines are needed for things to be as they should, at least from what I can tell, for now (until I learn more about the bell IRL that might tell me otherwise).

The ballinlock value is just a variable tied into whether the lock switch is enabled or not.

Then "locktimer" is a variable I added to the spinner timer.  If timer is enabled, locktimer = 1.  Otherwise it is 0.  This was important in getting the long bell to only play when it should.  This is likely a hack compared to how the real game works, but it seems to get the job done.

 

Thanks for the help.  Glad to have this out of the way.  I got a somewhat big update done on this mod, probably have to wait til tomorrow to get them uploaded.



#15 destruk

destruk

    VPF Veteran

  • VPF Staff
  • 6,307 posts
  • Location:Colorado Springs, CO

  • Flag: United States of America

  • Favorite Pinball: Ultrapin!



Posted 17 December 2012 - 08:37 AM

no problem. :)


Build a fire, vipers love the heat.


#16 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 17 December 2012 - 10:10 PM

You can artificially delay anything you like with

Sub kicker_hit:vpmAddTimer,100,"bsSaucer.AddBall 0":End Sub

 

Where 100 is the delay in milliseconds and the line within quotes is what should happen after that delay

 

 

 

I couldn't get this to work, but there is a way to code it so that it does that is a little different.  Just wanted to post this for archival purposes in case somebody (or even myself) needs a working timer in the future...

 

Sub kicker_Hit:vpmTimer.AddTimer 100, "bsSaucer.AddBall":End Sub


Edited by rob046, 17 December 2012 - 10:15 PM.


#17 faralos

faralos

    VPF Veteran

  • Members
  • PipPipPipPipPipPip
  • 7,838 posts
  • Location:Eastern Pa,USA

  • Flag: United States of America

  • Favorite Pinball: Flash (Williams) 1979, Flash2 Updated




  • Trophies:

Posted 17 December 2012 - 10:52 PM

yet one more reason to love originals as none of them use roms


"Don’t let the noise of others’ opinions drown out your own inner voice.
And most important, have the courage to follow your heart and intuition.”
----Steve Jobs


#18 rob046

rob046

    Often Emulated, Never Duplicated

  • Members
  • PipPipPipPipPip
  • 2,023 posts
  • Location:Central PA

  • Flag: United States of America

  • Favorite Pinball: 8 Ball Deluxe, ToM, & Funhouse



Posted 17 December 2012 - 11:36 PM

yet one more reason to love originals as none of them use roms

 

That is actually the reason why many people don't like them.  Also it is still easier to code a VPM table than a good original.  Pinmame does a lot of the work for you.



#19 faralos

faralos

    VPF Veteran

  • Members
  • PipPipPipPipPipPip
  • 7,838 posts
  • Location:Eastern Pa,USA

  • Flag: United States of America

  • Favorite Pinball: Flash (Williams) 1979, Flash2 Updated




  • Trophies:

Posted 18 December 2012 - 01:40 AM

if you know how to sure...

for me though since I know absolutely nothing about coding a rommed table

I'll stick with originals :)


"Don’t let the noise of others’ opinions drown out your own inner voice.
And most important, have the courage to follow your heart and intuition.”
----Steve Jobs