Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Warmuptill

Active Member
I have a very weird use case, but wondering if you can tweak the "matches pattern" slightly. Hoping it would 'check' to see if that file it is trying to match has been updated or not. If the file is different than originally used, update and try to match it.

Use case
I play a game, and I would like to detect when that player dies (it says "XYZ was slain" on the screen in the same spot), but I would manually set their name in a text file, that text file then populates an obs layer with that text.

What I would like to do is take a screenshot of that text layer (this works fine as ive tested it), and then have the matches pattern view that file. The problem is, when you set the macro up, it accepts that file and will never refresh, even if the source file changes.

or

If the pattern matching could match the text inside a .text file, been trying to test this but I can't get it to work.
A build with the requested functionality will be available here in a few minutes:
(Note that you have to be logged into GitHub to be able to download this build - let me know if that should be an issue)

The video condition check now also check the modification date of the given input file.
If it does not match the file modification date when last loading the data, the file will be read out again.

Please back up your settings before installing this build, just in case something goes wrong.
It contains a bunch of other changes, which were not yet released and thus are not fully tested.

If you should run into issues please do let me know about them! :)
 

KensonPlays

New Member
Can you share a screenshot of the macro(s) you have set up and are not working as expected?
I assume that it should look something like this from what you have described:
View attachment 106045

Do you have configured other macros which might interfere with this one?

Can you enable verbose logging and share a log file of the issue?
The option to enable verbose loggin can be found on the General tab at (1) in the screenshot below:
View attachment 106043

OBS log files can be found under the "Help" section:
View attachment 106044
Didn't get a push or email notification, sorry. Weird. I have it disabled completely since it was not working and I spent an hour trying to figure it out.

This is the one that's broken (Disabled since it was broken and not functioning):
1723401245413.png


This one works:
1723401262527.png


It seems to recognize lobby 2 when I'm in game but doesn't switch:
1723401449566.png
 
Last edited:

KensonPlays

New Member
It won't let me edit, but I finally made a small tweak to make it work in that game. I had to uncheck the top 2 boxes and a couple small tweaks. Took me 3 hrs to figure it out on that one game. But now, it won't work in Monster Hunter.

I'm in a group waiting for a hunt to start, it detects the image, but it isn't switching scenes at all. It stays in the Game scene, even if it matches exactly, it won't switch to Chill/Intermission. The games are both full 1440p resolution on my monitor,

I basically copied the other one and changed the screenshot it reads from.
1723404107024.png
 

StadiumPK

New Member
If you should run into issues please do let me know about them! :)
Hi there,

It's checking for it great, but now I have a different issue. I am trying to mock the game message as a reasonable test, but it is not working for me.

I have text on another layer that is then screenshotted and saved as a PNG, so it is white text on a transparent background. I also tested with a screenshot of the games background, and neither are matching. If I test with my character name from a screenshot of the game, it works fine...since it is more of an exact match.

I have tried to match the font etc, but I had figured it would pick up the text.

Any suggestions?

Here are some screenshots, if I make the threshold 0.01, no difference. Hoping I have missed something simple :)

 

phillymantis

New Member
had the most random idea....
and its about "random" ....it would be cool if instead of adding macros 1by1 to the random list
we could add a colleciton of macros...

right now when i uncheck macros i have to also remove them from the random list...that would be super dope
 

RobertWilliams

New Member
Feature request (or clarify if this is already implemented).

1) When "Copy"ing a macro action, it can only be "Paste"d to an "Action" region with the same type (Actions vs Else-Actions). For example, if a copy a macro action in the "Else Actions" section, it can only be pasted in another "Else Actions" of macro. The action cannot be pasted in the "Actions" section of a macro.

2) Add "rename" of the custom label to the context menu. Today, my work around is to choose "Use custom label" twice if I want to rename a condition with an existing custom label.

I am using Windows / v 1.26.4

Thank you.
 

Warmuptill

Active Member
It won't let me edit, but I finally made a small tweak to make it work in that game. I had to uncheck the top 2 boxes and a couple small tweaks. Took me 3 hrs to figure it out on that one game. But now, it won't work in Monster Hunter.

I'm in a group waiting for a hunt to start, it detects the image, but it isn't switching scenes at all. It stays in the Game scene, even if it matches exactly, it won't switch to Chill/Intermission. The games are both full 1440p resolution on my monitor,

I basically copied the other one and changed the screenshot it reads from.
View attachment 106801
If the pattern is recognized correctly in the "Show match" dialog then the issue must be somewhere else.
Can you please enable verbose logging on the General tab, reproduce the issue, and share the log here?
Then it should be rather easy to find out why the action is not performed.

