Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Bairespm

Member
Hola @Warmuptill por favor ayúdenme, lo siento por mi inglés

si la escena es A entonces tecla de acceso directo Alt+e, esto funciona pero la misma tecla de acceso directo sigue siendo presionada y esto me causa problemas, ¿cómo puedo hacer que cuando voy a una escena A o B o C la tecla de acceso directo Alt+e es se activa solo una vez y cuando sale de esas escenas a cualquier otra, la misma tecla de acceso rápido Alt + e se activa nuevamente una vez. Yo lo uso como interruptor con otro programa en windows que si esta en una de esas escenas se activa y cuando sale de esas escenas hay que desactivarlo. La única forma en que el programa me acepta es presionando la misma tecla de acceso rápido nuevamente. Como lo hago, gracias, su programa es increible.
And How since the advance scene switcher knows that this hotkey was previously pressed
 

Bairespm

Member
@Warmuptill
macro.JPG
 

AaronD

Active Member
is there a way for this plugin to run an advertisement or possibly type in chat so an ad is ran?
If you make the ad into its own scene or source, yes. No different from anything else at that point.

Typing in chat might require a third party app or script, that is triggered using the Run action in a macro. That takes a single command line, that is passed to your operating system as if you typed it in a terminal, except that it necessarily inherits its environment from OBS, which is a little bit different than if you used the terminal to do it. Absolute paths, or some trickery in a script that is called directly and then does the thing you want, are needed to break out of that...but some things work just fine regardless of their environment, so you may not have to break out. Try it and see.
 

Warmuptill

Active Member
Hi @Warmuptill please helpme sorry for my english

if scene is A then hotkey Alt+e , this works but the same hotkey continues to be pressed and this causes me problems, how can I make it so that when I go to a scene A or B or C the Hotkey Alt+e is activated only once once and when you exit those scenes to any other the same hotkey Alt+e is activated again once. I use it as a switch with another program in windows that if it is in one of those scenes it is activated and when it exits those scenes it must be deactivated. The only way that program accepts me is by pressing the same hotkey again. How do I do it, thank you, your program is incredible.
You will need two separate macros:
  • One for the case when you enter the scene
    Enter.PNG
  • One for the case when you leave the scene
    Leave.PNG
The important thing to avoid the hotkey being pressed continuously is to check the "Perform actions only on condition change" checkbox at the top of the macro tab. (As also mentioned by @CodeYan )

Once.PNG


Note that only pressing the key for 1 ms, as it was configured in your screenshot, might be too short for some applications to notice.

Let me know if you have any questions!
 
Last edited:

Bairespm

Member
Necesitará dos macros separadas:
Lo importante para evitar que la tecla de acceso rápido se presione continuamente es marcar la casilla de verificación "Realizar acciones solo en cambio de condición" en la parte superior de la pestaña de macro. (Como también lo mencionó [USUARIO=242958]@CodeYan[/USUARIO])

[ADJUNTAR=completo]88497[/ADJUNTAR]

Tenga en cuenta que solo presionar la tecla durante 1 ms, como se configuró en su captura de pantalla, puede ser demasiado corto para que algunas aplicaciones lo noten.

¡Hazme saber si tienes alguna pregunta!
la macro para salir me muestra lo mismo exactamente igual que para entrar esta bien?

una pregunta más.
si en lugar de ser una sola escena hay varias

ejemplo
Quiero presionar ALT+A solo una vez
si la escena 1 está activa
o si la escena 2 está activa
o si la escena 3 está activa

lo mismo si salgo de las escenas que se presiona una vez si salgo de alguna de esas escenas

para agregar mas detalle..

Si la escena 1 está activa y vas a la escena 2 o a la escena 3, no vuelves a presionar ALT+A

De la misma forma, si la escena 2 está activa y vas a la escena 1 oa la escena 3, no vuelves a presionar ALT+A.

Solo si salgo de alguno de ellos es presionando ALT+A nuevamente

Muchas gracias por su tiempo en ayudarme a ambos. @Warmuptill and @CodeYan
 

KiraRedpaw

