Adding custom AudioIntro to new technology

Xeelee

Chieftain
Joined
Feb 27, 2015
Messages
6
Does anyone know how to have a custom tech play a custom audio intro? I've tried copying how the main .xml files do it but it just doesn't work. And I am including the files that need it in VFS.
 
Yes I did. Here's the relevant sections from my mod:

Code:
<AudioDefinesFile>
	<SoundDatas>

		<SoundData>
			<SoundID>SND_TECH_BIOGENETICS</SoundID>
			<Filename>biogenetics</Filename>
			<LoadType>DYNAMIC_RES</LoadType>
		</SoundData>
		
	</SoundDatas>
</AudioDefinesFile>


Code:
<Script2DFile>
	<Script2DSounds>

		<Script2DSound>
			<ScriptID>AS2D_TECH_BIOGENETICS</ScriptID>
			<SoundID>SND_TECH_BIOGENETICS</SoundID>
			<SoundType>GAME_SPEECH</SoundType>
		</Script2DSound>
		
	</Script2DSounds>
</Script2DFile>

Code:
<GameData>
	<Technologies>
		<Row>
			<ID>0</ID>
			<Type>TECH_BIOGENETICS</Type>
			<Cost>50</Cost>
			<GridRadius>1</GridRadius>
			<GridDegrees>1</GridDegrees>
			<Description>TXT_KEY_TECH_BIOGENETICS</Description>
			<Civilopedia>TXT_KEY_TECH_BIOGENETICS_DESC</Civilopedia>
			<Help>TXT_KEY_TECH_BIOGENETICS_HELP</Help>
			<Quote>TXT_KEY_TECH_BIOGENETICS_QUOTE</Quote>
			<IconAtlas></IconAtlas>
			<PortraitIndex>0</PortraitIndex>
			<AudioIntro>AS2D_TECH_BIOGENETICS</AudioIntro>
			<AudioIntroHeader></AudioIntroHeader>
		</Row>
	</Technologies>
</GameData>

I completely deleted the old tech tree and made a new one. None of the other techs have an audio intro yet, was waiting till I got this one working first. Any idea where I messed up?
 
Comparing your code to that in Tech_SpeechAudio2DScripts.xml and Tech_SpeechAudioDefines.xml, it looks like there are a few variables in firaxis' sound defines which you've missed out of yours:

Code:
<AudioDefinesFile> 
    <SoundDatas> 
        <SoundData> 
            <SoundID>SND_HEADING_TECH_ALIEN_ADAPTION</SoundID> 
            <Filename>HeadingTechAlienAdaption</Filename> 
            [B]<bDontCache/> [/B]
            [B]<bOnlyLoadOneVariationEachTime/>[/B]
            <LoadType>DYNAMIC_RES</LoadType> 
        </SoundData>
    </SoundDatas>
</AudioDefinesFile>

Code:
<Script2DFile> 
    <Script2DSounds> 
        <Script2DSound> 
            <ScriptID>AS2D_HEADING_TECH_ALIEN_ADAPTION</ScriptID>
            <SoundID>SND_HEADING_TECH_ALIEN_ADAPTION</SoundID>
            [B]<fTaperSoundtrackVolume>0.85</fTaperSoundtrackVolume>[/B] 
            <SoundType>GAME_SPEECH</SoundType> 
            [B]<iMaxVolume>80</iMaxVolume> [/B]
            [B]<iMinVolume>80</iMinVolume>[/B]
        </Script2DSound>
    </Script2DSounds> 
</Script2DFile>


At a guess, your new sound might be playing at volume 0, since you haven't defined a min and max volume for it?
 
Nope, that's how it was initially and I removed it just to test it. Re-adding it still has no effect.
 
Back
Top Bottom