If that shouldn't bring any new insights I am also open to join a call on Discord where we can debug the issue together.
 

Warmuptill

Active Member
Hi there,

It's checking for it great, but now I have a different issue. I am trying to mock the game message as a reasonable test, but it is not working for me.

I have text on another layer that is then screenshotted and saved as a PNG, so it is white text on a transparent background. I also tested with a screenshot of the games background, and neither are matching. If I test with my character name from a screenshot of the game, it works fine...since it is more of an exact match.

I have tried to match the font etc, but I had figured it would pick up the text.

Any suggestions?

Here are some screenshots, if I make the threshold 0.01, no difference. Hoping I have missed something simple :)

You will probably have to check the "Use alpha channel as mask for pattern" option.
With your current settings the pattern matching algorithm is looking for the transparent parts of the input image as well, which it cannot find in the given source.

You will probably get the best results, if you create a screenshot of your source using the "Browser -> Create Screenshot" option of the Video condition, and modify this screenshot to make the parts of the image you don't care about transparent.
Then you can rely on the "Use alpha channel as mask for pattern" setting to just look for the relevant parts of the screenshot.

I hope it is somewhat clear what I mean :)

Alternatively maybe using the "contains text" check of the Video condition might also work depending on how "noisy" the image output of the source will be.


had the most random idea....
and its about "random" ....it would be cool if instead of adding macros 1by1 to the random list
we could add a colleciton of macros...

right now when i uncheck macros i have to also remove them from the random list...that would be super dope
I will add it to the todo list.
Just in case it is of use.
The "Random" action type will skip over macros which are paused.

Feature request (or clarify if this is already implemented).

1) When "Copy"ing a macro action, it can only be "Paste"d to an "Action" region with the same type (Actions vs Else-Actions). For example, if a copy a macro action in the "Else Actions" section, it can only be pasted in another "Else Actions" of macro. The action cannot be pasted in the "Actions" section of a macro.

2) Add "rename" of the custom label to the context menu. Today, my work around is to choose "Use custom label" twice if I want to rename a condition with an existing custom label.

I am using Windows / v 1.26.4

Thank you.
Thanks for the suggestion!
I will add it to the todo list :)
 

StadiumPK

New Member
Ok ends up the contains text worked amazing well however, is there a way that I can control that text field without having to go into it each time? Ideally I could set a command or something that updates that text field, or have a text layer be assigned to it? Ideally a .text file would be perfect, like "stadium slain by" would be in the text field and the contains text would compare against that file.

Also it only matches when partial match... weird lol.

Alternatively maybe using the "contains text" check of the Video condition might also work depending on how "noisy" the image output of the source will be.
 

Warmuptill

Active Member
is there a way that I can control that text field without having to go into it each time?
There is a way. :)
Instead of typing in the text directly you could reference a variable instead.

You can then control the value of the variable via a separate macro. (For example by reading the value for the variable from a file)

Also it only matches when partial match...
This can be configured by clicking on the regular expression button. (.*)
Video.gif
 

Warmuptill

Active Member
all i come with lately is bad news ;) updated, and trying to access a certain macro to edit and obs crashes...
I believe I was able to identify the issue.
A build with a fix is available here in a few minutes:
Can you please confirm that the issue is no longer reproducible on your side when using this test build?
You will have to be logged into GitHub to be able to download it - let me know if that should be a problem!
 
I believe I was able to identify the issue.
A build with a fix is available here in a few minutes:
Can you please confirm that the issue is no longer reproducible on your side when using this test build?
You will have to be logged into GitHub to be able to download it - let me know if that should be a problem!
Looks fixed for me, I checked more then the ones that led to a crash, all opening fine now.
 

obsuser2023

New Member
Hi, I noticed, if another app is running in full screen, Advanced Switcher will not hear the hotkey press. If unfocuse the full screen app, Advanced Switcher can hear the hot key press. I guess this is a limitation? Thank you.
 

Warmuptill

Active Member
Hi, I noticed, if another app is running in full screen, Advanced Switcher will not hear the hotkey press. If unfocuse the full screen app, Advanced Switcher can hear the hot key press. I guess this is a limitation? Thank you.
You might get it to work by adjusting the OBS hotkey focus behaviour:
1723918894760.png
 
Hi, I noticed, if another app is running in full screen, Advanced Switcher will not hear the hotkey press. If unfocuse the full screen app, Advanced Switcher can hear the hot key press. I guess this is a limitation? Thank you.
some apps are dumb, i have one that needs to run in admin or it wont listen for hotkeys, maybe try that
 
Top