Page 1 of 1

Custom Voiceovers

Posted: Sat Feb 13, 2010 11:24 am
by KnightsFan
I'm trying to get a sound to play in my map when an objective is completed, and I'm failing miserably. I got those three fixed files and placed them exactly where they should go. Probably there's some really simple error somewhere...

My sound is in the right format (it works as a weapon fire sound), called "command_formup.wav"

cw_new.snd (All but the last are effects that work. The last is my voiceover.)
Hidden/Spoiler:
SoundProperties()
{
Name("dc17m_blaster_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("dc17m_rifle_fire", 1.0);
}
}

SoundProperties()
{
Name("dc17pistol_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("dc17pistol_fire", 1.0);
}
}

SoundProperties()
{
Name("dc15rifle_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("dc15rifle_fire", 1.0);
}
}

SoundStreamProperties()
{
Name("squad_command_formup");
Group("objective_vo");
Inherit("vo_template");
Stream("command_formup");
SegmentList()
{
Sample("command_formup", 1.0, 0.0, 0.0);
}
}
ARC_stream.stm
Hidden/Spoiler:
streams\command_forumup.wav command_formup -resample xbox 22050 pc 22050
ARC_cw.req (ARC is a working .asfx file)
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"ARC"
}

REQN
{
"config"
"cw_new"
}
}
ARC.req (ARCgcw is another .req that works fine)
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
"ARC_stream"
}
REQN
{
"lvl"
"ARCcw"
"ARCgcw"
}
}
The sound is loaded correctly in the LUA, as all the effects work, and then I'm using
BroadcastVoiceOver("squad_command_formup", ATT)
to try to play the sound.

Re: Custom Voiceovers

Posted: Sat Feb 13, 2010 9:02 pm
by wishihadaname
I'm working on the same issue ATM and though I haven't tried this myself or have any idea how to do it, I think I know what the problem is.
I looked at shipped vo.snd files and they seem to be structured in a differant manner from sound effect and sound region files, take a look at this

SoundStreamProperties()
{
Name("FEL_obj_01");
Group("objective_vo");
Inherit("vo_template");
Stream("fel_objective_vo_slow");
SegmentList()
{
Segment("ROFEL0001", 1.0, 0.0, 0.0); // Trooper, defend the AT-TE until Jedi Commander Secura arrives
}
}

I got that out of the felucia VO file, it looks like the entire VO for the level is all one file called fel_objective_vo_slow and that the differant voiceovers are segments. While it would not be hard to make all of the VO one file, I have no idea how to devide it into segments.

Re: Custom Voiceovers

Posted: Sat Feb 13, 2010 10:34 pm
by KnightsFan
Hasn't anyone ever made custom voiceovers before? I thought they had.

Edit: I'm getting this is my mungelog, though the format is proper.
Hidden/Spoiler:
soundflmunge.exe : Error : Unable to open file streams\command_forumup.wav - while munging C:\BF2_ModTools\data_ARC\Sound\worlds\ARC\ARC_stream.stm
soundflmunge.exe : Error : Unable to open file streams\command_forumup.wav, format may be invalid - while munging C:\BF2_ModTools\data_ARC\Sound\worlds\ARC\ARC_stream.stm
soundflmunge.exe : Error : Unable to read file list C:\BF2_ModTools\data_ARC\Sound\worlds\ARC\ARC_stream.stm - while munging C:\BF2_ModTools\data_ARC\Sound\worlds\ARC\ARC_stream.stm

Re: Custom Voiceovers

Posted: Sat Feb 13, 2010 10:46 pm
by CodaRez
There was a mandalorian polus map with custom voiceovers.

http://starwarsbattlefront.filefront.co ... vern;78983

Author is Authraw(but i coulda sworn he had a different name here in GT)

Re: Custom Voiceovers

Posted: Sun Feb 14, 2010 12:20 am
by Maveritchell
CodaRez wrote:There was a mandalorian polus map with custom voiceovers.

http://starwarsbattlefront.filefront.co ... vern;78983

Author is Authraw(but i coulda sworn he had a different name here in GT)
That map has zero custom sounds. Some of the units use an unused stock sound. Even if those had been custom, they are not the type of VOs the OP is referring to.

And to the OP; your error is probably the command you're using to play the sound. I don't know if the one you're using works - when I've used VOs before (see any of my Rebel Ops maps), I think I've used different commands. What you have is used in the stock campaign, but not with a second parameter (ATT) like you're using. You can use any number of commands to play a sound ingame.

