Resource icon

Advanced Scene Switcher 1.26.2

Bairespm

Member
hi @Warmuptill , I'm trying to create a countdown with adv ss and the variables but I haven't been able to. Is there a way to do it? I want to create a countdown to display in a source and when I'm done, change the scene. can it be done?

With a countdown that I found on github, I managed to create a button in adv ss that allows me to create it with a popup.. What I can't do is change the scene when the countdown ends.



https://github.com/AstroCorp/OBS-Countdown
1690039364024.png


The next thing I try is to create another macro where it evaluates If the Countdown Variable is equal to 0, change the scene.
but it doesn't work because the value of the variable it saves (for example: 10 sec.) is the one that is entered in the popup.
how could i achieve it? any ideas?
1690040226716.png

1690039809302.png
 
Last edited:

Warmuptill

Active Member
With a countdown that I found on github, I managed to create a button in adv ss that allows me to create it with a popup.. What I can't do is change the scene when the countdown ends.



https://github.com/AstroCorp/OBS-Countdown
View attachment 96082

The next thing I try is to create another macro where it evaluates If the Countdown Variable is equal to 0, change the scene.
but it doesn't work because the value of the variable it saves (for example: 10 sec.) is the one that is entered in the popup.
how could i achieve it? any ideas?
View attachment 96085
View attachment 96083
Unfortunately, I don't think you can access the current state of JS code running inside of an OBS browser source.
Maybe you can tweak the script to do the scene switching? (I don't have experience how to do that in JS)

To switch the scene once the timer in the Browser source runs out you will have to start a separate timer in the advanced scene switcher plugin at the same time as starting the countdown in the browser source and hope that they sync up.
You can achieve this using the "Timer" action and condition (which also supports the use of variables).

TimerAction.PNG

Countdown.PNG


Hope that helps!
Alternatively one of the existing countdown scripts / plugins might already do what you are looking for.
 
Last edited:

Warmuptill

Active Member
hi @Warmuptill
He tried a thousand ways but couldn't get it to work correctly, just like that. And it is because it is necessary to add the condition in MACRO if it is active or deactivated
I show in the attached image.

I tried it with the counter, it works but it only allows me to perform one action... example, if it is greater than 1, it activates macro 1 and deactivates macro 2, but I can't do it with more than two macros.
Could it be added as an option there?

View attachment 96017

I have also noticed that it is very difficult to know which macro I am referring to when I choose it by number. Is it possible there to throw me the menu of which options I have created instead of numbers? that would help a lot

View attachment 96018

Thank you in advance for your effort and your time... I tell you that 90% of the time I only use adv ss in obs jaja I've already removed most of the plugins because I'm being able to do everything with an adv ss, and honestly this would help me a lot to reduce the macros.. I have about 15 groups with more than 10 macros per group... it's a lot to make it work fast.. so this, as I was saying, helps me reduce the macros and not do so many adv ss processes . thank you thank you thank you
A build with the requested functionality should be available here in a few minutes:
ActionCondition.PNG
 

Warmuptill

Active Member
For "scene item visibility" action, can you please allow selecting a scene item by index (and as a variable), not by name? I have a scene containing all my videos, and I intend to play them sequentially (not necessarily one after the other, and may entail moving to other scenes). I want to be able to first show the first scene item. Once it finishes, I want to be able to show the second scene item and hiding the first scene item. While I haven't fiddled with variables that much yet, I think incrementing the index should be easy. Thanks!
A build with the requested functionality (and a bit more) is available here:

SceneItemSelection.png

Wasn't quite sure how to best enable the user to select the different options so I resorted to yet another dialog.
If someone has better suggestions I am all ears :D

Couldn't to much testing yet so certainly make sure to back up your settings before trying this.

(Sorry that I took forever to get around to this topic)
 

Bairespm

Member
A build with the requested functionality should be available here in a few minutes:
View attachment 96092
Thank you very much @Warmuptill , it works but for some unknown reason, when I do the following

if Macro zoom has action 1 activated

disable macro action 1

enable macro action 2

disable macro action 3

or another combination

wants to do it all at once and doesn't get the desired results.. incorrectly enables another macro action.

Is there a way to set priorities?

I wanted to do it with the wait button. but since I use it with a hotkey, that wait doesn't work for me. it should work right away. I'm missing something along the way.
 

Warmuptill

Active Member
Thank you very much @Warmuptill , it works but for some unknown reason, when I do the following

if Macro zoom has action 1 activated

disable macro action 1

enable macro action 2

disable macro action 3

or another combination

wants to do it all at once and doesn't get the desired results.. incorrectly enables another macro action.

Is there a way to set priorities?

I wanted to do it with the wait button. but since I use it with a hotkey, that wait doesn't work for me. it should work right away. I'm missing something along the way.
Sorry, I am not sure I fully understand what the problem is.
Disabling actions for a given macro works as expected even when multiple actions are specified.
Can you elaborate a bit more what the exact issue is / share screenshots / export the settings that are causing the problem to a file and share it with me?
 

Bairespm

Member
Sorry, I am not sure I fully understand what the problem is.
Disabling actions for a given macro works as expected even when multiple actions are specified.
Can you elaborate a bit more what the exact issue is / share screenshots / export the settings that are causing the problem to a file and share it with me?
Ok
1690230413277.png

1690230482501.png

1690230308093.png

1690230338213.png

1690230356513.png

1690230372488.png





with this configuration. MACRO ZOOM does not work correctly, sometimes when using the hotkey you should activate sequentially ORIGINAL then ZOOM 1 then ZOOM 2 . but it doesn't... when i use the hotkey sometimes it activates ZOOM 1 and then ORIGINAL and then ZOOM 2.
I share the txt configuration so you can represent it.
 

Attachments

  • adv-ss-Sin Título-2023.07.24.17.23.29.txt
    9.4 KB · Views: 12

Bairespm

Member
Ok
View attachment 96130
View attachment 96131
View attachment 96126
View attachment 96127
View attachment 96128
View attachment 96129




with this configuration. MACRO ZOOM does not work correctly, sometimes when using the hotkey you should activate sequentially ORIGINAL then ZOOM 1 then ZOOM 2 . but it doesn't... when i use the hotkey sometimes it activates ZOOM 1 and then ORIGINAL and then ZOOM 2.
I share the txt configuration so you can represent it.
i use move transition in first image (move source)
 

BioFUSION

Member
Hey @Warmuptill I have had to setup a weird scenario to most to get around a flaw in another plugin.

Basically I have 3 scenes that play videos, but because of the flaw, I use one nested scene, and use adv-ss to change the playlist on the fly whenever the corresponding scene is active. IE:

Scene 1 active - change to scene 1 playlist
Scene 3 active - change to scene 3 playlist

This is causing an issue though, say scene 1 is active and scene 1 playlist is loaded. If I go to another scene like BRB, then come back to scene 1, it still does the check and re-inserts playlist 1 (effectively restarting the scene/playlist).

Im trying to figure out how to do the above, but first check if the correct playlist is already loaded, if so do not re-insert it or all stop I guess. I have tried a few scenarios and I think I have it half working(it used to insert/restart a few secs into a video playing already) still restarts the playlist constantly but I think I have the wrong stuff in one of these macros, but this is where I got from some help from the obs discord.

Thanks for any help.
 

Attachments

  • Screenshot 2023-07-25 150106.png
    Screenshot 2023-07-25 150106.png
    39.3 KB · Views: 12
  • Screenshot 2023-07-25 145701.png
    Screenshot 2023-07-25 145701.png
    46.9 KB · Views: 14

Warmuptill

Active Member
Ok
View attachment 96130
View attachment 96131
View attachment 96126
View attachment 96127
View attachment 96128
View attachment 96129




with this configuration. MACRO ZOOM does not work correctly, sometimes when using the hotkey you should activate sequentially ORIGINAL then ZOOM 1 then ZOOM 2 . but it doesn't... when i use the hotkey sometimes it activates ZOOM 1 and then ORIGINAL and then ZOOM 2.
I share the txt configuration so you can represent it.
I think you have not set up what you are trying to do.
The macros "Macro 1", "Macro 2", and "Macro 3" will continuously trigger each other to run as fast as they can:

Let's assume you start with only the first action of the "MACRO ZOOM" action being enabled and the rest being disabled.
I that case the condition of "Macro 1" is true and its actions are executed, which then disable all actions of "MACRO ZOOM" except for the second one.
This then results in the condition of "Macro 2" being true and its actions being executed, which will disable all actions of "MACRO ZOOM" except the third one.
Now the condition of "Macro 3" is true and its actions are executed, which results in only the first action of "MACRO ZOOM" being enabled.
Now the "Macro 1" condition is true again and the whole process starts from the beginning.

So when you press your hotkey you pretty much have a random chance which action is being executed.

What you probably want is for the actions of "Macro 1", "Macro 2", and "Macro 3" to be only executed when you press the hotkey to trigger the zoom.
There are multiple ways of achieving this.
The simplest way is probably to add additional "Hotkey" conditions to "Macro 1", "Macro 2", and "Macro 3" similar to this:

Zoom.PNG


Hope that helps / clears things up!

I will adjust the UI to make it more clear when something like above happens.
(At the moment the action enable / disable toggle switch position is not updated if a macro changes the state)
Update: A build will be available here in a few minutes:
 
Last edited:

Warmuptill

Active Member
Basically I have 3 scenes that play videos, but because of the flaw, I use one nested scene, and use adv-ss to change the playlist on the fly whenever the corresponding scene is active
Just to clarify what type of source are you using, for which you are modifying the playlist settings? (VLC source I assume?)
If so, can you check that your issues are not caused by the VLC source settings? (E.g. through the "restart when visible" setting)

Im trying to figure out how to do the above, but first check if the correct playlist is already loaded, if so do not re-insert it or all stop I guess.
I would guess that the first screenshot does exactly what you are trying to do.
It checks if the settings are applied already using the "settings match" option and if not it apply them.

still restarts the playlist constantly but I think I have the wrong stuff in one of these macros, but this is where I got from some help from the obs discord.
Are you sure that the settings you are checking for and you are applying are really identical?
Maybe pause the advanced scene switcher, apply the settings you need, then press "Get current settings" for both the "Source" condition in the "And not" block and also for the "Source" action that is applying the settings to the VLC source.

If that should not help you could try to export your advanced scene switcher settings to a file and share it with me so I can try to look at your settings on my end.
 
Last edited:

Bairespm

Member
I think you have not set up what you are trying to do.
The macros "Macro 1", "Macro 2", and "Macro 3" will continuously trigger each other to run as fast as they can:

Let's assume you start with only the first action of the "MACRO ZOOM" action being enabled and the rest being disabled.
I that case the condition of "Macro 1" is true and its actions are executed, which then disable all actions of "MACRO ZOOM" except for the second one.
This then results in the condition of "Macro 2" being true and its actions being executed, which will disable all actions of "MACRO ZOOM" except the third one.
Now the condition of "Macro 3" is true and its actions are executed, which results in only the first action of "MACRO ZOOM" being enabled.
Now the "Macro 1" condition is true again and the whole process starts from the beginning.

So when you press your hotkey you pretty much have a random chance which action is being executed.

What you probably want is for the actions of "Macro 1", "Macro 2", and "Macro 3" to be only executed when you press the hotkey to trigger the zoom.
There are multiple ways of achieving this.
The simplest way is probably to add additional "Hotkey" conditions to "Macro 1", "Macro 2", and "Macro 3" similar to this:

View attachment 96155

Hope that helps / clears things up!

I will adjust the UI to make it more clear when something like above happens.
(At the moment the action enable / disable toggle switch position is not updated if a macro changes the state)
Update: A build will be available here in a few minutes:
wwwooooowwww it's amazing .. I was just missing that in the main macro jaja .. I was breaking my head I couldn't do it and it was simple. The new compilation is excellent. Now I can check the actions in real time. Before, I had to exit the macro and re-enter to check if it activated or deactivated... Thank you thank you thank you thank you. i love adv ss.
 

AaronD

Active Member
This is causing an issue though, say scene 1 is active and scene 1 playlist is loaded. If I go to another scene like BRB, then come back to scene 1, it still does the check and re-inserts playlist 1 (effectively restarting the scene/playlist).
Your screenshots seem to say something different, but for this part right here, you might use a variable (I called it Just_Did in this example):
  • Macro A
    • Conditions
      • <Normal Conditions for A>
      • AND NOT Just_Did == A
    • Actions
      • Just_Did = A
      • <Normal Actions for A>
  • Macro B
    • Conditions
      • <Normal Conditions for B>
      • AND NOT Just_Did == B
    • Actions
      • Just_Did = B
      • <Normal Actions for B>
  • Etc.
The BRB scene leaves the variable unchanged.
 

Warmuptill

Active Member
Asking all the gurus out there, does anyone know how I can trigger a macro only when a text source changes its value?
You will have to use a variable for this.

First assign the current settings of the text source to a variable using a macro similar to this:
GetSettings.PNG


Next check if the variable changed:
CheckForChange.PNG


Hope that helps!
 

Warmuptill

Active Member
That was exactly what I needed :)

