-
Notifications
You must be signed in to change notification settings - Fork 1
/
ME5_SoundEvent_ctf.lua
38 lines (32 loc) · 1.61 KB
/
ME5_SoundEvent_ctf.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- attacker refers to 'us' or 'our' objects
-- defender refers to 'them' or 'their' objects
---------------------------------------------------------------------------
-- FUNCTION: SoundEvent_SetupTeams
-- PURPOSE: instruct the system which team is attacking and which is defending
-- INPUT: indices (num) (usually 1 or 2)
-- names (string) three letter abbreviation of the side: 'imp', 'all', 'rep', 'cis'
-- OUTPUT: none
-- NOTES: this must be set up before the game starts!
-- This is really retarded. The sound cues are listed at the bottom of
-- ObjectiveOneFlagCTF.lua and ObjectiveCTF.lua
-- For some reason, we can't have aliases for the cues, so the mission scripts
-- must identify the teams involved in order to play the sounds correctly
---------------------------------------------------------------------------
function SoundEvent_SetupTeams( attIndex, attName, defIndex, defName )
gSoundEventsCTF = {}
gSoundEventsCTF[ attIndex ] = gSoundEventsCTF_src[ attName ]
gSoundEventsCTF[ defIndex ] = gSoundEventsCTF_src[ defName ]
gSoundEventsCTF_src = nil
end
function SoundEvent_BroadcastVO( aEvent, attIndex, defIndex )
-- safety checking
if not gSoundEventsCTF then return end
if attIndex < 1 or attIndex > 2 then return end
if defIndex < 1 or defIndex > 2 then return end
local attCue = (gSoundEventsCTF[ attIndex ])[ aEvent .. "_att" ]
local defCue = (gSoundEventsCTF[ defIndex ])[ aEvent .. "_def" ]
BroadcastVoiceOver( attCue, attIndex )
BroadcastVoiceOver( defCue, defIndex )
--ScriptCB_SndPlaySound( attCue )
--ScriptCB_SndPlaySound( defCue )
end