- This topic has 2 replies, 2 voices, and was last updated 4 years, 7 months ago by zimbakin.
-
AuthorPosts
-
October 8, 2019 at 1:39 am #147352
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.You need to login in order to like this post: click here
October 8, 2019 at 8:57 am #147396you’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"
You need to login in order to like this post: click here
1 user thanked author for this post.
October 8, 2019 at 11:29 pm #147488The 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.You need to login in order to like this post: click here
-
AuthorPosts
Forums are currently locked.