Next question is: Does anyone know how I can set a text source value to a variable?
Not sure if I understand the question correctly so let me give two answers just in case:

If you asking how you can assign the current text that is being displayed by a text source you can do something like this:

Capture.PNG


Explanation:
The first action grabs the settings of the source.
The second one reduces the settings string to just the text":"..." field.
The third action removes the text": prefix.
The last one removes the ".

(There might be more fancy ways of doing this using regular expressions)

If you were looking for an explanation how to display the value of a variable in a text source you can so something like this (assuming the variable is named "Text"):

Capture2.PNG
 

BioFUSION

Member
Just to clarify what type of source are you using, for which you are modifying the playlist settings? (VLC source I assume?)
If so, can you check that your issues are not caused by the VLC source settings? (E.g. through the "restart when visible" setting)


I would guess that the first screenshot does exactly what you are trying to do.
It checks if the settings are applied already using the "settings match" option and if not it apply them.


Are you sure that the settings you are checking for and you are applying are really identical?
Maybe pause the advanced scene switcher, apply the settings you need, then press "Get current settings" for both the "Source" condition in the "And not" block and also for the "Source" action that is applying the settings to the VLC source.

If that should not help you could try to export your advanced scene switcher settings to a file and share it with me so I can try to look at your settings on my end.
thanks for the reply, sorry I hadnt, been sick the last few days... but yeah I played around with it and figured it out, but didnt like it, it
always started on the same video the verified way... So ended up going back to what i had.
 

