OBS Control API
Gives direct access to OBS actions.
截圖 共 2 張
模組介紹 作者原文
OBS Control API
Clipping made easy!
RUMBLE mod that allows controlling OBS Studio from inside of the game.
This mod implements a websocket client that communicates directly with OBS and allows controlling it from inside the game, without the need for third-party software. It provides:
- for modders, an API to easily send requests and subscribe to events
- for users, two default controller key bindings that facilitate clipping:
- pressing both buttons on the left controller
- pressing both buttons on the right controller
The client connects automatically as soon as the server (ie OBS Studio) is available. If the server is unavailable, it will keep trying to contact it every 3 seconds. If it connects but fails to authenticate (wrong password), it will disconnect, log an error message and stop trying until the options in UIFramework are changed.
Requirements
In addition to the displayed dependencies, this mod requires the obs-websocket plugin, which is included by default with OBS Studio 28.0.0 and above. For older versions, you need to install the plugin manually.
Setup
- After starting the game with the mod and loading into the gym, you should be able to edit the options in UIFramework by pressing F9. This needs to be done the first time you use the mod, in order to configure the websocket client.
- Open OBS Studio and go to "Tools"->"WebSocket Server Settings". There, check "Enable WebSocket server":
After that, use the server's configuration to configure the mod:
- Copy the password and enter it into UIFramework.
- The IP address of the server only needs to be entered if you're running OBS and the game on different computers. Else you can leave the default value "localhost".
- By default, the websocket server is operating on port 4455. If you didn't change it manually then you shouldn't need to change it in the mod.
Once you save the configuration, the mod will try to connect again, and if it's successful you should see it under "Connected WebSocket Sessions".
- Other options you can set in UIFramework are:
- do you want the mod to start the replay buffer automatically as soon as it connects to OBS (highly recommended)?
- should the replay buffer be saved with a delay after the key binding is activated?
- what do you want the two default key bindings to do? The options are:
- Nothing
- Save replay buffer
- Start recording
- Stop recording
- Toggle recording
- Save screenshot
- what duration do you want for the haptic feedback after a key binding action is successful (Set to 0 to disable)?
- do you want to have sound effects when an action is successful?
- how loud do you want the haptic feedback to be?
- do you want the mod to automatically switch to a specific OBS scene when connecting?
The default configuration is set to automatically start the replay buffer when the client connects, save the replay buffer when the two buttons on the left controller are pressed (screenshot for the right one), and it will give haptic and audio feedback as confirmation that the clip was successfully saved.
Audio feedback customization
In order to play audio when an action is executed, the mod reads.wav files from UserData/OBS_Control_API/sfx_assets:
- confirmation.wav
- screenshot.wav
- start_recording.wav
- stop_recording.wav
This folder is automatically filled with the right files when the mod first starts, but you can replace them with your own files (with the same names) if you want different sounds, or to remove some sound effects and not others.
Modding API
The mod provides 3 types of programming interfaces:
- Local functions that don't create new requests
- Sending requests to OBS (and receiving the responses)
- Subscribing to events from OBS
All classes, functions and types are defined in the namespace OBS_Control_API.
All of the methods and events are provided inside of a single public class named "OBS", so all of the following definitions are assumed to have the prefix OBS. before them. For exam
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: