Skip to content

CCTV Program

The bundled program Blueprint is a thin child of native UOperatingSystemCCTVProgram. C++ owns validation, startup, and the capture tick loop via UOperatingSystemCCTVProgramData.

flowchart TB
  subgraph row1[" "]
    direction LR
    Prog["BP_Prog_CCTV"] --> Data["BP_Prog_CCTVData"]
  end
  subgraph row2[" "]
    direction LR
    Widget["WBP_CCTV"] --- Sub["UOperatingSystemCCTVWorldSubsystem"]
  end
  Prog --> Widget
  Data --> Sub

Plugin path:

OperatingSystemContent/Shared/Blueprints/Programs/CCTV/BP_Prog_CCTV

These are set in UOperatingSystemCCTVProgram and inherited by BP_Prog_CCTV:

PropertyDefaultDescription
IdentifiercctvUsed by OS to resolve the program
Data ClassUOperatingSystemCCTVProgramDataRequired — bRequiresData = true
Save MethodDoNotSaveNo persistent CCTV preferences
Space Required100 MBShown in Store metadata
Start Window StateStartMaximizedOpens fullscreen monitoring UI
Can Run On Portable DevicetrueLaptops / tablets supported
Initial LayoutSingleViewOne large feed on launch
Capture MethodFrameBasedRecommended for performance
Capture SpeedMediumCapture every 30 frames
Capture Time0.2 sUsed when method is TimeBased

EOperatingSystemCCTV_Layout controls how many feeds render at once:

LayoutCameras shownRender target
SingleView1 (selected)Main view (2048×1024 default)
LayoutFourUp to 4Grid view (512×256 each)
LayoutSixUp to 6Grid view
LayoutEightUp to 8Grid view
LayoutNineUp to 9Grid view
stateDiagram-v2
  [*] --> SingleView: Program starts
  SingleView --> LayoutFour: Set Layout
  SingleView --> LayoutNine: Set Layout
  LayoutFour --> SingleView: Set Layout
  LayoutNine --> SingleView: Set Selected Camera

On layout change, the data object swaps each camera between main and grid render targets, then triggers an immediate capture.

EOperatingSystemCCTV_CaptureMethod determines when scene captures run:

MethodBehaviorBest for
ManualOnly when Capture Now is calledScripted snapshots, cutscenes
TimeBasedEvery Capture Time secondsFixed refresh rate regardless of frame rate
FrameBasedEvery N frames (Capture Speed)Recommended — scales with game performance
EnumFrames between captures
EveryFrame (Realtime)1
VeryFast5
Fast15
Medium30
Slow60
VerySlow120

Call these on a reference to BP_Prog_CCTV (or UOperatingSystemCCTVProgram) after the program has started:

Event On Layout Button Clicked (Custom UI)
→ Get Parent Program (as UOperatingSystemCCTVProgram)
→ Set Layout (Layout Four)

OnLayoutChanged fires on the program when the layout updates successfully.

Set Capture Method (Frame Based)
→ Set Capture Speed (Slow)

Set Capture Speed only succeeds when the current method is FrameBased.

On Camera List Item Clicked (AOperatingSystemCCTVActor reference)
→ Set Selected Camera (Clicked Camera)
→ Set Layout (Single View)
On Refresh Button Clicked
→ Capture Now
Event Construct (WBP_CCTV)
→ Get Parent Program (as UOperatingSystemCCTVProgram)
→ Get All CCTV Actors → Out CCTV Actors (array)
→ For Each Loop → Add entry to camera list UI
sequenceDiagram
  participant OS
  participant Prog as UOperatingSystemCCTVProgram
  participant Data as UOperatingSystemCCTVProgramData
  participant Sub as World Subsystem

  OS->>Prog: Install / launch
  Prog->>Data: ShouldCreate
  Data->>Sub: GetAllCCTVActors
  alt No cameras in level
    Data-->>Prog: false — program data not created
  else Cameras found
    Data->>Data: SetupId on each actor
    Prog->>Data: OnCreate — apply capture defaults
    Prog->>Data: OnProgramStarted — enable tick
    loop Tick
      Data->>Data: Internal_Capture per method
    end
    Prog->>Data: OnProgramClosed — disable tick
  end

Subclass UOperatingSystemCCTVProgram, override OnStart to apply custom defaults, and create a Blueprint child for editor-tweakable properties — same pattern as C++ program from scratch.

Required: Data Class must be UOperatingSystemCCTVProgramData or a child thereof (OnValidate enforces this).