Giter Site home page Giter Site logo

Comments (9)

nacalai avatar nacalai commented on June 24, 2024

Oh, so it does receive input. But how can I format it properly for ball_hit, for example?

image

from sceneswitcher.

WarmUpTill avatar WarmUpTill commented on June 24, 2024

You are already almost there! :)

Seems like the problem is that you are not setting an opcode in accordance to the obs-websocket protocol.
Thus the message will be discarded.

I think what you will have to do is send a request - so use opcode 6.
But note that you will also have to adjust the condition in the macro to use the "Request" message type instead of "Event" type.

The json object that you will have to send to OBS will have to look something like this:

{
    "op": 6,
    "d": {
        "requestType": "CallVendorRequest",
        "requestId": "Example request - ws://localhost:4455",
        "requestData": {
            "vendorName": "AdvancedSceneSwitcher",
            "requestType": "AdvancedSceneSwitcherMessage",
            "requestData": {
                "message": "game:ball_hit"
            }
        }
    }
}

Let me know if you have questions / run into issues!

from sceneswitcher.

nacalai avatar nacalai commented on June 24, 2024

Thanks for the quick answer! I will admit this is outside of my expertise, and not sure how I personally can fix it. This is a websocket plugin for the game Rocket League, which I am simply listening to, and trying to trigger on commands. Will the plugin itself have to be altered?

They do also have a ws-relay. Perhaps it can be altered to send what is required? https://gitlab.com/bakkesplugins/sos/sos-ws-relay

I also tried using regex matching..to simply scan everything..but to no avail

from sceneswitcher.

WarmUpTill avatar WarmUpTill commented on June 24, 2024

Currently only connections conforming to the obs-websocket protocol are supported.

In the linked PR I drafted the option to specify that a given connection should ignore the obs-websocket protocol and instead reacts and send out plain-text messages.

WSNoOBS

I think that should allow you to react on the Rocket League websocket events using a macro setup like you shared above.

A build should be available here in a few minutes:
https://github.com/WarmUpTill/SceneSwitcher/actions/runs/4903689387?pr=743

Let me know if that works for you! :)

from sceneswitcher.

nacalai avatar nacalai commented on June 24, 2024

I was just about to suggest that, to be able to just ignore obs-ws protocols altogether and just simply listen. Perfect! I'll try it very soon

from sceneswitcher.

nacalai avatar nacalai commented on June 24, 2024

So, I'm trying it, but it doesn't seem to receive anything.
image

But you can see that it did receive something at first, in red. But unticking the box and trying to connect, it seems to doesn't receive. But connection says ok

from sceneswitcher.

nacalai avatar nacalai commented on June 24, 2024

Wait wait wait so the log will not output anything, but it is indeed receiving! I used "ball_hit" with regex partial match and it is working. Wow perfect. Thank you. Not sure if it can be outputted to log, for troubleshooting reasons in the future?

from sceneswitcher.

WarmUpTill avatar WarmUpTill commented on June 24, 2024

WS messages will still be logged if you enable verbose logging.
Does this not work for you?

The log messages you observed previously were error logs which will be printed regardless of the verbose logging setting.

from sceneswitcher.

nacalai avatar nacalai commented on June 24, 2024

Ah, right. Forgot about that. Well, it all works well now. Superb stuff. I'll close this. Thanks

from sceneswitcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.