The TimeKeeper System - wwestlake/Steamforge GitHub Wiki
๐ฏ Goal
Set up the TimeKeeper
Blueprint to automatically listen for a SunriseEvent
broadcast via OnTimeMarker
, and respond by doing something in the world (e.g., print a message or trigger a lighting change).
OnTimeMarker
๐ง Step-by-Step: Blueprint Integration for TimeKeeper
๐งน 1. Create a Blueprint Based on You've already done this: TimeKeeper1
is in the world and based on your ATimeKeeper
C++ class.
๐ 2. Create an Event Listener in the Event Graph
- Open the Blueprint for
TimeKeeper
- Go to the Event Graph
- In the graph:
- Right-click in an empty area
- Search for On Time Marker โ You should see the
Bind Event to OnTimeMarker
node - Place it
- Create a Custom Event to respond to the marker:
- Right-click โ Add Custom Event
- Name it
HandleTimeMarker
- Connect the custom event to the binding:
- Drag from the
Bind Event to OnTimeMarker
output - Select Create Event โ Add Custom Event โ choose
HandleTimeMarker
- Drag from the
- Add a String Input to the Custom Event:
- Select
HandleTimeMarker
- In the Details panel, add an input parameter:
- Name:
EventID
- Type:
String
- Name:
- Select
- In
HandleTimeMarker
, add a Branch node:- Compare
EventID == "SunriseEvent"
- On True, trigger your logic (e.g., print a string, rotate the directional light, etc.)
- Compare
๐ง Example Blueprint Graph Logic
Event BeginPlay
โ Bind Event to OnTimeMarker
โ HandleTimeMarker (String EventID)
โ Branch (EventID == "SunriseEvent")
โ Print String: "Sunrise begins!"
โ๏ธ Optional: Automate the Sun Lighting Response
If you want to go further:
- Add a
DirectionalLight
reference to your Blueprint - On
SunriseEvent
, adjust its rotation or intensity
๐๏ธ Event Data Setup Reminder
Make sure you have an entry in your Time Marker DataTable:
EventID | EventName | Hour | Minute | DayOfWeek | bIsDaily |
---|---|---|---|---|---|
SunriseEvent | Sunrise | 6 | 0 | (Any) | true |
And optionally a row in your Event Metadata Table:
EventID | Description | LoreText |
---|---|---|
SunriseEvent | Dawn begins | The sun rises over Duskglen. |