Skip to content

v1.3.1 - OBS Lua script for race-event automation

Choose a tag to compare

@seikenxa seikenxa released this 26 May 05:09
· 12 commits to main since this release

v1.3.1 — OBS Lua script for race-event automation

Adds obs-script/autocam_obs.lua — an OBS Lua script that reads status.json
from the plugin and fires configurable OBS actions (scene switch, source show/hide,
media playback) whenever race events occur.

Setup

  1. In OBS: Tools → Scripts → + → select autocam_obs.lua
  2. Set status.json path in the script settings
    • Same-PC: C:\...\rF2stream\status.json
    • Two-PC (network share): \\game-pc\rF2stream\status.json
  3. Configure actions per trigger — all settings are optional, leave blank to skip

Triggers

Trigger Fires when…
Replay started / ended on_replay changes
Battle started / ended in_battle changes
Side-by-side started / ended sbs_active changes
Leader changed leader field changes
Formation lap game_phaseformation
Green flag game_phasegreen
Safety car / FCY game_phaseyellow
Red flag game_phasestopped
Race finished game_phasefinished

Per-trigger actions

Setting Description
Switch scene OBS scene to activate
Show sources Comma-separated source names to make visible
Hide sources Comma-separated source names to hide
Trigger media source Media Source to restart/play
Auto-restore after N sec Reverses show↔hide automatically (0 = off)

Example: replay scene with auto-return

  • Replay started → Switch scene: Replay, Show: Replay Overlay
  • Replay ended → Switch scene: Live, Hide: Replay Overlay

Example: leader-change banner (auto-hide after 5 s)

  • Leader changed → Show: Leader Banner, Auto-restore: 5

Notes

  • First poll establishes a silent baseline — no triggers fire on OBS startup
  • Two-PC setups: UNC paths (\\game-pc\rF2stream\status.json) work natively
  • No extra software required beyond OBS itself
  • Requires rf2-autocam v1.3.0 or later for in_battle, sbs_active, leader, and game_phase fields