Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VoiceoverSystem Class Reference
Inheritance diagram for SCR_VoiceoverSystem:
GameSystem

Protected Member Functions

void OnStarted ()
void OnStopped ()
void OnUpdatePoint (WorldUpdatePointArgs args)
override event bool ShouldBePaused ()
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.
ScriptInvokerVoid GetOnFinished ()
 Triggered when a line or sequence finishes playing.
ScriptInvokerString GetOnFinishedEvent ()
 Triggered when an event finishes playing.
void SetData (ResourceName 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 AddActorUnconsciousCheck (notnull IEntity actor)
void RemoveActorUnconsciousCheck (notnull IEntity actor)
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 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 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 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 PlayCustomLine (string soundEventName, string subtitle, IEntity actor=null, string actorName=string.Empty, bool playImmediately=true)
 Plays a custom voiceover line.
void Stop ()
void CallAnimCommand (IEntity actor, int commandParam)
void RegisterActor (notnull IEntity entity)
void PlayFromQueue (bool start=false)
void PlayLineActual (string eventName, string subtitle, IEntity actor=null, string actorName=string.Empty, int animCommandParam=0, bool interruptCurrentLine=1, int finishAnimCommandParam=-1)
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)
SCR_VoiceoverSystemSnapshot CreateSnapshot ()
void ApplySnapshot (notnull SCR_VoiceoverSystemSnapshot snapshot)
void ~SCR_VoiceoverSystem ()

Static Protected Member Functions

static SCR_VoiceoverSystem GetInstance ()

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< IEntitym_aActors = {}
ref array< SCR_CommunicationSoundComponentm_aHandledComponents = {}
ref map< SCR_EVoiceoverActor, stringm_mActorNames = new map<SCR_EVoiceoverActor, string>()
SCR_CommunicationSoundComponent m_PlayingSoundComponent
AudioHandle m_iAudioHandle
bool m_bSubtitlesHandled = true
int m_iCurrentEndCommand = 0
float m_fTimer
float m_fCustomPause = -1
string m_sCurrentSequence
string m_sCurrentSoundEvent
string m_sCurrentSubtitleEvent
string m_sCurrentActorName
string m_sCurrentSubtitle
IEntity m_CurrentActor

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
static const string DEFAULT_ANIM_COMMAND = "CMD_Gesture_NPC"
static const string DEFAULT_ANIM_VARIABLE = "speech"

Detailed Description

Definition at line 2 of file SCR_VoiceoverSystem.c.

Constructor & Destructor Documentation

◆ ~SCR_VoiceoverSystem()

void SCR_VoiceoverSystem::~SCR_VoiceoverSystem ( )
inlineprotected

Definition at line 809 of file SCR_VoiceoverSystem.c.

Member Function Documentation

◆ AddActorUnconsciousCheck()

void SCR_VoiceoverSystem::AddActorUnconsciousCheck ( notnull IEntity actor)
inlineprotected

Definition at line 273 of file SCR_VoiceoverSystem.c.

◆ ApplySnapshot()

void SCR_VoiceoverSystem::ApplySnapshot ( notnull SCR_VoiceoverSystemSnapshot snapshot)
inlineprotected

Definition at line 787 of file SCR_VoiceoverSystem.c.

◆ CallAnimCommand()

void SCR_VoiceoverSystem::CallAnimCommand ( IEntity actor,
int commandParam )
inlineprotected

Definition at line 533 of file SCR_VoiceoverSystem.c.

◆ ClearActorNames()

void SCR_VoiceoverSystem::ClearActorNames ( )
inlineprotected

Definition at line 267 of file SCR_VoiceoverSystem.c.

◆ CreateSnapshot()

SCR_VoiceoverSystemSnapshot SCR_VoiceoverSystem::CreateSnapshot ( )
inlineprotected

Definition at line 765 of file SCR_VoiceoverSystem.c.

◆ FailsafeSubtitleToggle()

void SCR_VoiceoverSystem::FailsafeSubtitleToggle ( string eventName)
inlineprotected

Definition at line 724 of file SCR_VoiceoverSystem.c.

◆ GetDefaultActor()

IEntity SCR_VoiceoverSystem::GetDefaultActor ( )
inlineprotected

Definition at line 733 of file SCR_VoiceoverSystem.c.

◆ GetInstance()

SCR_VoiceoverSystem SCR_VoiceoverSystem::GetInstance ( )
inlinestaticprotected

Definition at line 159 of file SCR_VoiceoverSystem.c.

◆ GetOnFinished()

ScriptInvokerVoid SCR_VoiceoverSystem::GetOnFinished ( )
inlineprotected

Triggered when a line or sequence finishes playing.

Definition at line 221 of file SCR_VoiceoverSystem.c.

◆ GetOnFinishedEvent()

ScriptInvokerString SCR_VoiceoverSystem::GetOnFinishedEvent ( )
inlineprotected

Triggered when an event finishes playing.

Definition at line 231 of file SCR_VoiceoverSystem.c.

◆ IsPlaying()

bool SCR_VoiceoverSystem::IsPlaying ( )
inlineprotected

Definition at line 254 of file SCR_VoiceoverSystem.c.

◆ OnActorLifeStateChanged()

void SCR_VoiceoverSystem::OnActorLifeStateChanged ( )
inlineprotected

Stop the voiceover when the speaker becomes unconscious.

Definition at line 206 of file SCR_VoiceoverSystem.c.

◆ OnControllableDeleted()

void SCR_VoiceoverSystem::OnControllableDeleted ( IEntity entity)
inlineprotected

Stop the voiceover when the speaker is deleted.

Definition at line 191 of file SCR_VoiceoverSystem.c.

◆ OnControllableDestroyed()

void SCR_VoiceoverSystem::OnControllableDestroyed ( notnull SCR_InstigatorContextData instigatorContextData)
inlineprotected

Stop the voiceover when the speaker dies.

Definition at line 171 of file SCR_VoiceoverSystem.c.

◆ OnFinished()

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

Definition at line 744 of file SCR_VoiceoverSystem.c.

◆ OnSoundEventFinished()

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

Definition at line 682 of file SCR_VoiceoverSystem.c.

◆ OnSoundEventStarted()

void SCR_VoiceoverSystem::OnSoundEventStarted ( SCR_CommunicationSoundComponent component,
string eventName,
AudioHandle handle,
int priority )
inlineprotected

Definition at line 650 of file SCR_VoiceoverSystem.c.

◆ OnStarted()

void SCR_VoiceoverSystem::OnStarted ( )
inlineprotected

Definition at line 54 of file SCR_VoiceoverSystem.c.

◆ OnStopped()

void SCR_VoiceoverSystem::OnStopped ( )
inlineprotected

Definition at line 71 of file SCR_VoiceoverSystem.c.

◆ OnUpdatePoint()

void SCR_VoiceoverSystem::OnUpdatePoint ( WorldUpdatePointArgs args)
inlineprotected

Definition at line 87 of file SCR_VoiceoverSystem.c.

◆ PlayCustomLine()

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

Plays a custom voiceover line.

Definition at line 512 of file SCR_VoiceoverSystem.c.

◆ PlayFromQueue()

void SCR_VoiceoverSystem::PlayFromQueue ( bool start = false)
inlineprotected

Definition at line 569 of file SCR_VoiceoverSystem.c.

◆ PlayLine()

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

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

Definition at line 428 of file SCR_VoiceoverSystem.c.

◆ PlayLineActual()

void SCR_VoiceoverSystem::PlayLineActual ( string eventName,
string subtitle,
IEntity actor = null,
string actorName = string.Empty,
int animCommandParam = 0,
bool interruptCurrentLine = 1,
int finishAnimCommandParam = -1 )
inlineprotected

