Graphics

 View Only
  • 1.  Football Play Clock Script

    Posted 08-28-2024 12:54

    I currently am trying to write a script that plays a scene director whenever a datalinq hits ":05" and anytime above that, it plays out a different scene director. It would also be nice if that animation could pause when the timer pauses, but it's definitely not necessary. This is where I'm at so far:

    dim PlayClockRed, PlayClockReset as xpSceneDirector
    
    scene.GetSceneDirectorByName("PlayClockRed", PlayClockRed)
    scene.GetSceneDirectorByName("PlayClockReset", PlayClockReset)
    
    if text = ":05" then
    PlayClockRed.playrange(0, PlayClockRed.duration)
    end if
    
    if text = ":00" then
    PlayClockReset.playrange(0,0)
    end if

    This code works once and then doesn't play it out again without taking the scene offline and putting it back on. Anyone have any ideas?



    ------------------------------
    John Spitznagel
    Video Production Engineer
    Elon University
    ------------------------------


  • 2.  RE: Football Play Clock Script

    Posted 08-30-2024 14:35

    Hey John! It looks like you're not setting the PlayClockRed scene director back to the beginning, only the PlayClockReset scene director. You can use PlayClockRed.Position(0) or PlayClockRed.PlayRange(0,0).

    Additionally, I find it better to reset the scene directors when text="40" or text="25" since the play clock might not always hit 0, but it will always reset to one of those numbers. (Also note that I have my red background visibility animating on frame 1 of the scene director, which is how I avoid using two scene directors)

    dim sd as xpSceneDirector
    
    scene.GetSceneDirectorByName("PLAYCLOCK COUNTDOWN",sd)
    
    if text="40" OR text="25" then
    sd.PlayRange(0,0)
    
    else if text="5" then
    sd.PlayRange(0,300)
    end if

    Having the animation stop is a little more difficult. A quick and easy way would be to set ranges for each second under 5. This is built for a 59.94 system and my animation is 360 frames long. Example below.

    dim sd as xpSceneDirector
    
    
    scene.GetSceneDirectorByName("PLAYCLOCK COUNTDOWN",sd)
    
    
    if text="40" OR text="25" then
    sd.PlayRange(0,0)
    
    
    else if text=5 then
    sd.PlayRange(0,60)
    
    else if text=4 then
    sd.PlayRange(60,120)
    
    else if text=3 then
    sd.PlayRange(120,180)
    
    else if text=2 then
    sd.PlayRange(180,240)
    
    else if text=1 then
    sd.PlayRange(240,300)
    
    else if text=0 then
    sd.PlayRange(300,360)
    
    end if

    Hope this helps! 



    ------------------------------
    Brishen Thompson
    Demonstration Artist & Trainer - Generalist
    Ross Video
    ------------------------------