Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SCR_VoiceoverSystem Interface Reference
Inheritance diagram for SCR_VoiceoverSystem:
[legend]

Public Member Functions

override bool ShouldBePaused ()
 Is this system should be paused while the simulation is paused?
 
ScriptInvokerVoid GetOnFinished ()
 Triggered when a line or sequence finishes playing.
 
ScriptInvokerString GetOnFinishedEvent ()
 Triggered when an event finishes playing.
 
void SetData (ResourceName config)
 Loads voiceover data from the given SCR_VoiceoverData config resource Must be called before PlaySequence or PlayLine which both use data from this config!
 
bool IsPlaying ()
 
void SetActorName (SCR_EVoiceoverActor actor, string name)
 Actor name associated with the given enum will be shown in the subtitle.
 
void ClearActorNames ()
 
void PlaySequence (string sequenceName, IEntity actor1=null, IEntity actor2=null, IEntity actor3=null, IEntity actor4=null, IEntity actor5=null, bool playImmediately=true)
 Plays a sequence of voiceover lines defined in loaded config (see SetData)
 
void PlaySequenceActorsArray (string sequenceName, notnull array< IEntity > actors, bool playImmediately=true)
 Same as PlaySequence but accepts an array of actors.
 
void PlaySequenceGlobal (string sequenceName, notnull array< IEntity > actors, bool playImmediately=true)
 Same as PlaySequence but plays the VO for all clients. Has to be executed on server.
 
void PlaySequenceFor (string sequenceName, notnull array< IEntity > actors, notnull array< int > targetPlayerIds, bool playImmediately=true)
 Same as PlaySequenceGlobal but plays the VO for clients defined by player IDs.
 
void PlayLine (string lineName, IEntity actor=null, bool playImmediately=true)
 Plays a voiceover line defined in loaded config (see SetData)
 
void PlayLineGlobal (string lineName, notnull IEntity actor, bool playImmediately=true)
 Same as PlayLine but plays the VO for all clients. Has to be executed on server.
 
void PlayLineFor (string lineName, notnull IEntity actor, notnull array< int > targetPlayerIds, bool playImmediately=true)
 Same as PlayLineGlobal but plays the VO for clients defined by player IDs.
 
void PlayCustomLine (string soundEventName, string subtitle, IEntity actor=null, string actorName=string.Empty, bool playImmediately=true)
 Plays a custom voiceover line.
 
void Stop ()
 
void RegisterActor (notnull IEntity entity)
 Registers an actor so subtitles can be shown when a voiceover is not played from the voiceover system (like from animations etc.) Needs to be called before the sound event is played Voiceover data with subtitles still has to be set properly with corresponding sound event.
 
void ~SCR_VoiceoverSystem ()
 
- Public Member Functions inherited from GameSystem
bool ShouldBePaused ()
 Is this system should be paused while the simulation is paused?
 
bool ShouldBeEnabledInEditMode ()
 Is this system should be enabled inside the editor.
 

Static Public Member Functions

static SCR_VoiceoverSystem GetInstance ()
 

Protected Member Functions

override void OnStarted ()
 
override void OnStopped ()
 
override void OnUpdate (ESystemPoint point)
 
void OnControllableDestroyed (notnull SCR_InstigatorContextData instigatorContextData)
 Stop the voiceover when the speaker dies.
 
void OnControllableDeleted (IEntity entity)
 Stop the voiceover when the speaker is deleted.
 
void OnActorLifeStateChanged ()
 Stop the voiceover when the speaker becomes unconscious.
 
void AddActorUnconsciousCheck (notnull IEntity actor)
 
void RemoveActorUnconsciousCheck (notnull IEntity actor)
 
void RpcDo_PlaySequence (string dataName, string sequenceName, array< RplId > actorIds, bool playImmediately)
 
void RpcDo_PlaySequenceFor (string dataName, string sequenceName, array< RplId > actorIds, array< int > targetPlayerIds, bool playImmediately)
 
void RpcDo_PlayLine (string dataName, string lineName, RplId actorId, bool playImmediately)
 
void RpcDo_PlayLineFor (string dataName, string lineName, RplId actorId, array< int > targetPlayerIds, bool playImmediately)
 
void PlayFromQueue ()
 
void PlayLineActual (string eventName, string subtitle, IEntity actor=null, string actorName=string.Empty)
 
void OnSoundEventStarted (SCR_CommunicationSoundComponent component, string eventName, AudioHandle handle, int priority)
 
void OnSoundEventFinished (SCR_CommunicationSoundComponent component, string eventName, AudioHandle handle, int priority, bool terminated)
 
void ShowSubtitle (string subtitle, string actorName, string eventName)
 
void FailsafeSubtitleToggle (string eventName)
 
IEntity GetDefaultActor ()
 
void OnFinished (string eventName=string.Empty, bool hideSubtitles=true)
 

Protected Attributes

ResourceName m_sDataResourceName
 
ref ScriptInvokerVoid m_OnFinished
 
ref ScriptInvokerString m_OnFinishedEvent
 
ref SCR_VoiceoverData m_Data
 
ref SCR_VoiceoverSubtitles m_SubtitlesDisplay
 
ref array< ref SCR_VoiceoverLinem_aQueue = {}
 
ref array< IEntity > m_aActors = {}
 
ref array< SCR_CommunicationSoundComponentm_aHandledComponents = {}
 
ref map< SCR_EVoiceoverActor, string > m_mActorNames = new map<SCR_EVoiceoverActor, string>()
 
SCR_CommunicationSoundComponent m_PlayingSoundComponent
 
AudioHandle m_iAudioHandle
 
float m_fTimer
 
string m_sSubtitleEvent
 

Static Protected Attributes

static const float PAUSE_BETWEEN_LINES = 0.5
 
static const int SUBTITLE_VISIBILITY_DISTANCE_SQ = 30 * 30
 
static const int SUBTITLE_FAILSAFE_TOGGLE_DELAY_MS = 15000
 

Constructor & Destructor Documentation

◆ ~SCR_VoiceoverSystem()

void SCR_VoiceoverSystem.~SCR_VoiceoverSystem ( )

Member Function Documentation

◆ AddActorUnconsciousCheck()

void SCR_VoiceoverSystem.AddActorUnconsciousCheck ( notnull IEntity  actor)
protected

◆ ClearActorNames()

void SCR_VoiceoverSystem.ClearActorNames ( )

◆ FailsafeSubtitleToggle()

void SCR_VoiceoverSystem.FailsafeSubtitleToggle ( string  eventName)
protected

◆ GetDefaultActor()

IEntity SCR_VoiceoverSystem.GetDefaultActor ( )
protected

◆ GetInstance()

static SCR_VoiceoverSystem SCR_VoiceoverSystem.GetInstance ( )
static

◆ GetOnFinished()

ScriptInvokerVoid SCR_VoiceoverSystem.GetOnFinished ( )

Triggered when a line or sequence finishes playing.

◆ GetOnFinishedEvent()

ScriptInvokerString SCR_VoiceoverSystem.GetOnFinishedEvent ( )

Triggered when an event finishes playing.

◆ IsPlaying()

bool SCR_VoiceoverSystem.IsPlaying ( )

◆ OnActorLifeStateChanged()

void SCR_VoiceoverSystem.OnActorLifeStateChanged ( )
protected

Stop the voiceover when the speaker becomes unconscious.

◆ OnControllableDeleted()

void SCR_VoiceoverSystem.OnControllableDeleted ( IEntity  entity)
protected

Stop the voiceover when the speaker is deleted.

◆ OnControllableDestroyed()

void SCR_VoiceoverSystem.OnControllableDestroyed ( notnull SCR_InstigatorContextData  instigatorContextData)
protected

Stop the voiceover when the speaker dies.

◆ OnFinished()

void SCR_VoiceoverSystem.OnFinished ( string  eventName = string::Empty,
bool  hideSubtitles = true 
)
protected

◆ OnSoundEventFinished()

void SCR_VoiceoverSystem.OnSoundEventFinished ( SCR_CommunicationSoundComponent  component,
string  eventName,
AudioHandle  handle,
int  priority,
bool  terminated 
)
protected

◆ OnSoundEventStarted()

void SCR_VoiceoverSystem.OnSoundEventStarted ( SCR_CommunicationSoundComponent  component,
string  eventName,
AudioHandle  handle,
int  priority 
)
protected

◆ OnStarted()

override void SCR_VoiceoverSystem.OnStarted ( )
protected

◆ OnStopped()

override void SCR_VoiceoverSystem.OnStopped ( )
protected

◆ OnUpdate()

override void SCR_VoiceoverSystem.OnUpdate ( ESystemPoint  point)
protected

◆ PlayCustomLine()

void SCR_VoiceoverSystem.PlayCustomLine ( string  soundEventName,
string  subtitle,
IEntity  actor = null,
string  actorName = string::Empty,
bool  playImmediately = true 
)

Plays a custom voiceover line.

◆ PlayFromQueue()

void SCR_VoiceoverSystem.PlayFromQueue ( )
protected

◆ PlayLine()

void SCR_VoiceoverSystem.PlayLine ( string  lineName,
IEntity  actor = null,
bool  playImmediately = true 
)

Plays a voiceover line defined in loaded config (see SetData)

◆ PlayLineActual()

void SCR_VoiceoverSystem.PlayLineActual ( string  eventName,
string  subtitle,
IEntity  actor = null,
string  actorName = string::Empty 
)
protected

◆ PlayLineFor()

void SCR_VoiceoverSystem.PlayLineFor ( string  lineName,
notnull IEntity  actor,
notnull array< int >  targetPlayerIds,
bool  playImmediately = true 
)

Same as PlayLineGlobal but plays the VO for clients defined by player IDs.

◆ PlayLineGlobal()

void SCR_VoiceoverSystem.PlayLineGlobal ( string  lineName,
notnull IEntity  actor,
bool  playImmediately = true 
)

Same as PlayLine but plays the VO for all clients. Has to be executed on server.

◆ PlaySequence()

void SCR_VoiceoverSystem.PlaySequence ( string  sequenceName,
IEntity  actor1 = null,
IEntity  actor2 = null,
IEntity  actor3 = null,
IEntity  actor4 = null,
IEntity  actor5 = null,
bool  playImmediately = true 
)

Plays a sequence of voiceover lines defined in loaded config (see SetData)

◆ PlaySequenceActorsArray()

void SCR_VoiceoverSystem.PlaySequenceActorsArray ( string  sequenceName,
notnull array< IEntity >  actors,
bool  playImmediately = true 
)

Same as PlaySequence but accepts an array of actors.

◆ PlaySequenceFor()

void SCR_VoiceoverSystem.PlaySequenceFor ( string  sequenceName,
notnull array< IEntity >  actors,
notnull array< int >  targetPlayerIds,
bool  playImmediately = true 
)

Same as PlaySequenceGlobal but plays the VO for clients defined by player IDs.

◆ PlaySequenceGlobal()

void SCR_VoiceoverSystem.PlaySequenceGlobal ( string  sequenceName,
notnull array< IEntity >  actors,
bool  playImmediately = true 
)

Same as PlaySequence but plays the VO for all clients. Has to be executed on server.

◆ RegisterActor()

void SCR_VoiceoverSystem.RegisterActor ( notnull IEntity  entity)

Registers an actor so subtitles can be shown when a voiceover is not played from the voiceover system (like from animations etc.) Needs to be called before the sound event is played Voiceover data with subtitles still has to be set properly with corresponding sound event.

◆ RemoveActorUnconsciousCheck()

void SCR_VoiceoverSystem.RemoveActorUnconsciousCheck ( notnull IEntity  actor)
protected

◆ RpcDo_PlayLine()

void SCR_VoiceoverSystem.RpcDo_PlayLine ( string  dataName,
string  lineName,
RplId  actorId,
bool  playImmediately 
)
protected

◆ RpcDo_PlayLineFor()

void SCR_VoiceoverSystem.RpcDo_PlayLineFor ( string  dataName,
string  lineName,
RplId  actorId,
array< int >  targetPlayerIds,
bool  playImmediately 
)
protected

◆ RpcDo_PlaySequence()

void SCR_VoiceoverSystem.RpcDo_PlaySequence ( string  dataName,
string  sequenceName,
array< RplId >  actorIds,
bool  playImmediately 
)
protected

◆ RpcDo_PlaySequenceFor()

void SCR_VoiceoverSystem.RpcDo_PlaySequenceFor ( string  dataName,
string  sequenceName,
array< RplId >  actorIds,
array< int >  targetPlayerIds,
bool  playImmediately 
)
protected

◆ SetActorName()

void SCR_VoiceoverSystem.SetActorName ( SCR_EVoiceoverActor  actor,
string  name 
)

Actor name associated with the given enum will be shown in the subtitle.

◆ SetData()

void SCR_VoiceoverSystem.SetData ( ResourceName  config)

Loads voiceover data from the given SCR_VoiceoverData config resource Must be called before PlaySequence or PlayLine which both use data from this config!

◆ ShouldBePaused()

override bool SCR_VoiceoverSystem.ShouldBePaused ( )

Is this system should be paused while the simulation is paused?

Implements GameSystem.

◆ ShowSubtitle()

void SCR_VoiceoverSystem.ShowSubtitle ( string  subtitle,
string  actorName,
string  eventName 
)
protected

◆ Stop()

void SCR_VoiceoverSystem.Stop ( )

Member Data Documentation

◆ m_aActors

ref array<IEntity> SCR_VoiceoverSystem.m_aActors = {}
protected

◆ m_aHandledComponents

ref array<SCR_CommunicationSoundComponent> SCR_VoiceoverSystem.m_aHandledComponents = {}
protected

◆ m_aQueue

ref array<ref SCR_VoiceoverLine> SCR_VoiceoverSystem.m_aQueue = {}
protected

◆ m_Data

ref SCR_VoiceoverData SCR_VoiceoverSystem.m_Data
protected

◆ m_fTimer

float SCR_VoiceoverSystem.m_fTimer
protected

◆ m_iAudioHandle

AudioHandle SCR_VoiceoverSystem.m_iAudioHandle
protected

◆ m_mActorNames

ref map<SCR_EVoiceoverActor, string> SCR_VoiceoverSystem.m_mActorNames = new map<SCR_EVoiceoverActor, string>()
protected

◆ m_OnFinished

ref ScriptInvokerVoid SCR_VoiceoverSystem.m_OnFinished
protected

◆ m_OnFinishedEvent

ref ScriptInvokerString SCR_VoiceoverSystem.m_OnFinishedEvent
protected

◆ m_PlayingSoundComponent

SCR_CommunicationSoundComponent SCR_VoiceoverSystem.m_PlayingSoundComponent
protected

◆ m_sDataResourceName

ResourceName SCR_VoiceoverSystem.m_sDataResourceName
protected

◆ m_sSubtitleEvent

string SCR_VoiceoverSystem.m_sSubtitleEvent
protected

◆ m_SubtitlesDisplay

ref SCR_VoiceoverSubtitles SCR_VoiceoverSystem.m_SubtitlesDisplay
protected

◆ PAUSE_BETWEEN_LINES

const float SCR_VoiceoverSystem.PAUSE_BETWEEN_LINES = 0.5
staticprotected

◆ SUBTITLE_FAILSAFE_TOGGLE_DELAY_MS

const int SCR_VoiceoverSystem.SUBTITLE_FAILSAFE_TOGGLE_DELAY_MS = 15000
staticprotected

◆ SUBTITLE_VISIBILITY_DISTANCE_SQ

const int SCR_VoiceoverSystem.SUBTITLE_VISIBILITY_DISTANCE_SQ = 30 * 30
staticprotected

The documentation for this interface was generated from the following file: