No announcement yet.

Clock Question

  • Filter
  • Time
  • Show
Clear All
new posts

  • Clock Question

    I have a clock script that counts from 30 seconds, 45 seconds, 1 minute to zero and then animates off. It works fine for the 30 & 45 second options but for the 1 minute it does not animate off. Any ideas? Thanks in advance for the help.


    sub OnExecPerField()
    dim TestDir as Director
    TestDir = Stage.FindDirector("TestDir")

    dim t as double = System.SendCommand("CLOCK1*TIME GET")
    if t = 0.0 then TestDir.ContinueAnimation()
    end Sub

  • #2
    did you try

    if t <= 0.0 then xxx

    or try to print out the value of t, see what actually it was.


    • #3
      What is the syntax for printing out the value? I know you use the printIn function but cant get it to work.


      • #4
        Correction: I see the value on the engine output and it says 0.000000. It still does not work going between the :30 & :45 second clocks. The 1 minute clock does not animate off. Any Ideas?


        • #5
          Did you try i <= 0.0 ? onExecPerField can cause you to be in the situation of t=0.0000000001, and it will never be equal to 0.0
          You can also try to convert it to integer for comparison as well by using cint(var)

          To make it more effective, I would recommend to set the offset of animation out to 30,45,60, or etc.


          • #6
            Ho do i script to set an offset?


            • #7
              I tried using a parameter tracker and the 1 minute clock still did not animate off. It works in Artist but not in transition logic.


              • #8
                Ok i have settled on using an offset to move the out position to the desired time in the stage but i cant get it to update once the clock input changes. So when the clock is set to 45 seconds it animates out at 30 seconds. How do i have it get the value and update the offset time. The script below is what i have so far.

                dim Default as Director
                Default = Stage.FindDirector("Default")

                dim t as double = System.SendCommand("CLOCK3*TIME GET")

                sub OnExecPerField()
                if t = 30 then Stage.FindDirector("ENDTIME").offset = 30
                if t = 45 then Stage.FindDirector("ENDTIME").offset = 45
                if t = 60 then Stage.FindDirector("ENDTIME").offset = 60
                end sub


                • #9
                  Active Forum user
                  Shotski2 see if this helps

                  In the script, there is a line as follows

                  System.SendCommand("CLOCK1*TIME SET " & 5)

                  Change the number 5 to what ever number of seconds you need, I tried it using 5,10,30,45 and 60 and worked

                  You can improve on the script by adding a filed and read the number of seconds from that field that way the number of seconds does not have to be hard coded

                  Let me know if you have questions, I hope this helps and good luck
                  Attached Files


                  • #10
                    Thanks, I do need help scripting the field so the value can change to any number.


                    • #11
                      I tested in Artist and it worked but not when in transition logic :-(


                      • #12
                        Still does not work n transition logic. I have tried everything