OBS Lua Countdown.lua [Deleted]

Status
Not open for further replies.

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:
upload_2018-2-1_17-27-5-png.33886


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.
 

jmalmsten

New Member
I too must be of the stupid end of the spectrum. I downloaded the script. I put it in the default script folder. I opened the scripts dialog. I clicked the plus, chose the lua-script. I selected it in the list of loaded scripts... now what?


I can make duration higher and lower... I can edit start and final texts... But the Text Source bit seems to be unable to do anything. The dropdown won't activate to show my text sources and if I type stuff in it it does nothing. I even tried manually putting in the path of the text file I want it to modify... nothing. I try hitting close and making the text source invisible and visible. nothing.

1614785578757.png
 

jmalmsten

New Member
Oh, and the script log is empty as well... am I missing something crucial? Something that makes scripts run?

It's a windows 10 64 bit machine and the OBS version is 26.1.1
 
Status
Not open for further replies.
Top