PUP scripting – consecutive videos?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #147352
    zimbakin
    Participant
      @zimbakin
      Member

      Is it possible to script x2 PUP videos to play consecutively (one after the other) from a single trigger?
      Trying to reactivate Attract mode after Game Over.

      Eg. Play random video from “GameOver” playlist (videos of different lengths)
      Then when random “GameOver” video is done, play “AttractMode” video.
      The timer isn’t working for me and possibly not the best solution. ROM is limited in selections.

      Sub StopControl_Hit
      if scores(24) = 5 Then
      PuPlayer.playlistplayex pMusic,"audioclear","clear.mp3",100, 1
      PuPlayer.playlistplayex pBackglass,"GameOver","",100,20
      vpmtimer.addtimer 42000, "AttractMode '"
      End If
      End Sub

      Sub AttractMode
      if contballinplay = false And scores(24) = 0 Then
      PuPlayer.playlistplayex pBackglass,"AttractMode","AttractMode-1.mp4",100,16
      PuPlayer.SetLoop 2,1
      End If
      End Sub

      Never take advice from me,
      you'll end up drunk.

      #147396
      NailBuster
      Moderator
        @nailbuster
        ModeratorMember

        you’ll need to use a timer.  but vpmtimer is only for ROM/B2S and doens’t work with originals

        you can make your own like this:  create a timer on table called pTriggerScript and set it to 250ms interval.

        add this to your table:

        Dim pReset(5)
        Dim pStatement(5) 'holds future scripts
        Dim FX

        for fx=0 to 5
        pReset(FX)=0
        pStatement(FX)=""
        next

        DIM pTriggerCounter:pTriggerCounter=pTriggerScript.interval

        Sub pTriggerScript_Timer()
        for fx=0 to 5
        if pReset(fx)>0 Then
        pReset(fx)=pReset(fx)-pTriggerCounter
        if pReset(fx)<=0 Then
        pReset(fx)=0
        execute(pStatement(fx))
        end if
        End if
        next
        End Sub

        Sub TriggerScript(pTimeMS,pScript)
        for fx=0 to 5
        if pReset(fx)=0 Then
        pReset(fx)=pTimeMS
        pStatement(fx)=pScript
        Exit Sub
        End If
        next
        end Sub

        TriggerScript 4000,"Msgbox 1234"

        TriggerScript 7000,"msgBox 5648"

        1 user thanked author for this post.
        #147488
        zimbakin
        Participant
          @zimbakin
          Member

          The timer works, thanks.
          However, now the shorter random videos loop until the timer ends.
          Is there a way around this in script (or would I need to make all the "GameOver" videos the same length to work with the timer)?

          Objective is to have random "GameOver"  videos play once, then play "AttractMode" when done.

           

          Sub StopControl_Hit
           if scores(24) = 5 Then
            PuPlayer.SetLoop 2,0
            PuPlayer.playlistplayex pBackglass,"GameOver","",100,17
            TriggerScript 43000,"AttractModeOver'"
           End If
          End Sub

          Sub AttractModeOver
            PuPlayer.playlistplayex pBackglass,"AttractMode","AttractMode-1.mp4",100,18
            PuPlayer.SetLoop 2,1
          End Sub

          Edit ////////

          Made all the game over videos the same length, problem solved.

          Never take advice from me,
          you'll end up drunk.

        Viewing 3 posts - 1 through 3 (of 3 total)

        Forums are currently locked.

        ©2024 VPinBall.com

        Log in with your credentials

        Forgot your details?