Vision Module
The vision module allows you to receive and interact with in-game events, such as health changes, eliminations, victories, and more.
Required Permissions: sld.vision
startVision
This function will launch the background vision process. ### Example
javascript streamlabsObs.v1.Vision.startVision()
initiateSubscription method
method
initiateSubscription(): void
This function must be called before any events or state can be received.
Example
streamlabsOBS.v1.Vision.initiateSubscription();
requestAvailableProcesses method
method
requestAvailableProcesses(): Promise<VisionProcess[]>
This function requests the list of currently available processes and returns it as a Promise.
Returns
Promise<VisionProcess[]>
Example
streamlabsObs.v1.Vision.requestAvailableProcesses();
requestActiveProcess method
method
requestActiveProcess(): Promise<VisionProcess>
This function requests the currently active process and returns it as a Promise.
Returns
Promise<VisionProcess>
Example
streamlabsObs.v1.Vision.requestActiveProcess();
activateProcess method
method
activateProcess(pid, selectedGame)
This function allows you to change the active process the Vision module is watching for events.
Arguments
pid: This is the process id of one of the available processes and is required
selectedGame is an optional parameter that must only be passed when using a process of type capture_device
Example
streamlabsObs.v1.Vision.activateProcess(pid,selectedGame);
UserStateTree object
object
{
"vision": {
"fortnite": {
"eliminations": {
"session": 152
}
}
}
}
UserState object
object
{
"vision.fortnite.eliminations.session": 152
}
VisionEventsPayload object
object
Property | Type | Description |
---|---|---|
vision_event_id | string | A persistent, immutable, and unique identifier for this payload |
events | VisionEvent[] | |
game | string | |
timestamp | number |
VisionEvent object
object
Property | Type | Description |
---|---|---|
name | string | |
data? | VisionEventData[] |
VisionEventData object
object
Property | Type | Description |
---|---|---|
value | number |
userStateTree event
event
This event is emitted whenever the user's state changes. Your callback will be called with a UserStateTree object.
Example
streamlabsOBS.v1.Vision.userStateTree(userStateTree => {
});
userState event
event
This event is emitted whenever the user's state changes. Your callback will be called with a UserState object.
Example
=streamlabsOBS.v1.Vision.userState(userState => {
});
visionEvent event
event
This event is emitted whenever there is a new Vision event. Your callback will be called with a VisionEventsPayload object.
Example
streamlabsOBS.v1.Vision.visionEvent(visionEventsPayload => {
});
Updated 9 days ago