Location of objective complete sound? [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Location of objective complete sound? [Solved]

Post by Noobasaurus »

I'm looking for the line of code that makes the sound when an objective is complete.

I've looked through the stock scripts but I haven't found anything that works.

Thanks.
Last edited by Noobasaurus on Sat Jul 12, 2014 10:02 pm, edited 1 time in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Location of objective complete sound?

Post by Marth8880 »

From Objective.lua:

Code: Select all

	--play a little ditty
	if not self.multiplayerRules then
		BroadcastVoiceOver("common_objComplete", self.winningTeam)
	end
The entire function:
Hidden/Spoiler:
[code]function Objective:Complete(winningTeam)
if self.isComplete then return end

--unhide the CPs
MapHideCommandPosts(false)

self.isComplete = true
self.winningTeam = winningTeam

if self.loseTimer then
ShowTimer(nil)
DestroyTimer(self.loseTimer)
self.loseTimer = nil
end

--clean up all the AIGoals for this objective
if self.AIGoals then
for i, goalPtr in ipairs(self.AIGoals) do
DeleteAIGoal(goalPtr)
end
end

--play a little ditty
if not self.multiplayerRules then
BroadcastVoiceOver("common_objComplete", self.winningTeam)
end

--delay the actual objective end by a smidge to allow time for the ditty to finish playing
--(since the designers tend to call other voiceovers from OnComplete)
self.dittyTimer = FindTimer("dittyTimer")
if not self.dittyTimer then
self.dittyTimer = CreateTimer("dittyTimer")
end
SetTimerValue(self.dittyTimer, 1.0)
StartTimer(self.dittyTimer)
self.dittyTimerResponse = OnTimerElapse(
function(timer)
--update the objective's state in the c++ code
if self.text then
CompleteObjective(self.text)
else
if self.textATT then
CompleteObjective(self.textATT)
end

if self.textDEF then
CompleteObjective(self.textDEF)
end
end

if self.container then
self.container:NotifyObjectiveComplete(self)
else
MissionVictory(winningTeam)
end

self:OnComplete(winningTeam)

StopTimer(self.dittyTimer)

print("release self.dittyTimerResponse")
ReleaseTimerElapse(self.dittyTimerResponse)
self.dittyTimerResponse = nil
end,
self.dittyTimer
)
end[/code]
Basically, it's supposed to play automatically upon Objective:Complete, but you should be able to call it regardless with this:

Code: Select all

BroadcastVoiceOver("common_objComplete")
Also, in case you're wondering or if it's helpful in any way, it's a sound stream.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Location of objective complete sound?

Post by Noobasaurus »

Thank you. I added it, however, and it doesn't play a sound. No errors.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Location of objective complete sound?

Post by Marth8880 »

Hmm. Could you please post the sound section of your LUA? (The section in ScriptInit().)
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Location of objective complete sound?

Post by Noobasaurus »

So it's currently played in a few different places.
Hidden/Spoiler:
[code]
checker = OnCharacterDeath(function(character, killer)
if GetNumTeamMembersAlive(2) == 0 then
if x == 1 then
inChallenge = false
player = GetCharacterUnit(killer)
SetEntityMatrix(player, hub)
ShowMessageText("level.BBX.complete")
BroadcastVoiceOver("common_objComplete", 1)
end
x = x + 1
checker = nil
end
if GetNumTeamMembersAlive(1) == 0 then
SetProperty(boss1, "CurHealth", 0)
SetProperty(boss2, "CurHealth", 0)
SetProperty(boss3, "CurHealth", 0)
SetProperty(boss4, "CurHealth", 0)
SetProperty(boss5, "CurHealth", 0)
end
end)[/code]
[code]
disk1p = OnEnterRegion(
function(region, character)
KillObject("disk1")
numdisks = numdisks + 1
ShowMessageText("level.BBX.item")
BroadcastVoiceOver("common_objComplete", 1)
if numdisks == 10 then
player = GetCharacterUnit(character)
SetEntityMatrix(character, hub)
ShowMessageText("level.BBX.complete")
InChallenge = false
end
DeactivateRegion("disk1r")
end,
"disk1r"
)
disk2p = OnEnterRegion(
function(region, character)
KillObject("disk2")
numdisks = numdisks + 1
ShowMessageText("level.BBX.item")
BroadcastVoiceOver("common_objComplete", 1)
if numdisks == 10 then
player = GetCharacterUnit(character)
SetEntityMatrix(character, hub)
ShowMessageText("level.BBX.complete")
InChallenge = false
end
DeactivateRegion("disk2r")
end,
"disk2r"
)
disk3p = OnEnterRegion(
function(region, character)
KillObject("disk3")
numdisks = numdisks + 1
ShowMessageText("level.BBX.item")
BroadcastVoiceOver("common_objComplete", 1)
if numdisks == 10 then
player = GetCharacterUnit(character)
SetEntityMatrix(character, hub)
ShowMessageText("level.BBX.complete")
InChallenge = false
end
DeactivateRegion("disk3r")
end,
"disk3r"
)
...and more[/code]
I did also try it without the 1 in case you were wondering.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Location of objective complete sound?

Post by Marth8880 »

Noooo, I meant the section with all of the OpenAudioStream lines. :lol:
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Location of objective complete sound?

Post by Noobasaurus »

OH. I'm supposed to load it there? OH.

Got it, thanks.
Post Reply