BioFUSION

Member
Your screenshots seem to say something different, but for this part right here, you might use a variable (I called it Just_Did in this example):
  • Macro A
    • Conditions
      • <Normal Conditions for A>
      • AND NOT Just_Did == A
    • Actions
      • Just_Did = A
      • <Normal Actions for A>
  • Macro B
    • Conditions
      • <Normal Conditions for B>
      • AND NOT Just_Did == B
    • Actions
      • Just_Did = B
      • <Normal Actions for B>
  • Etc.
The BRB scene leaves the variable unchanged.
thanks, still kinda new to variables, but ill check it out, gotta tackle it eventually, why not now. ;)
 

biosmatrix

New Member
Thanks Warmuptill for this ever evolving plug-in....

TLDR; How can I make a macro wait for an image slide show to finish playing (not looped) and then move on to the next action?

Looking for advice on how to achieve something or maybe it requires an enhancement you could build into the plug-in in future? I'll try and explain as best I can:

I have setup through a macro a sequence of showing + hiding sources in a scene, so it's essentially cycling through showind and hiding some sources in the scene, pseudocode of the macro a bit like this:
Show source 1 (Image)
Wait 10 seconds
Hide Source 1
Show Source 2 (Image Slide Show)
Wait 30 seconds
Hide Source 2
Show Source 3 (Media File)
Wait 10 seconds