Of course it could just be the typo you have in your .stm file, too (I assume it shouldn't be command_forumup).

Re: Custom Voiceovers

Posted: Sun Feb 14, 2010 4:03 pm
by KnightsFan
*facepalm* That typo might just cause a slight problem... thanks.

So I fixed that, and tried both of these:
ScriptCB_SndPlaySound("squad_command_formup")
BroadcastVoiceOver("squad_command_formup")
But nothing works so far.

Edit: In the .snd file, the stream should be my .stm file, right? I changed it to that, with no effect.

Re: Custom Voiceovers

Posted: Sun Feb 14, 2010 7:52 pm
by Maveritchell
KnightsFan wrote:*facepalm* That typo might just cause a slight problem... thanks.

So I fixed that, and tried both of these:
ScriptCB_SndPlaySound("squad_command_formup")
BroadcastVoiceOver("squad_command_formup")
But nothing works so far.

Edit: In the .snd file, the stream should be my .stm file, right? I changed it to that, with no effect.
Would you post your .lua? It looks like you have everything correctly set up (assuming you changed your .snd file to point out your .stm file and not the name of the segment in the StreamName section, as you mention above).

Re: Custom Voiceovers

Posted: Sun Feb 14, 2010 8:11 pm
by KnightsFan
Okay, here is the LUA I was using to test it...
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("MultiObjectiveContainer")
ScriptCB_DoFile("setup_teams")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


ScriptCB_SetGameRules("campaign")
SetAIDifficulty(0, 2, "hard")
DisableAIAutoBalance()

onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
objectives_timer = CreateTimer("objectives_timer")
SetTimerValue(objectives_timer, 2)
StartTimer(objectives_timer)
begin_objectives = OnTimerElapse(
function(timer)
StartObjectives ()
ScriptCB_EnableCommandPostVO(0)
end,
objectives_timer
)
end
end
)

-- There are no objectives, this is a placeholder
Obj = Objective:New{TeamATT = ATT, TeamDEF = DEF, text = "level.ARC.explore.instructions"}
Obj.OnStart = function (self)
-- nothing
ScriptCB_SndPlaySound("squad_command_formup")
--BroadcastVoiceOver("squad_command_formup")
end
Obj.OnComplete = function (self)
-- nothing
end

EnableSPHeroRules()

end

function StartObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 1.0 }
objectiveSequence:AddObjectiveSet(Obj)
objectiveSequence:Start()
end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()

ReadDataFile("dc:Load\\common.lvl")
ReadDataFile("ingame.lvl")


SetMaxFlyHeight(100)
SetMaxPlayerFlyHeight (100)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:sound\\ARC.lvl;ARCcw")
ReadDataFile("dc:SIDE\\arc.lvl",
"arc_inf_rev_civ",
"arc_hover_landspeeder")

--ReadDataFile("dc:SIDE\\civ.lvl",
-- "civ_hover_landspeeder")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_sniper",
"cis_inf_engineer",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul")

SetupTeams{
rep = {
team = REP,
units = 0,
reinforcements = -1,
soldier = { "arc_inf_rev_civ",0, 1}

},
cis = {
team = CIS,
units = 28,
reinforcements = 150,
soldier = { "cis_inf_rifleman",10, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = { "cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
}

--SetHeroClass(CIS, "cis_hero_darthmaul")
--SetHeroClass(REP, "rep_hero_macewindu")


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 372)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:ARC\\ARC.lvl", "ARC_cwxl")
ReadDataFile("dc:ARC\\sky.lvl", "tat2_sky")
SetDenseEnvironment("false")




-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


--OpeningSateliteShot
AddCameraShot(0.958627, -0.109310, 0.261151, 0.029778, -631.136475, 20.650682, 715.997986);
end

Re: Custom Voiceovers

Posted: Sun Feb 14, 2010 8:21 pm
by Maveritchell
KnightsFan wrote:Okay, here is the LUA I was using to test it...
You need to open the audio stream (at the end of your script, with the rest of the sound streams), otherwise no streams will be loaded. It isn't enough to just load in the sound .lvl for streams (music/VOs).

Re: Custom Voiceovers

Posted: Sun Feb 14, 2010 8:49 pm
by KnightsFan
You mean like this?
OpenAudioStream("dc:Sound\\ARC.lvl", "ARC_stream")
Where ARC_stream is my .stm file? I put that in under the other OpenAudioStreams but it doesn't work still.