Registering Events
Last updated
Last updated
The YOM SDK allows you to create and listen for your own custom events, allowing communication between the Unreal client and the pixel streamer /web browser. This guide explains how to set up and use them.
To use Push Events, first access the YOMPlayer. Via standard Unreal method:
Get the PlayerController
Cast it to YOMPlayer
Store the result if needed
Or, using GetYomPlayer function directly:
Once you have the YomPlayer, register a stream event:
Set PFunctionName:
Name of the function to call
Will be displayed in the "GodMode" modal when enabled
Used to call the linked event
Set PEvent:
Event to be called when the function named PFunctionName is triggered
Set PNeedsGodMode:
Determines if the event is added to GodMode
Use for admin-only functions (GodMode requires a password)
Create the event:
Drag from PEvent and search for "create event"
Select "Create Event" node
Choose "select a function" and pick from the dropdown or create a new one
Note: The function input will be a Va Rest Json object, allowing data to be sent with the event.
To process data that is sent with the event:
Access the data object passed to the function
Use "get field by name and type" to retrieve specific variables
Implement your logic using the retrieved data