mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
50 lines
1.1 KiB
Markdown
50 lines
1.1 KiB
Markdown
# EventCenterPlugin
|
|
|
|
(WIP) Subscribe to events.
|
|
|
|
I tried Redis PubSub first, but the plugin I found was buggy. I'm trying WebSockets now.
|
|
|
|
## Installation
|
|
|
|
Install the [BlueprintWebSocket](https://www.unrealengine.com/marketplace/en-US/product/blueprintwebsocket)
|
|
plugin (paid/commercial) from the Epic/Unreal Marketplace. It's not expensive and has great documentation.
|
|
|
|
## Usage
|
|
|
|
It's expected to wire events up in the `Level Blueprint`.
|
|
|
|
## Python testing
|
|
|
|
I stand up a websocket+pubsub system like so:
|
|
|
|
```
|
|
PS C:\Users\echel\OneDrive\Documents\Unreal Projects\RedisTestProject\Plugins\EventCenterPlugin> .\python\Scripts\Activate.ps1
|
|
```
|
|
|
|
## Notes
|
|
|
|
A few collected notes, since I'm still new to Unreal engine and I'm cleaning up my debug code.
|
|
|
|
To log to the game screen,
|
|
|
|
```
|
|
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "Message goes here");
|
|
```
|
|
|
|
Time based handling in Tick(),
|
|
|
|
```
|
|
void AEventSourceActor::Tick(float DeltaTime)
|
|
{
|
|
Super::Tick(DeltaTime);
|
|
|
|
float time = GetGameTimeSinceCreation();
|
|
|
|
if (time - timerLastTime > 15.0) {
|
|
timerLastTime = time;
|
|
// Do the thing
|
|
}
|
|
}
|
|
```
|
|
|