Main Forum > General Discussion

Need a little help ...

(1/2) > >>

Les73gTx:
Hello all,

I am attempting to do a mod conversion to cabinet of a table that was already converted to VP 9.xx desktop. I have got it all up and running for the rotation and removing the score board from the backdrop and the B2S is already available and working great. The game plays ok but is a 2009 release of a 1978 ss table, so it does not have any of the newer VP9.9 stuff or lighting.
 What I am trying to do now is add ball rolling sounds to the script. I got the Ball rolling table from VPF here http://www.vpforums.org/index.php?app=tutorials&article=135 and pasted the needed script to the table. I had to remove some of it as it made all the sounds go away. then I added a trigger to the plunger lane and I think I named it right, but I am getting an error that now says "variable undefined: Sound Timer" and that is where I am lost  ... if I comment that out I do not get the error anymore but I have no rolling sounds yet ....
 I am a hardware guy and have ZERO scripting skills and it really confuses me to the point that I give up. I am a hands on or a show me one time type of learner ... reading stuff just doesn't stick to me for some reason. I am not looking for someone to do it for me as I want to learn this but I need some help.
 I am asking here because I was able to make the rotation and other minor adjustments from the tutorials that I found here.
 Just a warning; when I look at a script all I see is bla bla bla this then bla bla that then sub bla bla then end.  :Banghead:  and  :Cussing:

 Thank you for you time.

Itchigo:
Variable is undefined is you have a variable that's not "Dimmed" somewhere, or there's an incomplete sub.

All coding should be in blocks called subroutines.

Name of the sub with no spaces( if you're going to use a variable do it between these brackets)
If Score was not dimmed you'd get variable is undefined "score".

Dim Score
Sub Addscore(Score)

Do this
Do this
Do that

End Sub

What I would do if I were you is take out all coding you added about the ball rolling and start over. Add your triggers. Then add this:

Sub Trigger1_Hit()
Playsound "Roll1"
End Sub

For this I'm assuming this is for Trigger1, so it has to be named Trigger1. Do the same thing for all triggers you add for ball rolling at the very bottom of the script. I'm also assuming your sound clip is named Roll1.

Now if you wanted the sound to play when the ball LEAVES the trigger then do this:

Sub Trigger1_UnHit()     'Note UNHIT
Playsound "Roll1"
End Sub

That's good in a plungerlane.

Note: Adding at the bottom of the script isn't always the best way, but as long as you don't cut into another sub, it won't hurt you. Plus it's easy to find. It really doesn't slow vp much to have to look all over, people mainly keep things together for organization. Being SS the roms are doing most of the work for you. Doing it the way I showed you bypasses the roms, and it's easier to understand.

Hope that helps.

Les73gTx:
I will have some more time to look at this again this weekend ... thank you Itchigo ... I do understand what you are saying so that will set me in the right direction and that is what I needed.
 The more I look at and make small changes and see the results the more I am understanding .... just going to take some time, time that I need to find....

Les73gTx:
 I found some time today while the little ones are sleeping to play with this.
 Your routine works to play a sound that I have assigned to "roll1" and that is fine. The problem with that is the short sound byte does not really follow the ball and runs out and stops before the ball has another chance to hit another trigger unless I put triggers all over the table. The other Ball Rolling Table that I linked to is much more than just a simple sound file playing or not playing, and I would like to use that but I still have the same error going on.
'Ball-assignment
Sub SoundTrigger1_Hit                              'to be placed in the plunger lane, add similiar Triggers to all spots balls will be created (VUKs, holes etc.)
   Set SoundBall = Activeball
   SoundTimer.enabled = 1
   Flying = 1
   OnRamp = 1
   WireRamp = 1
End Sub

 It is that line in red that is giving me the trouble and error and I suspect it has something to do with the table script already there ... something is missing ???

Itchigo:
Soundtimer.Enabled is correct. That's the correct call to turn on a timer.

All your roll triggers should not be controlled by VPM. They should be scripted individually like that example.

For a short wav sound I'd either edit the sound clip, or get another one. But beware. Too many doesn't sound right either. Sounds like the ball is rolling and it drowns out other sounds, or takes your focus away from the game.

I usually use about 5 or 6 custom triggers in certain areas for ball rolling.

If you want to pm it to me, I'll take a look. :Smile:

Navigation

[0] Message Index

[#] Next page

Go to full version