Graphics

 View Only
  • 1.  Basketball Score Bug Animation Scripting

    Posted 12-22-2023 12:21

    I am new to scripting and have been trying to tech myself Visual Basic but I need some help trying to make this work. Essentially I am working on a basketball score bug and I want it to play different animations depending on how much a certain text object increases. I have it set up right now to only play a single animation every time a text objects changes/updates. My script looks like this (for reference I have two text objects each for HOME and AWAY, one hidden and one visible, it is Datalinqd to Daktronics):

    On the scene itself:

    OnOnline

    Dim scr as xpTextObject

    scene.GetObjectByName("AW ScrText" , scr)

    scene.GetObjectByName("Aw Score" , txt)

    txt.Text = scr.Text

    --------------------------------------------------------------------

    On the hidden script (this example is only for the away score):

    OnSetText

    Dim dir as xpSceneDirector

    scene.GetSceneDirectorByName("AW Score" , dir)

    dir.PlayRange(0,60)

    ______________________________________________

    I want to change this to play a simple animation when the hidden text increases by 1 or 2 (For a free throw or field goal in basketball), and then play a different more complicated animation when it increases by 3. I know this is probably simple I am just in the process of learning so thank you for any help you can provide!



    ------------------------------
    Nathaniel Rudolph
    Xpression Graphics Operator
    CSBN
    ------------------------------


  • 2.  RE: Basketball Score Bug Animation Scripting

    Posted 12-22-2023 12:39

    I am guessing inside the text I would have to put three different scripts as OnSetText, one for it increasing 1, one for 2 points and one for it increasing 3 points.

    Would it need to be something like this?

    Dim previousValue As Double

    Dim currentValue As Double

    Dim increaseAmount As Double = 1.0

    Dim dir as xpSceneDirector

    If currentValue > previousValue AndAlso currentValue - previousValue >= increaseAmount Then

    scene.GetSceneDirectorByName("AW Score" , dir)

    dir.PlayRange(0,60)



    ------------------------------
    Nathaniel Rudolph
    Xpression Graphics Operator
    CSBN
    ------------------------------