Resource icon

OBS Lua Countdown.lua 1.2

Tormy

Member
Tormy submitted a new resource:

Countdown.lua - countdown

I modified the script that comes with the version of OBS Studio released in Jan 2018, adding the field "Start Text", that writes something before the figures of the countdown.
View attachment 33894

The result is a thing like this one:


The lines I added, into the script, are commented "-- TORMY" so that if there is any further improvement you can do, you know where are the modifications I made.

To...
Read more about this resource...
 

Tormy

Member
Tormy updated Countdown.lua with a new update entry:

Update following a request and created an icon

This is a Countdown of the update I posted in Jan/Feb 2018, improved by
DearKed and it keeps all his introduced features.
Moreover I updated now this script, based on the request made by
DaTingGoSkrrrrra
Now when the count is less than "1:00", seconds are shown as "0:xx" instead of "xx". Thus from "00:59" (less than 60 seconds) the time is shown as "00:59" and not more just "59"
Read the rest of this update entry...
 

EmbodyWisdomToday

New Member
I've made a new version that adds a field for seconds, as my primary need to show viewers of a movement class how long until the instruction changes. There are 20 movement/position changes over a half hour class. How do I upload that here for review by the community?
 

EmbodyWisdomToday

New Member
How do I go about coding a major modification to have additional countdown clocks, each being assigned to a different text source, each having its own starting time value, yet each following the same logic of counting down when its scene is active? I'm thinking a +plus button under the current fields to add new. There'd be a new list of clocks, clicking any would populate the fields with its values and enable editing or deleting. Perhaps the button group like Sources makes sense: add, remove and configure. I can work-around this for now by pausing the recording, setting new time values, changing the text source its assigned to and restarting the playback. Just thinking about how to reduce the manual process and eliminate chances to mess up the recording. Thank you. Cheers.
 

jw13

New Member
How do I go about coding a major modification to have additional countdown clocks, each being assigned to a different text source, each having its own starting time value, yet each following the same logic of counting down when its scene is active? I'm thinking a +plus button under the current fields to add new. There'd be a new list of clocks, clicking any would populate the fields with its values and enable editing or deleting. Perhaps the button group like Sources makes sense: add, remove and configure. I can work-around this for now by pausing the recording, setting new time values, changing the text source its assigned to and restarting the playback. Just thinking about how to reduce the manual process and eliminate chances to mess up the recording. Thank you. Cheers.
This is a large change you're proposing. To achieve the same results with less effort. I would recommend making 5 copies of the script with different names, and just add the 5 different scripts to set 5 different timers. (replace 5 with however many you need)
 

EmbodyWisdomToday

New Member
Hi jw13, that's the idea I came up with too, and that's been working okay. I need a good 45 timers for the 30-minute project which loads slow initially, but seems to be working fine. I'm up to scene 8. For what it's worth, I had been making different scripts with the default value of the timer needed for that scene, but realized I can use the same script copy and pasted and set the actual value in the project rather than source of the script. Thanks for replying. Cheers.
 

EmbodyWisdomToday

New Member
The dropdown of sources to pick which text field is the timer is cluttered. I'd like to either
1) sort the list of all sources generated by obs.obs_enum_sources() by name
2) only show sources whose name starts with "timer"
3) use the filename of the script to only show sources of a specific scene

I'm happy with any of these solutions. I've been successful at naddaone.

I found this:
local name = obs.obs_source_get_name(source) [[[ OK ]]]
if astrcmpi_n(name, "timer", 5) > 0 then [[[ - fails - ]]]
obs.obs_property_list_add_string(p, name, name) [[[ OK ]]]
end

[[ Error reads ]]
Failed to call script_properties for obs_lua_script_get_properties: attempt to call field 'astrcmpi_n' (a nil value)

I grabbed that function from here:

Not sure if I need to include
#include <util/dstr.h>
or how to do so if so.

Hoping some code wizard can illuminate. Cheers.
 
Top