Page 1 of 1

Prop Sound Issues

Posted: Tue Aug 28, 2012 5:25 pm
by yuke5
Hey, I'm having some trouble getting an animated prop to have engine sounds. I'm able to get right next to the prop, but I don't hear anything. I don't know if I'm referencing the wrong sound or not setting up my odf or lua right.


My lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
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()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}


--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)

conquest:Start()

EnableSPHeroRules()

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(80)
SetMaxPlayerFlyHeight (80)

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("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_inf_riot",
"rep_hover_fightertank",
"rep_hero_fox",
"rep_hover_barcspeeder")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_super",
"cis_inf_jetdroid",
"cis_hero_darthmaul",
"cis_hover_aat")

ReadDataFile("dc:SIDE\\lis.lvl",
"lis_hero_grievous")


ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_tower")

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_super",1, 4},
special = { "cis_inf_jetdroid",1, 4},
}
}

SetHeroClass(CIS, "lis_hero_grievous")
SetHeroClass(REP, "rep_hero_fox")


-- 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("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:CRS\\CRS.lvl", "CRS_conquest")
ReadDataFile("dc:CRS\\CRS.lvl", "CRS_conquest")
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("dc:sound\\htm.lvl", "htm_hero_vo_quick");
-- 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.901916, -0.107341, -0.415430, -0.049442, -60.467247, 65.148849, 28.988657);
AddCameraShot(-0.182541, 0.009727, -0.981757, -0.052314, 21.684700, 52.231880, -40.593464);
AddCameraShot(-0.427056, 0.010945, -0.903862, -0.023165, -51.963230, 48.997986, -51.921627);
AddCameraShot(0.776885, -0.003263, -0.629628, -0.002644, -77.092560, 51.895222, 60.199615);
AddCameraShot(0.767863, 0.559779, 0.251714, -0.183502, -18.443539, 30.625132, 42.540531);
AddCameraShot(0.689066, 0.022374, -0.723971, 0.023507, -41.785080, 53.455109, -34.676586);
end

My prop's odf
Hidden/Spoiler:
[GameObjectClass]
ClassLabel = "prop"
GeometryName = "civ_fly_awing.msh"

[Properties]
GeometryName = "civ_fly_awing"

SoundProperty = "all_fly_awing_engine_parameterized"
As always, help would be greatly appreciated. Thank you.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 5:33 pm
by AQT
The "parameterized" sounds for vehicles don't work with SoundProperty of a prop unfortunately. :(

They're set up in a way so that different sounds are played depending on what the vehicle does, so it can't really apply to a stationary prop.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 5:49 pm
by yuke5
Really? Well that stinks. I guess I'll need to see what I can find that creates a sound similar to that. If I still can't I guess I'll add the stuff in via sound region and custom sound stream. Although I won't get the fly by effect I was hoping for. :(

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 5:55 pm
by willinator
Could you do it by adding one of those little sound boxes that ZE uses to define a specific soundspace, then animate it with the vehicle?

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 5:58 pm
by yuke5
I'm fairly sure you can't animate regions.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 6:00 pm
by Cleb
Nope, only objects.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 6:15 pm
by willinator
I know you can't animate regions, but there is a little editor prop of a speaker, which I'm pretty sure is related to sounds, which you could probably animate. It's in one of the common folders.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 9:32 pm
by Marth8880
You can't necessarily use parameterized sounds, but you can use the layered versions. Check the default vehicle .snd files. I believe what you need is "all_fly_awing_engine_layered".

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 9:36 pm
by yuke5
Wait. So I can just type that into my odf, or do I create a custom sound.lvl?

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 9:44 pm
by Marth8880
Just type it in. ;) Parameterized sounds are like "specifically configured" versions of layered sounds since each stock engine consists of three sounds: the low, medium and high range.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 9:52 pm
by yuke5
Got it. ODF has been edited and I'm munging now. If this works, I can't thank you enough Marth.

EDIT: Nope. Doesn't work. Maybe my LUA isn't reading the GCW sound.lvl properly.

EDIT2: I found this:

Code: Select all

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=e79fea8a: trying to replace "civ_fly_awing" with "civ_fly_awing2"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=e89fec1d: trying to replace "civ_fly_awing" with "civ_fly_awing3"

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\StringDB.cpp(48)
ID=e19fe118: trying to replace "civ_fly_awing" with "civ_fly_awing4"

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 10:10 pm
by AQT
It's not working because all components of the parameterized sounds are configured/set up nothing like sounds that are supposed to work with SoundProperty. For example:
global_world.snd wrote:

Code: Select all

SoundProperties()
{
    Name("control_panel_a");
    Group("ambientenv");
    Inherit("ambientemt_static_template");
    Looping(1);
    SampleList()
    {
        Sample("emt_telemetry_temple_lp01", 1.0);
    }
}
This is the SoundProperty used by hoth_prop_command_console_a.odf. Now compare it to anything parameterized-related found in all_fly_awing.snd.

Re: Prop Sound Issues

Posted: Tue Aug 28, 2012 10:30 pm
by yuke5
Okay. I get it. So if I want to get flyer sounds working for my props, I need to record them somehow, or find a way to get them in their raw format, and use them is a custom sound lvl.

Re: Prop Sound Issues

Posted: Wed Aug 29, 2012 2:02 am
by Marth8880
AQT wrote:It's not working because all components of the parameterized sounds are configured/set up nothing like sounds that are supposed to work with SoundProperty. For example:
global_world.snd wrote:

Code: Select all

SoundProperties()
{
    Name("control_panel_a");
    Group("ambientenv");
    Inherit("ambientemt_static_template");
    Looping(1);
    SampleList()
    {
        Sample("emt_telemetry_temple_lp01", 1.0);
    }
}
This is the SoundProperty used by hoth_prop_command_console_a.odf. Now compare it to anything parameterized-related found in all_fly_awing.snd.
Actually, all sounds work with each other perfectly fine. The problem is the LUA: you're trying to load two sound files from the stock sound folder while only one can be loaded. Since only the space sound file includes most of the flyer sounds, I'd personally recommend using a sound file containing either the Snowspeeder or the AAC; I recommend the AAC the most, but both would work relatively well for speeder sounds. Personally, I think you should load the Coruscant or Naboo sound file.


If you want the AAC, you'd put this in your ODF:

Code: Select all

SoundProperty = "combatspeeder_engine_layered"
If the Snowspeeder, then this:

Code: Select all

SoundProperty = "snowspeeder_engine_layered"
Next, your LUA would look like this for the Snowspeeder:

Code: Select all

ReadDataFile("sound\\cor.lvl;cor1cw")
-- OH MY GOODNESS I JUST HAD AN EPIPHANY! :o

You could use the STAP engine sound! It would work really well and it's easy to load! So yeah, choose a level that has the STAP, load it in your LUA above the stock line (while making sure to begin with ReadDataFile("dc:) or completely ditch using a dc: sound file and just load one that has the STAP, and use stap_engine_layered in the SoundProperty parameter.

For instance:

Code: Select all

ReadDataFile("sound\\yav.lvl;yav1cw")
Oh, and don't forget to edit the OpenAudioStream lines at the end of the LUA to match that of Yavin.

Re: Prop Sound Issues

Posted: Wed Aug 29, 2012 10:07 pm
by yuke5
Thanks Marth. I'll try it out in a bit, but right now where I am it's really late. I think I'll go to bed now and try out in the morning.


EDIT:
It sort of works. The sound is always present and none of the weapons have sound. :| I'm fed up. I think I'll deal with this problem later and work on other stuff. I'll figure something out eventually. I hope.

Re: Prop Sound Issues

Posted: Wed Aug 29, 2012 10:59 pm
by Marth8880
Hang on a moment, could you show me the mo-- err, the LUA? Get on Xfire in an hour and a half, I'll help you there.

Re: Prop Sound Issues

Posted: Wed Aug 29, 2012 11:03 pm
by yuke5
I'm sorry, man, I'm trying to get my sleep schedule back on track. For most of the summer I have been nocturnal. Right now it's 11:02 and I have to get up early in the morning (6:00). I certainly would appreciate your help, but I can't accept it at the immediate moment.

Re: Prop Sound Issues

Posted: Wed Aug 29, 2012 11:25 pm
by THEWULFMAN
No problem Yuke. Being nocturnal sounds very familiar for Marth and I. I just don't have to fix it since I home school.