New Member
This will sound dumb, but make sure you set it to Stream Switcher to active in the general tab. I finally updated mine to be compatible with OBS 28 and forgot this had to be switched to on for anything to work.
Well that fixed one issue kinda but now my issue is the macro runs instantly if I hit the stop button on the music file. Because when obs starts up it starts playing the file whenever that scene is selected and if I'm not ready to hit stream starting then I have to pause/stop the music and this makes it instantly run the macro. Now how do I fix this issue?

Also if I switch to say the credits screen it instantly goes back to the gaming screen and then sometimes it will switch back then to the stream end screen. It's all $_(#&) up

I don't understand what is going on, why does it seem so broken.

I should have just stuck with obs 27 and the advanced scene switched that went with it. Never had an issue.
 

Warmuptill

Active Member
la macro para salir me muestra lo mismo exactamente igual que para entrar esta bien?
Sorry I attached the same image twice by accident.
I have updated my previous comment.

And is there any way to validate if the ALT+A hotkey was previously pressed before pressing it again
I would suggest to either enable the some visual guides to help you understand when which action is executed or use a different action type for testing purposes. (e.g. mute Desktop Audio / append to a file / ...)

una pregunta más.
si en lugar de ser una sola escena hay varias

ejemplo
Quiero presionar ALT+A solo una vez
si la escena 1 está activa
o si la escena 2 está activa
o si la escena 3 está activa

lo mismo si salgo de las escenas que se presiona una vez si salgo de alguna de esas escenas

para agregar mas detalle..

Si la escena 1 está activa y vas a la escena 2 o a la escena 3, no vuelves a presionar ALT+A

De la misma forma, si la escena 2 está activa y vas a la escena 1 oa la escena 3, no vuelves a presionar ALT+A.

Solo si salgo de alguno de ellos es presionando ALT+A nuevamente
I would suggest the following setup if I understood your requirements correctly:

  1. A macro that is used to check if the current scene is either scene 1, scene 2, or scene 3.
    This macro will only be used as a reference in other macros and thus will not need any actions.
    Current.PNG
  2. A macro handling the case when entering either of the three scenes.
    There we can reuse the previously created macro.
    Enter.PNG
  3. A macro handling the case when leaving either of the three scenes.
    It must also be made sure that when leaving either of the three scenes the now active scene is not once again scene 1, scene 2, or scene 3.
    So we can reuse the previously created macro once again.
    Leave.PNG
I hope I understood your requests correctly.
Let me know if you have further questions! :)
 

Warmuptill

Active Member
Well that fixed one issue kinda but now my issue is the macro runs instantly if I hit the stop button on the music file. Because when obs starts up it starts playing the file whenever that scene is selected and if I'm not ready to hit stream starting then I have to pause/stop the music and this makes it instantly run the macro. Now how do I fix this issue?

Also if I switch to say the credits screen it instantly goes back to the gaming screen and then sometimes it will switch back then to the stream end screen. It's all $_(#&) up

I don't understand what is going on, why does it seem so broken.

I should have just stuck with obs 27 and the advanced scene switched that went with it. Never had an issue.
Depending on what type of media source you are using you have the option to not automatically start the playback if the source becomes active.

Media.PNG


But I believe the use of media conditions was only a suggestion made as an alternative to using the audio condition type.
If you preferred that setup I don't see what would not work on OBS 28 now that the plugin is started.

Alternatively if you give more details on the restrictions in which the plugin should act and in which not I could try to help you set up macros to handle those cases (if possible).

