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).


๐Ÿ”ง Step-by-Step: Blueprint Integration for OnTimeMarker

๐Ÿงน 1. Create a Blueprint Based on TimeKeeper

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

  1. Open the Blueprint for TimeKeeper
  2. Go to the Event Graph
  3. 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
  4. Create a Custom Event to respond to the marker:
    • Right-click โ†’ Add Custom Event
    • Name it HandleTimeMarker
  5. Connect the custom event to the binding:
    • Drag from the Bind Event to OnTimeMarker output
    • Select Create Event โ†’ Add Custom Event โ†’ choose HandleTimeMarker
  6. Add a String Input to the Custom Event:
    • Select HandleTimeMarker
    • In the Details panel, add an input parameter:
      • Name: EventID
      • Type: String
  7. In HandleTimeMarker, add a Branch node:
    • Compare EventID == "SunriseEvent"
    • On True, trigger your logic (e.g., print a string, rotate the directional light, etc.)

๐Ÿง  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.