open-index/open-npm huggingface dataset:
npm package: @sometimes_youwin/obs-websocket-gd
Description: Control OBS from inside a Godot game or app.
Author: Tim Yuen
Latest version: 1.0.1

# ![](obs_godot_icon.png) OBS Websocket GD

[![Chat on Discord](https://img.shields.io/discord/853476898071117865?label=chat&logo=discord)](https://discord.gg/6mcdWWBkrr)

A Godot addon to interact with [obs-websocket](https://github.com/Palakis/obs-websocket). Tested on Godot 3.4.

## IMPORTANT
This addon targets obs-websocket 5.x. Please use the `obs-websocket_4.x` branch if you are using obs-websocket 4.x.

## Game/App Quickstart
1. Install [obs-websocket](https://github.com/Palakis/obs-websocket) for your platform
2. Configure obs-websocket in OBS and set the password to something of your choosing
3. Clone this project
4. Instance in the `addons/obs_websocket_gd/obs_websocket.tscn` file somewhere in your project
5. By default, the addon tries to connect to `localhost:4444` with a password of `password`. Change the password in `addons/obs_websocket_gd/obs_websocket.gd` to the password set in step 2. The variables are exported for convenience
6. (OPTIONAL) Connect some listener to the `obs_data_received(update_data)` signal in `obs_websocket.gd`. `obs_data_received` outputs an `ObsMessage` data structure. This data structure stores the raw response and also maps the data to the expected OpCode fields.
7. Call the `send_command(command: String, data: Dictionary = {})` method on the `obs_websocket.gd` instance. Reference the [obs-websocket protocol](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md) to find out what commands + data to send