I apologize for not being able to provide you with concrete advice to solve your problem :(
 

mochacon99

New Member
Advanced Scene Switcher Macro Help
I used to be able to use the Transition tab to automatically switch back and forth from “Scene 1” and “Scene 2” every 30 seconds. No longer can do that with the update. Can’t figure out how to do that with the Macros. Please help?
 

Attachments

  • 0E109F3B-EDBF-45C9-BD1F-F221290296D1.jpeg
    0E109F3B-EDBF-45C9-BD1F-F221290296D1.jpeg
    699.3 KB · Views: 61
  • D9184526-F325-491E-8C44-9399F935BF76.jpeg
    D9184526-F325-491E-8C44-9399F935BF76.jpeg
    788.6 KB · Views: 21

Warmuptill

Active Member
Advanced Scene Switcher Macro Help
I used to be able to use the Transition tab to automatically switch back and forth from “Scene 1” and “Scene 2” every 30 seconds. No longer can do that with the update. Can’t figure out how to do that with the Macros. Please help?
I think you are referring to the old "Sequence" tab.
You can still use it if you like, but I won't add any features to it.

In case it is hidden you can show it again by unchecking this box on the General tab:
Hide


If you instead want to use macros have a look at this example:
 
In re: Websockets

Is there a good tutorial on how to communicate from one Advance Scene Switcher instance on one system to on another? I want to send a websocket request to another OBS instance on another computer to tell it to send a hotkey to an external app on the second computer.

Thanks!

--Katt. =^.^=
 

AaronD

Active Member
Well that fixed one issue kinda but now my issue is the macro runs instantly if I hit the stop button on the music file. Because when obs starts up it starts playing the file whenever that scene is selected and if I'm not ready to hit stream starting then I have to pause/stop the music and this makes it instantly run the macro. Now how do I fix this issue?
My first thought on that, is that you're trying to have too few scenes for what you're doing, so that the structure of each scene, and the rules to automate them, have to be too complicated to try and make the system do what you want.

It seems to work best to have a separate scene for every time you want to change something. You end up with a lot of similar scenes that way, but the rules become a lot simpler and almost just write themselves, with little need for debugging.

Also, if you really want it to be *completely* free-form, then you really should have a serious look at using external sources, instead of doing everything inside of one instance of OBS. For example, you might have an external app that does backgrounds(*), and bring that into OBS via screen or window capture, or via HDMI capture from a different computer altogether as if it were a camera. Likewise for audio: use an external mixer (physical or virtual) to produce a finished soundtrack for OBS to pass through unchanged. None of that is *absolutely* required to produce a "good" stream, but distributing the workload like that makes it a lot easier.



(*) If you like the way that OBS handles things, then you can still have this architecture of a separate producer and consumer, between two copies of OBS on the same machine. Just modify the shortcut to use the --multi flag, run it twice, and you get two independent copies. Set up one to feed a virtual camera, using one profile and scene collection, and the other to accept that virtual camera as a source, using a different profile and scene collection. All of that is automatable using OBS's command-line options, so you might just have two shortcuts with different options (both including --multi), or a single shortcut could run a script instead, that forks off both processes. (along with whatever other setup/cleanup you need to keep straight)

To see what options are available, open a terminal and run:
obs --help
 

Bairespm

Member
Sorry I attached the same image twice by accident.
I have updated my previous comment.


I would suggest to either enable the some visual guides to help you understand when which action is executed or use a different action type for testing purposes. (e.g. mute Desktop Audio / append to a file / ...)


I would suggest the following setup if I understood your requirements correctly:

  1. A macro that is used to check if the current scene is either scene 1, scene 2, or scene 3.
    This macro will only be used as a reference in other macros and thus will not need any actions.
    View attachment 88543
  2. A macro handling the case when entering either of the three scenes.
    There we can reuse the previously created macro.
    View attachment 88544
  3. A macro handling the case when leaving either of the three scenes.
    It must also be made sure that when leaving either of the three scenes the now active scene is not once again scene 1, scene 2, or scene 3.
    So we can reuse the previously created macro once again.
    View attachment 88545
I hope I understood your requests correctly.
Let me know if you have further questions! :)
excellent, thankssssssssss It works perfect
 

Warmuptill

Active Member
In re: Websockets

Is there a good tutorial on how to communicate from one Advance Scene Switcher instance on one system to on another? I want to send a websocket request to another OBS instance on another computer to tell it to send a hotkey to an external app on the second computer.

Thanks!

--Katt. =^.^=
You have to configure the obs-websocket settings on the remote computer you want to execute the hotkey press on under the tools menu.
WSSettings.png

Next add a macro on the machine you want to trigger the hotkey press on similar to the following.

Remote.PNG


