vvtech Posted July 15, 2016 Share Posted July 15, 2016 I'm trying to turn on a light when the door bell is press and conditionals don't seem to work. I will like the light to come on from 7pm till 11pm. Delay for 5min and then turn off. Quote Link to comment Share on other sites More sharing options...
bbassinger Posted July 15, 2016 Share Posted July 15, 2016 You have to "nest" the commands under the conditional. Drag the one you want on top of the conditional so it applies. If the command indents under the conditional, it will work fine. Everything under the time conditional. You don't really need "stop" as there are not any additional commands after your condition. Sent from my iPhone using Tapatalk Quote Link to comment Share on other sites More sharing options...
Cyknight Posted July 15, 2016 Share Posted July 15, 2016 Don't use delays in the span of minutes please - it can cause major overall system delays. Instead, create a 5 minute timer, and start the timer instead - then on the timer expiring, turn the light back off. Other than that, yes, anything dependent on the if statement needs to be 'indented'. Quote Link to comment Share on other sites More sharing options...
ramesh.khiani Posted July 15, 2016 Share Posted July 15, 2016 Cyknight is right; create a 5 minute timer instead of delay and command indents under the condition. Quote Link to comment Share on other sites More sharing options...
msgreenf Posted July 15, 2016 Share Posted July 15, 2016 6 hours ago, ramesh.khiani said: Cyknight is right; create a 5 minute timer instead of delay and command indents under the condition. but use a timer as Cy said vs a delay. Delay introduces system lag. Timers are the correct way to do what you want. Quote Link to comment Share on other sites More sharing options...
bbassinger Posted July 15, 2016 Share Posted July 15, 2016 Don't use delays in the span of minutes please - it can cause major overall system delays. Dang, missed that. I may be a little rusty. Sent from my iPhone using Tapatalk Quote Link to comment Share on other sites More sharing options...
eddy.trochez Posted July 15, 2016 Share Posted July 15, 2016 Also, and this is a personal preference. I'd change the time to "when time is night time". This way it works with the sunset. Here in NYC, it gets dark at 4:30 pm in the winter. You want that light to work when it's dark out. Delete 1 second delay and stop command. msgreenf 1 Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted July 15, 2016 Share Posted July 15, 2016 Why are delays bad while timers are good? Is this a bug in how the OS works? Quote Link to comment Share on other sites More sharing options...
Cyknight Posted July 15, 2016 Share Posted July 15, 2016 LONG delays aren't good - because they are DELAYS. See delay as a 'stop what you're doing and wait there five minutes until I say go' command. Where a timers is 'stop what you're doing and come back in 5 minutes' command Using 5 minute delay will hold up the system for 5 minutes, whereas a timer does not. Frankly personally for anything more than a second - I use a timer, but especially if you're looking at minutes. msgreenf 1 Quote Link to comment Share on other sites More sharing options...
RyanE Posted July 16, 2016 Share Posted July 16, 2016 Composer Programming Delays are not implemented poorly. They do not cause Director to stop doing what it's doing for X seconds, and shouldn't cause any system latency. From what I've seen, they are implemented internally very similar to timers. The main reason you might want to use timers instead of delays is that they're more flexible. When you use a delay in a script, it will delay running the rest of the script, and if that script gets triggered multiple times, delays can cause things to work differently than you might expect, where if you'd used a timer, it's more straightforward (i.e. the 'rest of the story' would only get executed once, when the timer expires). RyanE South Africa C4 user and eddy.trochez 2 Quote Link to comment Share on other sites More sharing options...
RyanE Posted July 16, 2016 Share Posted July 16, 2016 Now, if you were writing a DriverWorks driver, and you inserted delays (busy waiting by looping, etc.) in a *driver*, that's a completely different story, which *would definitely* cause system latency. Drivers must be event driven, and return control to Director fairly quickly. RyanE Quote Link to comment Share on other sites More sharing options...
Cyknight Posted July 16, 2016 Share Posted July 16, 2016 17 minutes ago, RyanE said: Composer Programming Delays are not implemented poorly.. The main reason you might want to use timers instead of delays is that they're more flexible. When you use a delay in a script, it will delay running the rest of the script, and if that script gets triggered multiple times, delays can cause things to work differently than you might expect, where if you'd used a timer, it's more straightforward (i.e. the 'rest of the story' would only get executed once, when the timer expires). RyanE First off - I wasn't suggesting they were implemented poorly. Second - my example was heavily simplified. Third - yeah, the idea of what I intended to say is indeed that it 'holds' the individual script 'hostage' - not the system as a whole. Fourth - while delays do not cause a true 'lag' on a system overall, it's not that hard to create conflicts where delays build creating a perceived delay or other weird behavior (where in actuality it's just following script). Triggering (and re-triggering) a timer won't cause this. Example: WHEN door bell is pressed turn light on delay 1 second play announcement delay 5 minutes turn light off Now have someone push that doorbell 15 times in a row. (Durn kids) Now add a schedule to have the light on at an hour before dusk Add some motion events to that same lights. Now imagine that doorbell being pressed a few minutes before the scheduled time, and the kids playing in the front yard. I think you can see where you'll get a lot of odd behavior of the light turning on and off. South Africa C4 user 1 Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted July 16, 2016 Share Posted July 16, 2016 Thanks guys. Got it! Quote Link to comment Share on other sites More sharing options...
vvtech Posted May 15, 2019 Author Share Posted May 15, 2019 On 7/15/2016 at 12:17 AM, Cyknight said: Don't use delays in the span of minutes please - it can cause major overall system delays. Instead, create a 5 minute timer, and start the timer instead - then on the timer expiring, turn the light back off. Other than that, yes, anything dependent on the if statement needs to be 'indented'. Are you able to provide an example screenshot of how I can create a timer. thank you! Quote Link to comment Share on other sites More sharing options...
vvtech Posted May 15, 2019 Author Share Posted May 15, 2019 Can someone provide an example screenshot of how to create a timer. Thanks. Quote Link to comment Share on other sites More sharing options...
dcovach Posted May 16, 2019 Share Posted May 16, 2019 6 hours ago, vvtech said: Can someone provide an example screenshot of how to create a timer. Thanks. The timer is an Agent. "Timer Agent". Create one there and set the duration. It can be used for all sorts of reasons. Typically you start the timer when an event happens. When the timer expires, program the desired action. There's other events that can be programmed off of. What's the application? Quote Link to comment Share on other sites More sharing options...
vvtech Posted May 16, 2019 Author Share Posted May 16, 2019 Thanks dcovach. I figured it out. I just didn't have the timer agent added in my project. Once I added then I was able to figure it out. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.