4 [
Attribute(
desc:
"Config with voice over data for this action.",
params:
"conf class=SCR_VoiceoverData")]
7 [
Attribute(
desc:
"Name of the line as defined in Voice Over Data Config")]
10 [
Attribute(
desc:
"Entity playing the voiceover. Order must be the same as the order of actor enums in Voice Over Data Config. Reminder: Related .acp needs to be present in the SCR_CommunicationSoundComponent of target entity.")]
13 [
Attribute(
desc:
"Player entity or entities that the voice over will be played for. Reminder: Related .acp needs to be present in the SCR_CommunicationSoundComponent of target entity.")]
16 [
Attribute(defvalue:
"1",
desc:
"If Voice Line should play right now or wait for the current voice lines to finish and then play it")]
17 bool m_bPlayImmediately;
19 [
Attribute(
desc:
"Allow VO Playing In Gameover and when game is stopped")]
20 bool m_bAllowPlayingInGameOver;
22 [
Attribute(
desc:
"Actions that will be triggered once Sequence finishes playing")]
23 ref array<ref SCR_ScenarioFrameworkActionBase> m_aActions;
28 if (!m_sVoiceOverDataConfig || m_sVoiceOverDataConfig.IsEmpty())
31 if (!scenarioFrameworkSystem)
34 m_sVoiceOverDataConfig = scenarioFrameworkSystem.m_sVoiceOverDataConfig;
36 if (!m_sVoiceOverDataConfig || m_sVoiceOverDataConfig.IsEmpty())
44 if (!gamemode || (!m_bAllowPlayingInGameOver && !gamemode.
IsRunning()))
52 array<IEntity> entities = {};
55 SCR_ScenarioFrameworkParam<array<IEntity>> entityArrayWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_PlayerGetter.Get());
56 if (entityArrayWrapper)
58 entities = entityArrayWrapper.GetValue();
59 if (!entities || entities.IsEmpty())
64 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_PlayerGetter.Get());
68 Print(
string.Format(
"ScenarioFramework Action: Issue with Getter detected for Action %1 attached on %2.",
this,
object.
GetName()),
LogLevel.ERROR);
70 Print(
string.Format(
"ScenarioFramework Action: Issue with Getter detected for Action %1.",
this),
LogLevel.ERROR);
75 IEntity playerEntity = entityWrapper.GetValue();
77 entities.Insert(playerEntity);
81 if (!ValidateInputEntity(
object, m_ActorGetter, entity))
84 array<int> playerIDs = {};
85 foreach(
IEntity possiblePlayerEntity : entities)
88 playerIDs.Insert(playerManager.GetPlayerIdFromControlledEntity(possiblePlayerEntity))
95 voiceoverSystem.
SetData(m_sVoiceOverDataConfig);
100 voiceoverSystem.
PlayLine(m_sLineName, entity, m_bPlayImmediately);
105 PrintFormat(
"ScenarioFramework Action %1 detected %2 without RplComponent thus VO won't work!",
object, entity);
107 voiceoverSystem.
PlayLineFor(m_sLineName, entity, playerIDs, m_bPlayImmediately);
120 actions.OnActivate(m_Entity);
125 override array<ref SCR_ScenarioFrameworkActionBase> GetSubActions()
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.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)