Definition at line 602 of file SCR_VoiceoverSystem.c.

◆ PlayLineFor()

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

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

Definition at line 473 of file SCR_VoiceoverSystem.c.

◆ PlayLineGlobal()

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

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

Definition at line 462 of file SCR_VoiceoverSystem.c.

◆ 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 )
inlineprotected

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

Definition at line 300 of file SCR_VoiceoverSystem.c.

◆ PlaySequenceActorsArray()

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

Same as PlaySequence but accepts an array of actors.

Definition at line 325 of file SCR_VoiceoverSystem.c.

◆ PlaySequenceFor()

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

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

Definition at line 368 of file SCR_VoiceoverSystem.c.

◆ PlaySequenceGlobal()

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

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

Definition at line 350 of file SCR_VoiceoverSystem.c.

◆ RegisterActor()

void SCR_VoiceoverSystem::RegisterActor ( notnull IEntity entity)
inlineprotected

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

Definition at line 556 of file SCR_VoiceoverSystem.c.

◆ RemoveActorUnconsciousCheck()

void SCR_VoiceoverSystem::RemoveActorUnconsciousCheck ( notnull IEntity actor)
inlineprotected

Definition at line 285 of file SCR_VoiceoverSystem.c.

◆ RpcDo_PlayLine()

void SCR_VoiceoverSystem::RpcDo_PlayLine ( string dataName,
string lineName,
RplId actorId,
bool playImmediately )
inlineprotected

Definition at line 486 of file SCR_VoiceoverSystem.c.

◆ RpcDo_PlayLineFor()

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

Definition at line 496 of file SCR_VoiceoverSystem.c.

◆ RpcDo_PlaySequence()

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

Definition at line 388 of file SCR_VoiceoverSystem.c.

◆ RpcDo_PlaySequenceFor()

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

Definition at line 405 of file SCR_VoiceoverSystem.c.

◆ SetActorName()

void SCR_VoiceoverSystem::SetActorName ( SCR_EVoiceoverActor actor,
string name )
inlineprotected

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

Definition at line 261 of file SCR_VoiceoverSystem.c.

◆ SetData()

void SCR_VoiceoverSystem::SetData ( ResourceName config)
inlineprotected

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

Definition at line 242 of file SCR_VoiceoverSystem.c.

◆ ShouldBePaused()

override event bool SCR_VoiceoverSystem::ShouldBePaused ( )
inlineprotected

Definition at line 153 of file SCR_VoiceoverSystem.c.

◆ ShowSubtitle()

void SCR_VoiceoverSystem::ShowSubtitle ( string subtitle,
string actorName,
string eventName )
inlineprotected

Definition at line 695 of file SCR_VoiceoverSystem.c.

◆ Stop()

void SCR_VoiceoverSystem::Stop ( )
inlineprotected

Definition at line 524 of file SCR_VoiceoverSystem.c.

Member Data Documentation

◆ DEFAULT_ANIM_COMMAND

const string SCR_VoiceoverSystem::DEFAULT_ANIM_COMMAND = "CMD_Gesture_NPC"
staticprotected

Definition at line 50 of file SCR_VoiceoverSystem.c.

◆ DEFAULT_ANIM_VARIABLE

const string SCR_VoiceoverSystem::DEFAULT_ANIM_VARIABLE = "speech"
staticprotected

Definition at line 51 of file SCR_VoiceoverSystem.c.

◆ m_aActors

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

Definition at line 21 of file SCR_VoiceoverSystem.c.

◆ m_aHandledComponents

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

Definition at line 22 of file SCR_VoiceoverSystem.c.

◆ m_aQueue

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

Definition at line 20 of file SCR_VoiceoverSystem.c.

◆ m_bSubtitlesHandled

bool SCR_VoiceoverSystem::m_bSubtitlesHandled = true
protected

Definition at line 30 of file SCR_VoiceoverSystem.c.

◆ m_CurrentActor

IEntity SCR_VoiceoverSystem::m_CurrentActor
protected

Definition at line 43 of file SCR_VoiceoverSystem.c.

◆ m_Data

ref SCR_VoiceoverData SCR_VoiceoverSystem::m_Data
protected

Definition at line 16 of file SCR_VoiceoverSystem.c.

◆ m_fCustomPause

float SCR_VoiceoverSystem::m_fCustomPause = -1
protected

Definition at line 35 of file SCR_VoiceoverSystem.c.

◆ m_fTimer

float SCR_VoiceoverSystem::m_fTimer
protected

Definition at line 34 of file SCR_VoiceoverSystem.c.

◆ m_iAudioHandle

AudioHandle SCR_VoiceoverSystem::m_iAudioHandle
protected

Definition at line 28 of file SCR_VoiceoverSystem.c.

◆ m_iCurrentEndCommand

int SCR_VoiceoverSystem::m_iCurrentEndCommand = 0
protected

Definition at line 32 of file SCR_VoiceoverSystem.c.

◆ m_mActorNames

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

Definition at line 24 of file SCR_VoiceoverSystem.c.

◆ m_OnFinished

ref ScriptInvokerVoid SCR_VoiceoverSystem::m_OnFinished
protected

Definition at line 13 of file SCR_VoiceoverSystem.c.

◆ m_OnFinishedEvent

ref ScriptInvokerString SCR_VoiceoverSystem::m_OnFinishedEvent
protected

Definition at line 14 of file SCR_VoiceoverSystem.c.

◆ m_PlayingSoundComponent

SCR_CommunicationSoundComponent SCR_VoiceoverSystem::m_PlayingSoundComponent
protected

Definition at line 26 of file SCR_VoiceoverSystem.c.

◆ m_sCurrentActorName

string SCR_VoiceoverSystem::m_sCurrentActorName
protected

Definition at line 40 of file SCR_VoiceoverSystem.c.

◆ m_sCurrentSequence

string SCR_VoiceoverSystem::m_sCurrentSequence
protected

Definition at line 37 of file SCR_VoiceoverSystem.c.

◆ m_sCurrentSoundEvent

string SCR_VoiceoverSystem::m_sCurrentSoundEvent
protected

Definition at line 38 of file SCR_VoiceoverSystem.c.

◆ m_sCurrentSubtitle

string SCR_VoiceoverSystem::m_sCurrentSubtitle
protected

Definition at line 41 of file SCR_VoiceoverSystem.c.

◆ m_sCurrentSubtitleEvent

string SCR_VoiceoverSystem::m_sCurrentSubtitleEvent
protected

Definition at line 39 of file SCR_VoiceoverSystem.c.

◆ m_sDataResourceName

ResourceName SCR_VoiceoverSystem::m_sDataResourceName
protected

Definition at line 11 of file SCR_VoiceoverSystem.c.

◆ m_SubtitlesDisplay

ref SCR_VoiceoverSubtitles SCR_VoiceoverSystem::m_SubtitlesDisplay
protected

Definition at line 18 of file SCR_VoiceoverSystem.c.

◆ PAUSE_BETWEEN_LINES

const float SCR_VoiceoverSystem::PAUSE_BETWEEN_LINES = 0.5
staticprotected

Definition at line 45 of file SCR_VoiceoverSystem.c.

◆ SUBTITLE_FAILSAFE_TOGGLE_DELAY_MS

const int SCR_VoiceoverSystem::SUBTITLE_FAILSAFE_TOGGLE_DELAY_MS = 15000
staticprotected

Definition at line 48 of file SCR_VoiceoverSystem.c.

◆ SUBTITLE_VISIBILITY_DISTANCE_SQ

const int SCR_VoiceoverSystem::SUBTITLE_VISIBILITY_DISTANCE_SQ = 30 * 30
staticprotected

Definition at line 47 of file SCR_VoiceoverSystem.c.


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