Graphics

 View Only
  • 1.  Run scene director at random intervals?

    Posted 10-17-2019 08:27

    So, I know I can have a scene for animate in, and a scene for animate out... All good...
    I know I can trigger scene directors from either visual logic or from the event triggers in the scene directors.

    However, for a Halloween themed production, I'm looking for a way to have a scene allways on, however at random intervals it runs one of X-number scene directors.

    So:

    • If scene is on.
    • Wait X-seconds.
    • Run Scene Director Y.
    • Start over...

    The goal here is to have a spider run across some parts of the big screen at random intervals.
    I've done next to no scripting in Xpression before, so any help here would be greatly appreciated.



  • 2.  RE: Run scene director at random intervals?

    Posted 10-17-2019 20:45

    I think I've got an idea of how to accomplish this; how long are you thinking pausing in between the runs?

    I know one solution, but I'm not sure how well very long scene directors would work...


    #XPression


  • 3.  RE: Run scene director at random intervals?

    Posted 10-17-2019 23:24

    I was thinking maybe anything from 30 seconds to 3 min... But I think I might approach this from a different angle, and pull it out from Dashboard instead. Creating a timer there with a random value. Then when it reaches 0 it will pull one random animation (this way I can have several), and then set the timer back up to a random number and start counting again. I could also make sure that the animation is never the same as the last three for example... I'd have to have several scenes for that, but yeah...

    But if you got a good idea on how to do this in XPression, then sure!


    #XPression


  • 4.  RE: Run scene director at random intervals?

    Posted 10-18-2019 19:58

    I know is not a simple and fast solution but it might be flexible. (made it in visual logic)

    • Create 2 scene in Scene Director - first with your animation and second for random wait
    • Generate a number in your time range - 30sec to 3 min (180sec) * framerate (25). 750 - 4500.
    • Get an EventMarker in your scene and hide it (from eye)
    • When your first scene reach the last timeline element goes to pause - use this "event" to start the second scene
    • Second scene must contain a Animation controller (dummy - any transition between 2 values) in order to have the play time
    • Durring the play of the second scene, "Freeze" the value of your random number and check if the actual position is Equal with your random number
    • When it is equal, make EvenMarker visible
    • Use this EventMarker as event to stop the waiting scene and the first scene too (as reset of play position)
    • Add another "Rule" in Visual Logic - if the first scene is on Stop then Play it :D  and the scene will auto restart and generate a different waiting time.

    Fill free to test all this in the following Xpression file: 
    https://www.dropbox.com/s/h7is3bb2vufnmv8/Randowm%20Wait.xpf?dl=0
    I have some other hidden text too in order to monitoring numbers and play position.

    Have FUN!
    Gabriel


    #XPression