Class SteamTimeline
Purpose: Steam Timeline API
Inherited Members
Namespace: Unity.Steamworks.Interop
Assembly: Unity.Steamworks.Interop.dll
Syntax
public static class SteamTimeline
Methods
AddGamePhaseTag(string, string, string, uint)
Add a tag that applies to the entire phase
Declaration
public static void AddGamePhaseTag(string pchTagName, string pchTagIcon, string pchTagGroup, uint unPriority)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchTagName | Passed through to |
| string | pchTagIcon | Passed through to |
| string | pchTagGroup | Passed through to |
| uint | unPriority | Passed through to |
AddInstantaneousTimelineEvent(string, string, string, uint, float, ETimelineEventClipPriority)
****************** Timeline Events ****************** The following functions add events and/or tags to the timeline. There are helpers to add simple events or tags in a single call. or you can use StartEvent and CloseEvent to customize what gets added. Examples of events to add could include:
- a boss battle
- a cut scene
- a large team fight
- picking up a new weapon or ammunition
- scoring a goal Adding an event and a time range with the simple API: don't show filter start now SteamTimeline()->AddSimpleTimelineEvent( "steam_heart", Localize( "#user healed" ), Localize( "#health_amount", 27 ), 15, 0, 0, k_ETimelineEventClipPriority_None ); start 10 sec ago SteamTimeline()->AddTaggedTimeRange( Localize( "#player_resting" ), "steam_flag", nullptr, 15, 0, 10 ); SteamTimeline()->AddTaggedTimeRange( Localize( "#player_cast_light" ), "steam_starburst", Localize( "#player_spells" ), 10, -10, 5 ); start now Adding a marker and time range in one event: TimelineEventHandle_t event = SteamTimeline()->StartEvent( 0 ); start now SteamTimeline()->ShowEventOnTimeline( event, "steam_heart", Localize( "#player_healed" ), Localize( "#player_healed_amount", 27 ), 15 ); SteamTimeline()->AddEventTag( event, Localize( "#player_cast_heal" ), "steam_heart", Localize( "#player_, 15, 0, 10 ); ... // time passes SteamTimeline()->CloseEvent( event ); Parameters used by the event functions:
- ulOpenEvent: An event returned by StartEvent that has not yet had CancelEvent or CloseEvent called on it
- ulEvent: An event that has had CloseEvent called on it, or an event returned from AddSimpleTimelineEvent or AddTaggedTimeRange (which are closed automatically.)
- pchIcon: specify the name of the icon uploaded through the Steamworks Partner Site for your title or one of the provided icons that start with steam_
- pchTitle & pchDescription: provide a localized string in the language returned by SteamUtils()->GetSteamUILanguage()
- unIconPriority: specify how important this range is compared to other markers provided by the game. Ranges with larger priority values will be displayed more prominently in the UI. This value may be between 0 and k_unMaxTimelinePriority.
- flStartOffsetSeconds: The time that this range started relative to now. Negative times indicate an event that happened in the past.
- flDurationSeconds: How long the time range should be in seconds. For instantaneous events, this should be 0
- ePossibleClip: By setting this parameter to Featured or Standard, the game indicates to Steam that it would be appropriate to offer this range as a clip to the user. For instantaneous events, the suggested clip will be for a short time before and after the event itself.
- pchTagIcon: specify an icon name that will be used next to the tag name in the UI
- pchTagName: The localized name of the tag to show in the UI.
- pchTagGroup: The localized name of the tag group to show in the UI. If this is not specified, users will not be able to filter by this tag
- unTagPriority: specify how important this tag is compared to other tags provided by the game. Returns: A TimelineEventHandle_t that can be used to make subsequent calls to refer to the timeline event. This event handle is invalid after the game exits. quick helpers that add to the timeline in one call
Declaration
public static TimelineEventHandle_t AddInstantaneousTimelineEvent(string pchTitle, string pchDescription, string pchIcon, uint unIconPriority, float flStartOffsetSeconds = 0, ETimelineEventClipPriority ePossibleClip = ETimelineEventClipPriority.k_ETimelineEventClipPriority_None)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchTitle | Passed through to |
| string | pchDescription | Passed through to |
| string | pchIcon | Passed through to |
| uint | unIconPriority | Passed through to |
| float | flStartOffsetSeconds | Passed through to |
| ETimelineEventClipPriority | ePossibleClip | Passed through to |
Returns
| Type | Description |
|---|---|
| TimelineEventHandle_t | The value |
AddRangeTimelineEvent(string, string, string, uint, float, float, ETimelineEventClipPriority)
Calls the Steamworks ISteamTimeline::AddRangeTimelineEvent method.
Declaration
public static TimelineEventHandle_t AddRangeTimelineEvent(string pchTitle, string pchDescription, string pchIcon, uint unIconPriority, float flStartOffsetSeconds = 0, float flDuration = 0, ETimelineEventClipPriority ePossibleClip = ETimelineEventClipPriority.k_ETimelineEventClipPriority_None)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchTitle | Passed through to |
| string | pchDescription | Passed through to |
| string | pchIcon | Passed through to |
| uint | unIconPriority | Passed through to |
| float | flStartOffsetSeconds | Passed through to |
| float | flDuration | Passed through to |
| ETimelineEventClipPriority | ePossibleClip | Passed through to |
Returns
| Type | Description |
|---|---|
| TimelineEventHandle_t | The value |
ClearTimelineTooltip(float)
Calls the Steamworks ISteamTimeline::ClearTimelineTooltip method.
Declaration
public static void ClearTimelineTooltip(float flTimeDelta)
Parameters
| Type | Name | Description |
|---|---|---|
| float | flTimeDelta | Passed through to |
DoesEventRecordingExist(TimelineEventHandle_t)
add a tag to whatever time range is represented by the event
Declaration
public static SteamAPICall_t DoesEventRecordingExist(TimelineEventHandle_t ulEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineEventHandle_t | ulEvent | Passed through to |
Returns
| Type | Description |
|---|---|
| SteamAPICall_t | The value |
DoesEventRecordingExistAsync(TimelineEventHandle_t)
Async version of DoesEventRecordingExist(TimelineEventHandle_t).
Declaration
public static Task<SteamTimelineEventRecordingExists_t> DoesEventRecordingExistAsync(TimelineEventHandle_t ulEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineEventHandle_t | ulEvent | Passed through to |
Returns
| Type | Description |
|---|---|
| Task<SteamTimelineEventRecordingExists_t> | The SteamTimelineEventRecordingExists_t Steam reports once the call completes. |
DoesGamePhaseRecordingExist(string)
Calls the Steamworks ISteamTimeline::DoesGamePhaseRecordingExist method.
Declaration
public static SteamAPICall_t DoesGamePhaseRecordingExist(string pchPhaseID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchPhaseID | Passed through to |
Returns
| Type | Description |
|---|---|
| SteamAPICall_t | The value |
DoesGamePhaseRecordingExistAsync(string)
Async version of DoesGamePhaseRecordingExist(string).
Declaration
public static Task<SteamTimelineGamePhaseRecordingExists_t> DoesGamePhaseRecordingExistAsync(string pchPhaseID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchPhaseID | Passed through to |
Returns
| Type | Description |
|---|---|
| Task<SteamTimelineGamePhaseRecordingExists_t> | The SteamTimelineGamePhaseRecordingExists_t Steam reports once the call completes. |
EndGamePhase()
Calls the Steamworks ISteamTimeline::EndGamePhase method.
Declaration
public static void EndGamePhase()
EndRangeTimelineEvent(TimelineEventHandle_t, float)
Ends a range timeline event and shows it in the UI.
Declaration
public static void EndRangeTimelineEvent(TimelineEventHandle_t ulEvent, float flEndOffsetSeconds)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineEventHandle_t | ulEvent | Passed through to |
| float | flEndOffsetSeconds | Passed through to |
OpenOverlayToGamePhase(string)
****************** Opening the overlay ****************** Opens the Steam overlay to a game phase. Parameters:
- pchPhaseID: The ID of a phase that was previously provided by the game in SetGamePhaseID.
Declaration
public static void OpenOverlayToGamePhase(string pchPhaseID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchPhaseID | Passed through to |
OpenOverlayToTimelineEvent(TimelineEventHandle_t)
Opens the Steam overlay to a timeline event. Parameters:
- ulEventID: The ID of a timeline event returned by StartEvent or AddSimpleTimelineEvent
Declaration
public static void OpenOverlayToTimelineEvent(TimelineEventHandle_t ulEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineEventHandle_t | ulEvent | Passed through to |
RemoveTimelineEvent(TimelineEventHandle_t)
delete the event from the timeline. This can be called on a timeline event from AddInstantaneousTimelineEvent, AddRangeTimelineEvent, or StartRangeTimelineEvent/EndRangeTimelineEvent. The timeline event handle must be from the current game process.
Declaration
public static void RemoveTimelineEvent(TimelineEventHandle_t ulEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineEventHandle_t | ulEvent | Passed through to |
SetGamePhaseAttribute(string, string, uint)
Add a text attribute that applies to the entire phase
Declaration
public static void SetGamePhaseAttribute(string pchAttributeGroup, string pchAttributeValue, uint unPriority)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchAttributeGroup | Passed through to |
| string | pchAttributeValue | Passed through to |
| uint | unPriority | Passed through to |
SetGamePhaseID(string)
Games can set a phase ID so they can refer back to a phase in OpenOverlayToPhase
Declaration
public static void SetGamePhaseID(string pchPhaseID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchPhaseID | Passed through to |
SetTimelineGameMode(ETimelineGameMode)
Changes the color of the timeline bar. See ETimelineGameMode comments for how to use each value
Declaration
public static void SetTimelineGameMode(ETimelineGameMode eMode)
Parameters
| Type | Name | Description |
|---|---|---|
| ETimelineGameMode | eMode | Passed through to |
SetTimelineTooltip(string, float)
Sets a description for the current game state in the timeline. These help the user to find specific moments in the timeline when saving clips. Setting a new state description replaces any previous description. Examples could include:
- Where the user is in the world in a single player game
- Which round is happening in a multiplayer game
- The current score for a sports game Parameters:
- pchDescription: provide a localized string in the language returned by SteamUtils()->GetSteamUILanguage()
- flTimeDelta: The time offset in seconds to apply to this event. Negative times indicate an event that happened in the past.
Declaration
public static void SetTimelineTooltip(string pchDescription, float flTimeDelta)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchDescription | Passed through to |
| float | flTimeDelta | Passed through to |
StartGamePhase()
****************** Game Phases ****************** Game phases allow the user to navigate their background recordings and clips. Exactly what a game phase means will vary game to game, but the game phase should be a section of gameplay that is usually between 10 minutes and a few hours in length, and should be the main way a user would think to divide up the game. These are presented to the user in a UI that shows the date the game was played, with one row per game slice. Game phases should be used to mark sections of gameplay that the user might be interested in watching. Examples could include:
- A single match in a multiplayer PvP game
- A chapter of a story-based singleplayer game
- A single run in a roguelike Game phases are started with StartGamePhase, and while a phase is still happening, they can have tags and attributes added to them. Phase attributes represent generic text fields that can be updated throughout the duration of the phase. They are meant to be used for phase metadata that is not part of a well defined set of options. For example, a KDA attribute that starts with the value "0/0/0" and updates as the phase progresses, or something like a played-entered character name. Attributes can be set as many times as the game likes with SetGamePhaseAttribute, and only the last value will be shown to the user. Phase tags represent data with a well defined set of options, which could be data such as match resolution, hero played, game mode, etc. Tags can have an icon in addition to a text name. Multiple tags within the same group may be added per phase and all will be remembered. For example, AddGamePhaseTag may be called multiple times for a "Bosses Defeated" group, with different names and icons for each boss defeated during the phase, all of which will be shown to the user. The phase will continue until the game exits, until the game calls EndGamePhase, or until the game calls StartGamePhase to start a new phase. The game phase functions take these parameters:
- pchTagIcon: The name of a game provided timeline icon or builtin "steam_" icon.
- pchPhaseID: A game-provided persistent ID for a game phase. This could be a the match ID in a multiplayer game, a chapter name in a single player game, the ID of a character, etc.
- pchTagName: The localized name of the tag in the language returned by SteamUtils()->GetSteamUILanguage().
- pchTagGroup: The localized name of the tag group.
- pchAttributeValue: The localized name of the attribute.
- pchAttributeGroup: The localized name of the attribute group.
- unPriority: Used to order tags and attributes in the UI displayed to the user, with higher priority values leading to more prominent positioning. In contexts where there is limited space, lower priority items may be hidden.
Declaration
public static void StartGamePhase()
StartRangeTimelineEvent(string, string, string, uint, float, ETimelineEventClipPriority)
Starts a timeline event at a the current time, plus an offset in seconds. This event must be ended with EndRangeTimelineEvent. Any timeline events that have not been ended when the game exits will be discarded.
Declaration
public static TimelineEventHandle_t StartRangeTimelineEvent(string pchTitle, string pchDescription, string pchIcon, uint unPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchTitle | Passed through to |
| string | pchDescription | Passed through to |
| string | pchIcon | Passed through to |
| uint | unPriority | Passed through to |
| float | flStartOffsetSeconds | Passed through to |
| ETimelineEventClipPriority | ePossibleClip | Passed through to |
Returns
| Type | Description |
|---|---|
| TimelineEventHandle_t | The value |
UpdateRangeTimelineEvent(TimelineEventHandle_t, string, string, string, uint, ETimelineEventClipPriority)
Updates fields on a range timeline event that was started with StartRangeTimelineEvent, and which has not been ended.
Declaration
public static void UpdateRangeTimelineEvent(TimelineEventHandle_t ulEvent, string pchTitle, string pchDescription, string pchIcon, uint unPriority, ETimelineEventClipPriority ePossibleClip)
Parameters
| Type | Name | Description |
|---|---|---|
| TimelineEventHandle_t | ulEvent | Passed through to |
| string | pchTitle | Passed through to |
| string | pchDescription | Passed through to |
| string | pchIcon | Passed through to |
| uint | unPriority | Passed through to |
| ETimelineEventClipPriority | ePossibleClip | Passed through to |