Jump to content



Photo
- - - - -

Add Rom event to VPX script as a trigger

VPX

  • Please log in to reply
11 replies to this topic

#1 BigOnYa

BigOnYa

    Hobbyist

  • Members
  • PipPip
  • 25 posts

  • Flag: United States of America

  • Favorite Pinball: Cyclone

Posted 05 March 2026 - 03:00 PM

Ok so I'm making a pup pack for myself and can't find any way to trigger multiball pupevent in the script on this table. The Rom only triggers a certain song during multiball, then goes back to normal music when multiball is over, but the song is not in script or sound manager. Using Vpinmame/ altsound, it shows me which sound file is triggered from the Rom, and the HEX ID of the file used during multiball.
So my question is, is there a way to use that HEX ID in VPX script? Like example:
If 0x00003 (=1/On/or whatever) Then pupevent 03
Also I've already looked at DOF Config Tool for this table, and no luck.

Edited by BigOnYa, 05 March 2026 - 03:26 PM.


#2 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,665 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 05 March 2026 - 07:12 PM

It's been a while now, and I don't remember exactly how I did it.

 

I searched for the sound IDs using PinMAME32,

then, thanks to some code written by Destruk,

I used the sounds to move the alligator's mouth from the Surf 'n Safari table.

Look for "Sound Subs from Destruk's table", which should be at the end of the scripts.



#3 BigOnYa

BigOnYa

    Hobbyist

  • Members
  • PipPip
  • 25 posts

  • Flag: United States of America

  • Favorite Pinball: Cyclone

Posted 06 March 2026 - 03:34 AM

It's been a while now, and I don't remember exactly how I did it.

 

I searched for the sound IDs using PinMAME32,

then, thanks to some code written by Destruk,

I used the sounds to move the alligator's mouth from the Surf 'n Safari table.

Look for "Sound Subs from Destruk's table", which should be at the end of the scripts.

I tried copying that script from that table: 

"Sub TrackSounds
    Dim NewSounds, ii, Snd
    NewSounds = Controller.NewSoundCommands
    If Not IsEmpty(NewSounds) Then
        For ii = 0 To UBound(NewSounds)
            Snd = NewSounds(ii, 0)
            If Snd = 6 Then JawAnim:AnimStep=19"......etc

using the HEX sound numbers, in to this tables script but it does not cue anything in my script from the Rom sounds played.

Oh well, not a big deal, was just curious if was possible. Thanks for responding though and trying to help.
 


Edited by BigOnYa, 06 March 2026 - 04:05 AM.


#4 bigus1

bigus1

    Pinball Fan

  • Members
  • PipPipPipPip
  • 973 posts
  • Location:Brisbane, Australia

  • Flag: Australia

  • Favorite Pinball: Firepower

Posted 06 March 2026 - 04:36 AM

A Multiball insert light would be easy to tap for a trigger. Lights are the most common way to trigger extra table events linked to the ROM

You could also poll the trough -  If bstrough.balls <2 then .... ( for 3 ball trough)    and add a delay to the polling after drain if there's a ball-saver.


Edited by bigus1, 06 March 2026 - 04:59 AM.


#5 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,665 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 06 March 2026 - 04:40 PM

It makes sense to use the altsound IDs directly in scripts, but they're in hexadecimal,

so you need to convert them to decimal to use them in scripts.

You need a timer to run the TrackSounds.

 

Set MotorCallback = GetRef("GameTimer")

Sub GameTimer
    TrackSounds
End Sub

Sub TrackSounds
    Dim NewSounds, ii, Snd
    NewSounds = Controller.NewSoundCommands
    If Not IsEmpty(NewSounds) Then
        For ii = 0 To UBound(NewSounds)
            Snd = NewSounds(ii, 0)
            If Snd = 3 Then pupevent 03
        Next
    End If
End Sub

 



#6 BigOnYa

BigOnYa

    Hobbyist

  • Members
  • PipPip
  • 25 posts

  • Flag: United States of America

  • Favorite Pinball: Cyclone

Posted 07 March 2026 - 07:32 AM

It makes sense to use the altsound IDs directly in scripts, but they're in hexadecimal,
so you need to convert them to decimal to use them in scripts.
You need a timer to run the TrackSounds.
 

