Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SoundCinematicTrack.c
Go to the documentation of this file.
1
[
CinematicTrackAttribute
(name:
"Sound Track"
, description:
"Track used for triggering sound"
)]
2
class
SCR_SoundCinematicTrack
:
SCR_CinematicTrackBase
3
{
4
[
Attribute
(
""
)]
5
protected
string
m_sResourceName
;
6
7
[
Attribute
(
""
)]
8
protected
string
m_sSoundEvent
;
9
10
[
Attribute
(
""
)]
11
protected
string
m_sEntityName
;
12
13
[
Attribute
(
""
)]
14
protected
string
m_sBoneName
;
15
16
[
Attribute
(
""
)]
17
protected
vector
m_vOffset
;
18
19
[
Attribute
(
""
)]
20
protected
string
m_sSignalName1
;
21
22
[
Attribute
(
""
)]
23
protected
float
m_fSignalValue1
;
24
25
[
Attribute
(
""
)]
26
protected
string
m_sSignalName2
;
27
28
[
Attribute
(
""
)]
29
protected
float
m_fSignalValue2
;
30
31
[
Attribute
(
""
)]
32
protected
string
m_sSignalName3
;
33
34
[
Attribute
(
""
)]
35
protected
float
m_fSignalValue3
;
36
37
[
Attribute
(
""
)]
38
protected
string
m_sSignalName4
;
39
40
[
Attribute
(
""
)]
41
protected
float
m_fSignalValue4
;
42
43
[
Attribute
()]
44
protected
bool
m_bUpdatePosition
;
45
46
[
Attribute
(
desc
:
"Passes GRoomSize variable to RoomSize signal"
)]
47
protected
bool
m_bSetRoomSize
;
48
49
[
Attribute
(
desc
:
"Passes GInterior variable to Interior signal"
)]
50
protected
bool
m_bSetInterior
;
51
52
AudioHandle
m_AudioHandle
=
AudioHandle
.Invalid;
53
54
override
void
OnApply
(
float
time)
55
{
56
if
(
m_AudioHandle
==
AudioHandle
.Invalid)
57
{
58
return
;
59
}
60
61
if
(
AudioSystem
.IsSoundPlayed(
m_AudioHandle
))
62
{
63
m_AudioHandle
=
AudioHandle
.Invalid;
64
}
65
66
if
(
m_bUpdatePosition
)
67
{
68
vector
mat[4];
69
GetTransformation
(mat);
70
71
AudioSystem
.SetSoundTransformation(
m_AudioHandle
, mat);
72
}
73
}
74
75
[
CinematicEventAttribute
()]
76
void
PlayEvent
()
77
{
78
if
(
m_sResourceName
.IsEmpty() ||
m_sSoundEvent
.IsEmpty())
79
{
80
return
;
81
}
82
83
array<string> signalNames = {};
84
array<float> signalValues = {};
85
86
87
// Handle signals
88
if
(!
m_sSignalName1
.IsEmpty())
89
{
90
signalNames.Insert(
m_sSignalName1
);
91
signalValues.Insert(
m_fSignalValue1
);
92
}
93
94
if
(!
m_sSignalName2
.IsEmpty())
95
{
96
signalNames.Insert(
m_sSignalName2
);
97
signalValues.Insert(
m_fSignalValue2
);
98
}
99
100
if
(!
m_sSignalName3
.IsEmpty())
101
{
102
signalNames.Insert(
m_sSignalName3
);
103
signalValues.Insert(
m_fSignalValue3
);
104
}
105
106
if
(!
m_sSignalName4
.IsEmpty())
107
{
108
signalNames.Insert(
m_sSignalName4
);
109
signalValues.Insert(
m_fSignalValue4
);
110
}
111
112
if
(
m_bSetRoomSize
)
113
{
114
const
float
gRoomSize =
AudioSystem
.GetVariableValue(
"GRoomSize"
,
"{A60F08955792B575}Sounds/_SharedData/Variables/GlobalVariables.conf"
);
115
signalNames.Insert(
"RoomSize"
);
116
signalValues.Insert(gRoomSize);
117
}
118
119
if
(
m_bSetInterior
)
120
{
121
const
float
gInterior =
AudioSystem
.GetVariableValue(
"GInterior"
,
"{A60F08955792B575}Sounds/_SharedData/Variables/GlobalVariables.conf"
);
122
signalNames.Insert(
"Interior"
);
123
signalValues.Insert(gInterior);
124
}
125
126
// Handle offset
127
vector
mat[4];
128
GetTransformation
(mat);
129
130
// Play sound
131
m_AudioHandle
=
AudioSystem
.PlayEvent(
m_sResourceName
,
m_sSoundEvent
, mat, signalNames, signalValues);
132
}
133
134
[
CinematicEventAttribute
()]
135
void
TerminateEvent
()
136
{
137
AudioSystem
.TerminateSound(
m_AudioHandle
);
138
}
139
140
void
GetTransformation
(out
vector
mat[4])
141
{
142
IEntity
owner;
143
144
if
(
m_sEntityName
.IsEmpty())
145
{
146
Math3D
.MatrixIdentity4(mat);
147
mat[3] =
m_vOffset
;
148
}
149
else
150
{
151
owner =
FindOwner
(
m_sEntityName
);
152
if
(owner)
153
{
154
if
(!
m_sBoneName
.IsEmpty())
155
{
156
Animation
animation = owner.
GetAnimation
();
157
if
(!animation)
158
{
159
owner.
GetTransform
(mat);
160
return
;
161
}
162
163
TNodeId
boneIndex = animation.GetBoneIndex(
m_sBoneName
);
164
animation.GetBoneMatrix(boneIndex, mat);
165
mat[3] = owner.
CoordToParent
(mat[3]);
166
}
167
else
168
{
169
owner.
GetTransform
(mat);
170
171
if
(
m_vOffset
!=
vector
.Zero)
172
{
173
mat[3] = owner.
CoordToParent
(
m_vOffset
);
174
}
175
}
176
}
177
else
178
{
179
Math3D
.MatrixIdentity4(mat);
180
mat[3] =
m_vOffset
;
181
}
182
}
183
}
184
}
CinematicEventAttribute
void CinematicEventAttribute(string name="")
Definition
attributes.c:18
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
Animation
Definition
Animation.c:13
AudioHandle
Definition
EnAudio.c:9
AudioSystem
Definition
AudioSystem.c:13
CinematicTrackAttribute
Definition
attributes.c:3
IEntity
Definition
IEntity.c:13
IEntity::GetAnimation
proto external Animation GetAnimation()
IEntity::GetTransform
proto external void GetTransform(out vector mat[])
IEntity::CoordToParent
proto external vector CoordToParent(vector coord)
Math3D
Definition
Math3D.c:13
SCR_CinematicTrackBase
Definition
SCR_CinematicTrackBase.c:3
SCR_CinematicTrackBase::FindOwner
IEntity FindOwner()
Definition
SCR_CinematicTrackBase.c:12
SCR_SoundCinematicTrack
Definition
SCR_SoundCinematicTrack.c:3
SCR_SoundCinematicTrack::m_bUpdatePosition
bool m_bUpdatePosition
Definition
SCR_SoundCinematicTrack.c:44
SCR_SoundCinematicTrack::m_fSignalValue1
float m_fSignalValue1
Definition
SCR_SoundCinematicTrack.c:23
SCR_SoundCinematicTrack::m_sSignalName2
string m_sSignalName2
Definition
SCR_SoundCinematicTrack.c:26
SCR_SoundCinematicTrack::m_sEntityName
string m_sEntityName
Definition
SCR_SoundCinematicTrack.c:11
SCR_SoundCinematicTrack::m_sSignalName4
string m_sSignalName4
Definition
SCR_SoundCinematicTrack.c:38
SCR_SoundCinematicTrack::OnApply
override void OnApply(float time)
Definition
SCR_SoundCinematicTrack.c:54
SCR_SoundCinematicTrack::m_fSignalValue4
float m_fSignalValue4
Definition
SCR_SoundCinematicTrack.c:41
SCR_SoundCinematicTrack::TerminateEvent
void TerminateEvent()
Definition
SCR_SoundCinematicTrack.c:135
SCR_SoundCinematicTrack::m_bSetInterior
bool m_bSetInterior
Definition
SCR_SoundCinematicTrack.c:50
SCR_SoundCinematicTrack::m_sBoneName
string m_sBoneName
Definition
SCR_SoundCinematicTrack.c:14
SCR_SoundCinematicTrack::m_bSetRoomSize
bool m_bSetRoomSize
Definition
SCR_SoundCinematicTrack.c:47
SCR_SoundCinematicTrack::GetTransformation
void GetTransformation(out vector mat[4])
Definition
SCR_SoundCinematicTrack.c:140
SCR_SoundCinematicTrack::m_sSignalName3
string m_sSignalName3
Definition
SCR_SoundCinematicTrack.c:32
SCR_SoundCinematicTrack::m_fSignalValue3
float m_fSignalValue3
Definition
SCR_SoundCinematicTrack.c:35
SCR_SoundCinematicTrack::m_fSignalValue2
float m_fSignalValue2
Definition
SCR_SoundCinematicTrack.c:29
SCR_SoundCinematicTrack::PlayEvent
void PlayEvent()
Definition
SCR_SoundCinematicTrack.c:76
SCR_SoundCinematicTrack::m_AudioHandle
AudioHandle m_AudioHandle
Definition
SCR_SoundCinematicTrack.c:52
SCR_SoundCinematicTrack::m_sSoundEvent
string m_sSoundEvent
Definition
SCR_SoundCinematicTrack.c:8
SCR_SoundCinematicTrack::m_vOffset
vector m_vOffset
Definition
SCR_SoundCinematicTrack.c:17
SCR_SoundCinematicTrack::m_sResourceName
string m_sResourceName
Definition
SCR_SoundCinematicTrack.c:5
SCR_SoundCinematicTrack::m_sSignalName1
string m_sSignalName1
Definition
SCR_SoundCinematicTrack.c:20
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TNodeId
int TNodeId
Node global id is a hash of name of the node.
Definition
EnEntity.c:18
scripts
Game
Cinematics
SCR_SoundCinematicTrack.c
Generated by
1.17.0