Game Events & General Handler
Two related capabilities: pushing structured events from the engine to OBS, and the General handler’s grab-bag of endpoints that don’t belong to a single OBS domain.
Emitting Game Events to OBS
Push structured events from the engine to OBS as a namespaced CustomEvent (the engine to OBS direction). OBS-side plugins and scripts (Lua/Python), browser-source overlays, or other connected WebSocket clients can listen and react.
// Send arbitrary JSON
OBS->EmitGameEvent(TEXT("BossDefeated"), TEXT("{\"boss\":\"Dragon\",\"timeSec\":372}"));
// ...or a simple string map (each pair becomes a string field under "payload")
TMap<FString, FString> Payload;
Payload.Add(TEXT("combo"), TEXT("42"));
OBS->EmitGameEventMap(TEXT("ComboMilestone"), Payload);
| Method | Notes |
|---|---|
EmitGameEvent(EventName, PayloadJson, Realm="inhyeongobs") | Send arbitrary JSON. Returns false and sends nothing if the payload string isn’t valid JSON. |
EmitGameEventMap(EventName, Map, Realm="inhyeongobs") | Each key/value pair becomes a string field under payload. |
Events are wrapped in a stable envelope under OBS’s CustomEvent:
{ "realm": "inhyeongobs", "eventType": "BossDefeated", "payload": { }, "ts": 0 }
The optional Realm argument (default "inhyeongobs") namespaces your events so listeners can filter. These methods are layered over the General handler’s BroadcastCustomEvent, where EmitGameEvent is the structured wrapper and is the one General-handler capability with a direct Subsystem shortcut.
Note: OBS does not echo custom events back to the originating session, so the emitting client won’t receive its own events.
General Handler (Stats, Hotkeys, Vendor & Custom Events)
General-purpose endpoints that don’t belong to a single domain, reached through the client’s General handler:
UInhyeongOBSGeneral* General = OBS->GetClient()->GetGeneral();
// Performance stats (CPU usage, active/render FPS, dropped frames, free disk space, ...)
General->GetStats(); // async -> OnStatsReceived
FOBSStats Stats = General->GetCachedStats();
// Hotkeys
General->GetHotkeyList(); // async -> OnHotkeyListReceived
General->TriggerHotkeyByName(TEXT("OBSBasic.StartRecording"));
General->TriggerHotkeyByKeySequence(TEXT("OBS_KEY_F1"), /*bShift=*/false, /*bControl=*/true);
Methods
| Method | Notes |
|---|---|
GetStats() | Async request for performance stats (CPU, active/render FPS, dropped frames, free disk space, …) → OnStatsReceived. |
GetCachedStats() | Last cached FOBSStats. |
GetHotkeyList() | Async request for registered hotkey names → OnHotkeyListReceived. |
TriggerHotkeyByName(Name) | Fire a hotkey by its registered name (e.g. OBSBasic.StartRecording). |
TriggerHotkeyByKeySequence(Key, bShift, bControl, …) | Fire a hotkey by key + modifiers. |
BroadcastCustomEvent(...) | Raw custom events (EmitGameEvent above is the structured wrapper over it). |
CallVendorRequest(...) | Call a third-party OBS plugin’s vendor API → OnVendorResponseReceived. |
Events
| Event | Fires when |
|---|---|
OnStatsReceived | A GetStats reply arrives. |
OnHotkeyListReceived | A GetHotkeyList reply arrives. |
OnExitStarted | OBS begins shutting down. |
OnVendorEvent | A third-party vendor plugin emits an event. |
OnCustomEvent | A custom event is broadcast by another session. |
Most General-handler methods are reached via
GetClient()->GetGeneral().EmitGameEventhas the direct Subsystem shortcut shown above.