Announcement

Collapse
No announcement yet.

Ticker Command - Don'y play if no message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ticker Command - Don'y play if no message

    Hi,

    I want to put a safety on our ticker elements to avoid empty elements going to air (user error).

    Currently, I have script in my scene that checks if first SrcGrp container is empty?

    It's not working properly, script works if there is no container but I need to re-compile my script in order for it to work if container is not empty?

    Any suggestions would be great. I'm trying both system command and the director methods.

    Thanks.


    Code:
    '===========================================>>
    ' Done By: Charlotte
    '=============================================
    ' TICKER: Prevent triggering if no message
    
    ' Check first SrcGrp for child containers
    ' No child containers == No message
    '    child containers    == play director
    '    no child containers == show frame 0
    '    no child containers == stop director
    '===========================================>>
    
    dim SrcGrpC     as container = FindSubcontainer("SrcGrp").FirstChildContainer
    dim ScrollsD    as director  = Stage.FindDirector("SCROLLS")
    
    sub checkScrollMessage()
        SrcGrpC.Update()            
        
        if SrcGrpC = null then
    '        ScrollsD.Show(0.000)
    '        ScrollsD.StopAnimation()
            System.SendCommand("MAIN_SCENE*STAGE*DIRECTOR*$SCROLLS SHOW BEGIN")
            println "Scroll Generic, no message == no play...boooooo ========="
        end if
        
        if SrcGrpC <> null then
    '        ScrollsD.Show(0.000)    
    '        ScrollsD.ContinueAnimation()
    '        System.SendCommand("MAIN_SCENE*STAGE*DIRECTOR*$SCROLLS CONTINUE")
            println "Scroll Generic has messages to play...woot woot ========="        
        end if    
        SrcGrpC.Update()
    end sub
    
    '/=======================================================================>
    '/=======================================================================>
    Last edited by clopez11; 10-05-2017, 05:18 PM.

  • #2
    If there is no messages in the carousel active list it will not play, So no need to implement a fix there, I assume that you mean that When a person puts an empty text element in the carousel list...
    Im sure with an empty text element it will still add the font container as a child of SrcGrp but it will not contain any text inside the font. Do a check in SrcGrp child containers if the current first child container font has text.... If this.FirstChildContainer.geometry.text = "" (assuming the script is sitting on SrcGrp...SrcGrp would be "This"). That would check if the child container font has any text...

    Comment


    • #3
      Thanks for this Novacane89.

      Yes, you are correct about the empty carousel not playing if there is no message.

      The template would still animate even if there is no messages in carousel which is what we want to avoid.

      I like your idea of finding if current first child container contains text. I will give that a try too.

      Comment


      • #4
        Cool , Let me know if that worked for you.

        Another thing...
        I am also a fan of using "System.SendCommand" if there is no alternative... Because it gets the job done, However the drawback of using system.sendcommand is that the engine actively has to stop for a brief moment to process the command. So whilst its useful for alot of things. Only resort to that command if you cannot find the alternative native viz script option. Viz script commands do not 'halt' the system when being processed.

        For example. Instead of using
        System.SendCommand("MAIN_SCENE*STAGE*DIRECTOR*$SCROLLS SHOW BEGIN") I would have used the native VizScript option to do the same thing.
        ------dim ScrollDir as Director = Stage.FindDirector("SCROLLS")-----
        ------ScrollDir.time = 0------
        or
        ------ScrollDir.ContinueAnimation()------ depending on your needs Regards
        Last edited by Novacane89; 10-09-2017, 08:40 AM.

        Comment


        • #5
          Awesome, these are all great info. Thanks!

          This code worked great for me. The geometry text you suggested earlier gave me an idea for another solution I was trying to figure out.

          Really what I could do is just turn on/off the containers if message = false. I don't think I really need the system commands for this to make it simpler.

          Code:
          '===========================================>>
          ' Done By: Charlotte
          '=============================================
          ' TICKER: Prevent triggering if no message
          
          ' Check first SrcGrp for child containers
          '     No child containers == No message
          '        show frame 0
          '        stop director
          '     Child containers == Message
          '        play director
          '===========================================>>
          
          dim SrcGrpC      as container = FindSubcontainer("SrcGrp")
          dim SrcGrpChildC as container = SrcGrpC.FirstChildContainer
          dim ScrollsC     as container = this
          dim ScrollsD     as director  = Stage.FindDirector("SCROLLS")
          dim ContCount    as integer   = SrcGrpC.ChildContainerCount
          
          sub checkScrollMessage()            
              SrcGrpC.Update()
              println ContCount & ".....Number of child containers"
          
              if ContCount >= 1 then
                  ScrollsC.active = true
                  println "Scroll Generic has messages == play...woot woot ========="        
              end if        
              
              if (ContCount = 0) or (ContCount >= 1 and SrcGrpChildC.active = false) then
                  ScrollsD.Show(0.00)
                  ScrollsC.active = false
                  System.SendCommand("MAIN_SCENE*TREE*$GENERIC*GEOM clear INVOKE;")
                  System.SendCommand("MAIN_SCENE*TREE*$GENERIC*GEOM reinitialize INVOKE;")
                  System.SendCommand("RENDERER*MIDDLE_LAYER*STAGE*DIRECTOR*SCROLLS SHOW $O")        
                  println "Scroll Generic has no messages == no play...boooooo ========="
              end if
          end sub
          
          '/=======================================================================>
          '/=======================================================================>
          Last edited by clopez11; 10-10-2017, 12:38 PM.

          Comment

          Working...
          X