Countdown Timer with optional next scene

Countdown Timer with optional next scene 012

EmbodyWisdomToday

New Member
EmbodyWisdomToday submitted a new resource:

Countdown Timer with optional next scene - When the timer reaches zero, either show text or change scenes

Combining features from the default countdown.lua and the end-media-change-scene countdown timer, this script either shows text or forwards to a scene chosen from the list of scenes. This script also has a seconds setting in addition to minutes.

Read more about this resource...
 

Lawrence_SoCal

Active Member
Can this handle multiple scenes (over a dozen)?
I'm using Adv Scene Switcher to change scenes after media (recorded video) ends [working with developer now on some bugs]. I'd love to have a countdown timer. But I need to program/configure over a dozen video endings with a scene change.
 

I3ordo

Member
This script has also less digits so my 5 minute counter does show unnecessary zeroes. eg: "4:30" instead of "00:04:30" and the next scene feature is quite welcome
 

EmbodyWisdomToday

New Member
Can this handle multiple scenes (over a dozen)?
I'm using Adv Scene Switcher to change scenes after media (recorded video) ends [working with developer now on some bugs]. I'd love to have a countdown timer. But I need to program/configure over a dozen video endings with a scene change.
The script lists all the scenes of the scene collection in a dropdown. Only one can be selected as next.

I copy and paste the script once for each scene that I want to forward to another scene when the timer is complete. (Very easy to add a batch of scripts into a scene collection.)

Each script allows for setting the minutes and seconds to count down, which text field to have the countdown in, and which scene is next. Scenes can form a linked list -- one to the next to the next -- which is why I adapted it. I create about 25 to 35 scenes that comprise a 30-minute Feldenkrais Method / Micro Yoga Zen lesson, where each scene describes what to do. The timer displays how long. The script auto-forwards at 0:00. I get the pleasure of clicking Record and then Stop Recording 30 minutes later.

Hopefully this description of what the script can do will help you decide if it's a fit for your objective.
If you know how the long your videos are, set the countdown timer to their length. This script sounds like it'd replace what you're using. This script is less intelligent in terms of looking at the state of any media. It only works off a pre-defined time. If you update the media to be shorter or longer, you'd need to adjust the timer's values also.
 

EmbodyWisdomToday

New Member
This script has also less digits so my 5 minute counter does show unnecessary zeroes. eg: "4:30" instead of "00:04:30" and the next scene feature is quite welcome
Hi l3ordo, glad you like it. If you ever need to update the output format, line 19 is where you do it:
Code:
    local text          = string.format("%01d:%02d", minutes, seconds)
d stands for digits. 01 means show one digit with an unused padded 0 to the left, whoops,
and 02 means show a 0 if the value is < 10. The : is literal. The % means fill with a variable mentioned later, in order of the %.

Hope that helps. It's good fun.
 

EmbodyWisdomToday

New Member
the next scene feature is quite welcome
I'm looking at how to have a Next Scene option that would be the next scene in the scene collection. The slightly tedious task of assigning the scene could then be eliminated. Once you find your own, goto the next in order...

Have you done anything like that? I found this but need to research how to know the current scene's name/id to compare:
Code:
if cur_seconds < 1 then
if next_scene = "-Next-" then // new value for automatically forwarding to next scene in collection
struct obs_frontend_source_list scenes;
obs_frontend_get_scenes(&scenes);
for (size_t i = 0; i < scenes.num; i++) {
        // making this up
        if current_scene.name = scenes[i].name then
               obs.obs_frontend_set_current_scene(scenes[i+1].name)
}
obs_frontend_source_list_free(&scenes);
 

rantanplan

New Member
Hey. Thanks a lot! Nice Timer. As I am not a script kid ... can you give me a hint, how to extend the script to show days? Unfortunately I need a 5 day countdown ... is it "just" the output in line 19? Or do I have to do more?
 

teekay1959

New Member
Hi EmbodyWisdomToday, thanks for creating this countdown timer. I'm especially interested in the "optional next scene" feature. Question for you. Does this countdown timer allow me to set countdown to a specific time? For example, to 7:30?
 

diefeuerlilie

New Member
Great script. The one I searched long time for. Thank you. But I have a little problem with my font. The last digit is a bit cut. The surrounding box has not enough space at the end with this font
timer.PNG
 

jpugarte1

New Member
Great script, thank you. I was wondering if it would be possible to add conditional branching. Something like "if current scene starts with [char], switch to scene_A; else, switcj to scene_B". I modified the script a little bit to change the properties and interface in the scripts window, but I'm not able to obtain the current scene name. Any ideas?
 

jocust10

New Member
It worked for a day and now - for the life of me - I cant get the countdown timer to come up. I tried everything. It looks to me like the script is just not running anymore... is there a script debugger so i can at least see where the script is bombing out? There is supposed to be a "script log" but there are no instructions on how to activate it. DOes anyone know how to activate the log so I can see if it is even executing the countdown timer with scene change option lua script?
 

Juliac

New Member
DOes anyone know how to activate the log so I can see if it is even executing the countdown timer with scene change option lua script?
Tools>Scripts opens a dialog box showing your loaded scripts. At the bottom right there is a button "Script Log" that opens it for me.
 

coconutrice

New Member
I've tried to use the script multiple times, but every time I get an error saying the following:
[CountdownDays.lua] Failed to call script_properties for obs_lua_script_get_properties: ...ata/obs-plugins/frontend-tools/scripts/CountdownDays.lua:121: attempt to call field 'obs_source_get_unversioned_id' (a nil value)

How can I fix this? Is this because I'm using a mac insteaad of a PC? Any help would be much appreicated!
 

coconutrice

New Member
I've tried to use the script multiple times, but every time I get an error saying the following:
[CountdownDays.lua] Failed to call script_properties for obs_lua_script_get_properties: ...ata/obs-plugins/frontend-tools/scripts/CountdownDays.lua:121: attempt to call field 'obs_source_get_unversioned_id' (a nil value)

How can I fix this? Is this because I'm using a mac insteaad of a PC? Any help would be much appreicated!
I have figured it out! Just needed to download the latest version of OBS (mine was a few years old).
 

r3dd3vil

Member
Hello m8, tnx for the great plugin! One question Is It possibile to start a countdown based on an exactly date? For example i want a countdown that finish exactly tomorrow @ 3pm, Is It possibile?
 

BobRossLives

New Member
When the countdown timer reaches zero, my scene changes with a stinger transition. However, the stinger plays twice - it starts at countdown of zero, plays again from the beginning about .25 seconds into the stinger, and ends abruptly. This doesn't happen when I manually select the scene - the stinger plays normally. Anyone else have this happening? I'm still on OBS 27.2.4 and not looking to go to 28.
 
Top