One of the sources (Let's say Source 2 in the above example) is an image slide show and the playlist of the slide show is a folder. The folder currently has 3 files in it and the slide show is set to display each image for 10 seconds, so 10 seconds per image - 30 seconds in total which is why I've set the source to be visible for 30 seconds BUT (and this is where I'm stuck) if the image file count for the slideshow changes, if I want each image to be shown for 10 seconds then I will have to manually change how long the source 2 is shown for (i.e. 4 images = waiting 40 seconds before hiding it).

What I would like to be able to do is have the amount of time the image slide show is shown for automated based on the image count in the folder / slide show playlist OR have it so the macro waits for the image slide show to finish once it starts playing and only then move on (hiding source 2 + showing source 3).

So far I've tried to approach it in different ways but not been successful:
- Thought about using variables some how but I would some how need to get a variable set to the count of files in the image slide show folder, then multiply this number by 10 and have that variable set for the 'Wait X seconds' in the macro after showing the image slide show source
- Tried making a macro which watches the state of the image slide show to be ended(playlist) and would then use this to advance to the next source (hiding source 2 + showing source 3) rather than waiting 30 seconds but this ended up always showing source 3 continously
- Thought about running a program / script which outputs the file count but not sure how to get this into advanced scene switcher as a variable or value to be used in the macro

Open to any ways you think I can do this? I think with one of the following features I'd be able to do it:
- Ability in the 'Wait' action to wait for a source property to be met (value equals or not equal to), also with a optional timeout value to stop it waiting indefinitely as a fall back). Also with this, the conditions to be able to 'Wait' before moving on to the next condition
- Ability to run a program and get it's output
- Ability to set a variables value from a (text) file

Thanks!
 
Top