Set MotorCallback = GetRef("GameTimer")Sub GameTimer    TrackSoundsEnd SubSub TrackSounds    Dim NewSounds, ii, Snd    NewSounds = Controller.NewSoundCommands    If Not IsEmpty(NewSounds) Then        For ii = 0 To UBound(NewSounds)            Snd = NewSounds(ii, 0)            If Snd = 3 Then pupevent 03        Next    End IfEnd Sub
Thank you for trying to help, I copied that code into script, changed to "Snd = 164" (0x00A4 HEX sound trigger) but still no luck. I tried bunch of dif sounds, but none will trigger. Does it matter that I'm using alias table (che_cho,harley) or using altsounds?
Is weird though, those Hex triggers from Rom are triggering the sounds in the altsound folder, but can't get them to trigger anything in the script. Oh well, either way I bout give up trying, got almost every other trigger for the table covered by script events, just missing a few, but not that important. Thanks again for everyone's help, hope you have a great day/ night.

Edited by BigOnYa, 07 March 2026 - 08:00 AM.


#7 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,665 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 07 March 2026 - 07:52 AM

To see if anything happens, add a textbox to the backdrop,

and add this to the end of the script.

Textbox001.Text = Snd

 

 

It should display the sound IDs; they're fast pulses that aren't easy to see.

Set MotorCallback = GetRef("GameTimer")

Sub GameTimer
    TrackSounds
End Sub

Sub TrackSounds
    Dim NewSounds, ii, Snd
    NewSounds = Controller.NewSoundCommands
    If Not IsEmpty(NewSounds) Then
        For ii = 0 To UBound(NewSounds)
            Snd = NewSounds(ii, 0)
            If Snd = 3 Then pupevent 03
        Next
    End If
    Textbox001.Text = Snd
End Sub

 



#8 BigOnYa

BigOnYa

    Hobbyist

  • Members
  • PipPip
  • 25 posts

  • Flag: United States of America

  • Favorite Pinball: Cyclone

Posted 07 March 2026 - 08:34 AM

Its not showing anything in the textbox, I even switched to white background w black text to see if I missing it, but no nothing at all showing, tried 5 dif hex sounds triggered from the altsound folder even.
Edit, just tried without altsounds enabled, and it not showing anything in textbox either.

Edited by BigOnYa, 07 March 2026 - 08:39 AM.


#9 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,665 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 07 March 2026 - 08:38 AM

Can you tell me what table this is?

So I can try it too.



#10 BigOnYa

BigOnYa

    Hobbyist

  • Members
  • PipPip
  • 25 posts

  • Flag: United States of America

  • Favorite Pinball: Cyclone

Posted 07 March 2026 - 08:40 AM

Cheech and Chong Road trip' pin
https://www.vpforums...&showfile=15975
The altsound folder is included in that dl, which lists the Hex triggered sounds.
Rom:
https://www.vpforums...&showfile=15971
Thanks again for helping.

Edited by BigOnYa, 07 March 2026 - 09:04 AM.


#11 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,665 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 07 March 2026 - 09:53 AM

It works for me, even with AltSound enabled.

The table already has its own GameTimer, maybe that's why it doesn't work.

 

Delete this

Set MotorCallback = GetRef("GameTimer")

Sub GameTimer
    TrackSounds
End Sub

 

and add the TrackSounds call here.

Set MotorCallback = GetRef("RealTimeUpdates")

Sub RealTimeUpdates
    RollingUpdate
    ClowUpdate
    TrackSounds
End Sub

 



#12 BigOnYa

BigOnYa

    Hobbyist

  • Members
  • PipPip
  • 25 posts

  • Flag: United States of America

  • Favorite Pinball: Cyclone

Posted 07 March 2026 - 03:37 PM

It works for me, even with AltSound enabled.
The table already has its own GameTimer, maybe that's why it doesn't work.
 
Delete this

Set MotorCallback = GetRef("GameTimer")

Sub GameTimer
    TrackSounds
End Sub
 
and add the TrackSounds call here.
Set MotorCallback = GetRef("RealTimeUpdates")

Sub RealTimeUpdates
    RollingUpdate
    ClowUpdate
    TrackSounds
End Sub
That's it! You are the man! All working good now. Thank you so much.





Also tagged with one or more of these keywords: VPX