Would like to put new music in...

Putmalk

Deity
Joined
Sep 26, 2010
Messages
2,652
Location
New York
Is this possible yet? Can we add an .mp3 to the database and play the file during an era or something yet (even better, during a leader screen?)

Just saying because how boss would it be for this to play during a scenario?

http://www.youtube.com/watch?v=PgT4TE9ILT4
 
Checking the Audio2DScripts we see the tag:

Code:
<Script2DSound>
      <ScriptID>AS2D_LEADER_MUSIC_BOUDICCA_PEACE</ScriptID>
      <SoundID>SND_LEADER_MUSIC_BOUDICCA_PEACE</SoundID>
      <iMaxVolume>55</iMaxVolume>
      <iMinVolume>55</iMinVolume>
      <SoundType>GAME_MUSIC</SoundType>
      <bIsMusic>True</bIsMusic>
    </Script2DSound>

But there's no call to the .ogg file so how does the game know that's the file to use?

Okay, I found the schema:

Code:
<Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
	<ElementType name="SoundID" content="textOnly"/>
	<ElementType name="Filename" content="textOnly"/>
	<ElementType name="bIsCompressed" content="textOnly" dt:type="boolean"/>
	<ElementType name="bInGeneric" content="textOnly" dt:type="boolean"/>
	<ElementType name="ContextType" content="textOnly"/>
	<ElementType name="SoundType" content="textOnly"/>
	<ElementType name="PositionType" content="textOnly"/>
	<ElementType name="ScriptType" content="textOnly"/>
	<ElementType name="LoadType" content="textOnly"/>
	<ElementType name="EffectType" content="textOnly"/>
	<ElementType name="SpeakerConfig" content="textOnly"/>
	<ElementType name="fReverbTime" content="textOnly"/>
	<ElementType name="fReverbPredelay" content="textOnly"/>
	<ElementType name="fReverbDamping" content="textOnly"/>
	<ElementType name="fReverbDryLevel" content="textOnly"/>
	<ElementType name="fReverbWetLevel" content="textOnly"/>
	<ElementType name="iSampleRate" content="textOnly" dt:type="int"/>
	<ElementType name="iSampleBits" content="textOnly" dt:type="int"/>
	<ElementType name="iMultiChannelPref" content="textOnly" dt:type="int"/>
	<ElementType name="iNum2DSamples" content="textOnly" dt:type="int"/>
	<ElementType name="iNum3DSamples" content="textOnly" dt:type="int"/>
	<ElementType name="iNum2DStreams" content="textOnly" dt:type="int"/>
	<ElementType name="iNum3DStreams" content="textOnly" dt:type="int"/>
	<ElementType name="fPercentSamplesFor3D" content="textOnly"/>
	<ElementType name="AudioSystemInit" content="eltOnly">
		<element type="iSampleRate" maxOccurs="1"/>
		<element type="iSampleBits" maxOccurs="1"/>
		<element type="iMultiChannelPref" maxOccurs="1"/>
		<element type="iNum2DSamples" maxOccurs="1"/>
		<element type="iNum3DSamples" maxOccurs="1"/>
		<element type="iNum2DStreams" maxOccurs="1"/>
		<element type="iNum3DStreams" maxOccurs="1"/>
		<element type="fPercentSamplesFor3D" maxOccurs="1"/>
	</ElementType>
	<ElementType name="ReverbData" content="eltOnly">
		<element type="fReverbTime" maxOccurs="1"/>
		<element type="fReverbPredelay" maxOccurs="1"/>
		<element type="fReverbDamping" maxOccurs="1"/>
		<element type="fReverbDryLevel" maxOccurs="1"/>
		<element type="fReverbWetLevel" maxOccurs="1"/>
	</ElementType>
	<ElementType name="GameEnvironmentType" content="textOnly"/>
	<ElementType name="GameEnvironmentMap" content="eltOnly">
		<element type="GameEnvironmentType" maxOccurs="1"/>
		<element type="ReverbData" maxOccurs="1"/>
		<element type="EffectType" maxOccurs="1"/>
	</ElementType>
	<ElementType name="SoundData" content="eltOnly">
		<element type="SoundID"/>
		<element type="Filename"/>
		<element type="LoadType"/>
		<element type="bIsCompressed"/>
		<element type="bInGeneric"/>
	</ElementType>
	<ElementType name="SoundDatas" content="eltOnly">
		<element type="SoundData" maxOccurs="*"/>
	</ElementType>
	<ElementType name="SpeakerConfigs" content="eltOnly">
		<element type="SpeakerConfig" maxOccurs="*"/>
	</ElementType>
	<ElementType name="ContextTypes" content="eltOnly">
		<element type="ContextType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="SoundTypes" content="eltOnly">
		<element type="SoundType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="PositionTypes" content="eltOnly">
		<element type="PositionType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="ScriptTypes" content="eltOnly">
		<element type="ScriptType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="LoadTypes" content="eltOnly">
		<element type="LoadType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="EffectTypes" content="eltOnly">
		<element type="EffectType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="GameEnvironmentTypes" content="eltOnly">
		<element type="GameEnvironmentType" maxOccurs="*"/>
	</ElementType>
	<ElementType name="Effects" content="eltOnly">
		<element type="GameEnvironmentMap" maxOccurs="*"/>
	</ElementType>
	<ElementType name="AudioDefines" content="eltOnly">
		<element type="SoundDatas" maxOccurs="1"/>
		<element type="ContextTypes" maxOccurs="1"/>
		<element type="SoundTypes" maxOccurs="1"/>
		<element type="PositionTypes" maxOccurs="1"/>
		<element type="ScriptTypes" maxOccurs="1"/>
		<element type="LoadTypes" maxOccurs="1"/>
		<element type="EffectTypes" maxOccurs="1"/>
		<element type="GameEnvironmentTypes" maxOccurs="*"/>
		<element type="Effects" maxOccurs="1"/>
		<element type="SpeakerConfigs" maxOccurs="1"/>
		<element type="AudioSystemInit" maxOccurs="1"/>
	</ElementType>
</Schema>

So there's a tag for Filename...now can I implement it? Time to test...

Well, there's two different schemas: Defines and Scripts. The one I posted above was for defines. So the filenames in the defines files aren't .ogg's, but plain text. Maybe they're coded to just match the name of the file? I'll see...

Yeah, they match.

Code:
<SoundData>
			<SoundID>SND_LEADER_MUSIC_ALEXANDER_PEACE</SoundID>
			<Filename>Alexander_Peace</Filename>
			<bDontCache/>
			<LoadType>STREAMED</LoadType>
		</SoundData>
		<SoundData>
			<SoundID>SND_LEADER_MUSIC_ALEXANDER_WAR</SoundID>
			<Filename>Alexander_War</Filename>
			<bDontCache/>
			<LoadType>STREAMED</LoadType>
		</SoundData>

Matches the Alexander_Peace.ogg and Alexander_War.ogg in the database.

Okay, I'm going to try and implement this.
 
I still can't find where the hell you define SND_LEADER_MUSIC_ALEXANDER_PEACE to be linked to
LEADER_ALEXANDER. Why is it invisible?

No, it doesn't work. Where are they defining where to play the music?
 
Guess that's a resounding no. It doesn't seem possible to get the game to recognize your custom sound files.

<sigh>
 
Back
Top Bottom