Skip to main content
Participating Frequently
September 20, 2023
Answered

Setting a delay on an expression for a countdown

  • September 20, 2023
  • 1 reply
  • 841 views

Hello, I am a newbie when it comes to expression.  I have a piece of code I got from a YouTube video that looks like this:

 

st = 300;
t = st - time;
if (t>599.999) {
c = timeToTimecode(t);
c = c.substring(3,8);
} else
if (t>1) {
c = timeToTimecode(t);
c = c.substring(4,8)
} else {
t = 0
c = timeToTimecode(t);
c = c.substring(4,8);
}

 

But what I want to add is a way to add a delay to the start of the countdown, just like what this guy did with his video.  Electric - 5 Minute Countdown 

 

Also yes, I am using the same effect he is, he made a tutorial video on it, but the video does not include on how to delay the start of the coutndown while keeping the electric animation animating.  How would I do that?

 

If you need to, here's his Tutorial Video 

 

Thank you in advaice for your help.

This topic has been closed for replies.
Correct answer Dan Ebberts

I'm not sure if this is what you're asking for, but this example would delay the countdown for 3 seconds:

delay = 3;
st = 300;
t = time > delay ? st - (time-delay) : st;
if (t>599.999) {
c = timeToTimecode(t);
c = c.substring(3,8);
} else
if (t>1) {
c = timeToTimecode(t);
c = c.substring(4,8)
} else {
t = 0
c = timeToTimecode(t);
c = c.substring(4,8);
}

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
September 20, 2023

I'm not sure if this is what you're asking for, but this example would delay the countdown for 3 seconds:

delay = 3;
st = 300;
t = time > delay ? st - (time-delay) : st;
if (t>599.999) {
c = timeToTimecode(t);
c = c.substring(3,8);
} else
if (t>1) {
c = timeToTimecode(t);
c = c.substring(4,8)
} else {
t = 0
c = timeToTimecode(t);
c = c.substring(4,8);
}
Participating Frequently
September 20, 2023

That is EXACTLY what I am looking for, thank you so much! However, I am having one small issue.  At the end of the video, the timer disappears at the 2 second mark, bsically the video goes black.  So what do I need to fix in the code to prevent that from happening and also, I would like to add to the code where the timer just sits at 0:00 all the way to the end of the comp because I am going to add 5 seconds to the end of it because I am using this timer for my streams and have a stinger transition when the countdown is finished.  

 

I have attached the file to this replay so you may take a look at it yourself, I am currently working with the blue comp version. Once I have everything I need, I am going to copy it over to the other colors and take it from there with Premiere Pro.  

Dan Ebberts
Community Expert
Community Expert
September 21, 2023

Got it, but the countdown is disappearing after the 0:02 mark in the comp.  Do I need to re do the comp to make it work?  


I'm not sure, but the comp I'm looking at is only 5 minutes long, which is not long enough for a 5-minute countdown with a 3-second delay.