Then on the computer that is supposed to trigger the hotkey press on the remote OBS instance add a macro with a Websocket action sending the message to the remote machine.
In this websocket action you will also have to add a new connection with the connection details of the remote OBS instance.

Local.PNG


Hope that helps!

For more details on the websocket action and condition have a look at this wiki entry:
 
Last edited:
You have to configure the obs-websocket settings on the remote computer you want to execute the hotkey press on under the tools menu.

(Removed for brevity's sake

Hope that helps!

For more details on the websocket action and condition have a look at this wiki entry:

Fixed one issue on the receiving side; the hotkey sequence was incorrectly formed. It now sends the correct keystroke sequence and the intended program catches it as it should.

Now, I'm trying to figure out how to send the message to start the BGM playback.

On the sending machine, I have this as the request to the Advanced Scene Switcher process on the receiving machine:


Code:
{

    "d": {

        "requestData": {

            "requestData": {

                "message": "BGM"

            },

            "requestType": "AdvancedSceneSwitcherMessage",

            "vendorName": "AdvancedSceneSwitcher"

        },

        "requestId": "1",

        "requestType": "CallVendorRequest"

    },

    "op": 6

}

On the receiving side, I have the following as the condition to look for:

Code:
BGM

I'm basing the request on the "testing" example in the wiki entry about Websockets.

The condition on the sending machine is being triggered correctly because I see that the Websocket message count indicator in OBS's Websocket dialog increment by 1. However, either I'm forming the request incorrectly, I'm incorrectly checking for the desired condition, but more than likely, it's a combination of both. It must be the fact that I don't write any software that talks Websockets (plus I'm not a dev in general, actually) and likely a fundamental lack of understanding of how it works.

Any suggestions?

Thanks.

--Kat. =^.^=
 

Warmuptill

Active Member
Fixed one issue on the receiving side; the hotkey sequence was incorrectly formed. It now sends the correct keystroke sequence and the intended program catches it as it should.

Now, I'm trying to figure out how to send the message to start the BGM playback.

On the sending machine, I have this as the request to the Advanced Scene Switcher process on the receiving machine:


Code:
{

    "d": {

        "requestData": {

            "requestData": {

                "message": "BGM"

            },

            "requestType": "AdvancedSceneSwitcherMessage",

            "vendorName": "AdvancedSceneSwitcher"

        },

        "requestId": "1",

        "requestType": "CallVendorRequest"

    },

    "op": 6

}

On the receiving side, I have the following as the condition to look for:

Code:
BGM

I'm basing the request on the "testing" example in the wiki entry about Websockets.

The condition on the sending machine is being triggered correctly because I see that the Websocket message count indicator in OBS's Websocket dialog increment by 1. However, either I'm forming the request incorrectly, I'm incorrectly checking for the desired condition, but more than likely, it's a combination of both. It must be the fact that I don't write any software that talks Websockets (plus I'm not a dev in general, actually) and likely a fundamental lack of understanding of how it works.

Any suggestions?

Thanks.

--Kat. =^.^=
Just to clarify:
Are you using the advanced scene switcher to send the message on one machine and also the advanced scene switcher to receive the messages on the other machine?


If so you can just use the exact same message in the action on one machine and in the condition on the other machine.
You will not have to manually form the json string containing the vendor request this will be done by the plugin automatically.


If you are instead using an external tool to send this message via the "AdvancedSceneSwitcherMessage" vendor request can you give more details on what you have set up exactly?
Did you authenticate first before attempting to send out the request?
 
Just to clarify:
Are you using the advanced scene switcher to send the message on one machine and also the advanced scene switcher to receive the messages on the other machine?


If so you can just use the exact same message in the action on one machine and in the condition on the other machine.
You will not have to manually form the json string containing the vendor request this will be done by the plugin automatically.


If you are instead using an external tool to send this message via the "AdvancedSceneSwitcherMessage" vendor request can you give more details on what you have set up exactly?
Did you authenticate first before attempting to send out the request?

It's the former at present. I'm such a total noob at JSON (I'm more a sysadmin/netadmin here). I'll have to mess with that and get back with you on that.

Thanks!

--Katt. =^.^=
 
Top