PDA

View Full Version : Tutorial: Adding custom pre-battle speeches



V.T. Marvin
12-17-2012, 21:11
You all know it - "Today is a good day to die...!" It is cool, but after all those years it no longer feels so great. So let us assume that I want my generals say something different before battles. Say, "Resistance is futile... (https://www.youtube.com/watch?v=WZEJ4OJTgg8)" or an actual historical pre-battle speech in Latin. To do it is very simple. Getting the .mp3 file with the speech I want is actually the most difficult part. Assume I have it already, so let us call it "my_file.mp3" - what next?

First
If your mod is mod-foldered look for the file [MyMod - EB, IB, RS, whatever]\data\export_descr_sounds_prebattle.txt. If it is there - make a backup. If there is no such file go for the vanilla, i.e. ...RTW\data\export_descr_sounds_prebattle.txt and copy it into your mod folder. Also, if you want to add subtitles, which might be almost necessary for speeches in ancient languages, go into ...RTW\data\text folder, copy the file prebattle_speeches_subtitles.txt and copy it into [MyMod]\data\text folder - if it is not already there.

Now let us create in [MyMod - EB, IB, RS, whatever]\data\ the following folder structure: [MyMod]\data\sounds\Voice\Human\Localized\Pre_Battle_Speech - it is not strictly necessary, but I rather stayed on the safe side - and put the my_file.mp3 there and rename it into Roman_Intro_01_1.mp3.

Second
Open the export_descr_sounds_prebattle.txt with your favourite text editor. The content of this file are neatly structured:

BANK: prebattle_speech
cultures Roman - all the following until the next cultures tag concerns this culture
element VNV_OPENING - identifies the beginning of an element
VnV BadCommander 1 - condition under which the following sound-file is played
event
folder data/sounds/Voice/Human/Localized/Pre_Battle_Speech - line to mod No.1
Roman_Intro_01_1.mp3 - - line to mod No.2
end
The important thing to note is that a pre-battle speech is actually assembled by the engine from several individual sound-file, i.e. the elements.

Now comes the quick part - assume I want my_file.mp3 to play just for the Romans. So use the find-and-replace feature of your text editor and replace all instances of
folder data/sounds/Voice/Human/Localized/Pre_Battle_Speech for
folder [MyMod]/data/sounds/Voice/Human/Localized/Pre_Battle_Speech all the way until the line "cultures Greek" - BTW it is line 1717 in the vanilla file. Note that the slashes go in the opposite direction than usual, but it is not a bug, it is a feature (probably).

Third
Here comes the tedious part. Delete all conditions you do not need and change all file names referred to for your culture into "Roman_Intro_01_1.mp3" Essentially what you need is this:
cultures Roman
element VNV_OPENING
VnV
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
; 1 Eb romans
element ENEMY_ID
relationship Hates
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
relationship Neutral
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end


element ENEMY_ALLIES
relationship Hates
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
relationship Neutral
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
no_allies Hates
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
no_allies Neutral
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end

element ALLIES
present
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end

helping
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element STRATEGIC_SITUATION
situation DEFENDING_A_MAJOR_CITY
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation FIELD_BATTLE_IN_OWN_TERRITORY
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation FIELD_BATTLE_IN_ENEMY_TERRITORY
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation KEY_BATTLE
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation IMPORTANT_BATTLE_FOR_US
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation VERY_IMPORTANT_BATTLE_FOR_US
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation VITAL_BATTLE_FOR_US
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation IMPORTANT_BATTLE_FOR_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation VERY_IMPORTANT_BATTLE_FOR_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation VITAL_BATTLE_FOR_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation LAST_STAND_FOR_US
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation LAST_STAND_FOR_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation EAGLE_RECOVERY
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
situation LAST_STAND_FOR_OUR_ALLY
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element BATTLE_TYPE
type FIELD_ATTACK
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type FIELD_DEFENCE
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type SIEGE_ASSAULT
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type SIEGE_DEFENCE
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type SIEGE_RELIEVING
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type AMBUSH_ATTACK
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type RIVER_ATTACK
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
type RIVER_DEFENCE
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element BATTLE_NUMBERS
odds HOPELESSLY_OUTNUMBER_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds MASSIVELY_OUTNUMBER_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds OUTNUMBER_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds SLIGHTLY_OUTNUMBER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds EVEN
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds SLIGHTLY_OUTNUMBERED
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds OUTNUMBERED
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds MASSIVELY_OUTNUMBERED
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds HOPELESSLY_OUTNUMBERED
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element BATTLE_STRENGTHS
odds WE_OUTNUMBER_BUT_THEM_STRONGER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds THEY_OUTNUMBER_BUT_WE_ARE_STRONGER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds EVEN_NUMBERS_AND_THEY_ARE_STRONGER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
odds EVEN_NUMBERS_AND_WE_ARE_STRONGER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element BATTLE_TERRAIN
condition DEFENDING_HILLS
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition ATTACKING_HILLS
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition DEFENDING_STEEP_HILLS
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition ATTACKING_STEEP_HILLS
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition DEFENDING_WOODS
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition ATTACKING_WOODS
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element TROOP_COMPARISON
condition THEY_LOTS_OF_CAVALRY_1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_LOTS_OF_CAVALRY_2
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_LOTS_OF_CAVALRY_3
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition WE_LOTS_OF_CAVALRY_1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition WE_LOTS_OF_CAVALRY_2
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_ELEPHANTS_1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_ELEPHANTS_2
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition WE_ELEPHANTS_1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_ELEPHANTS_3
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition WE_LOTS_OF_MISSILES
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_LOTS_OF_MISSILES
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition WE_LOTS_OF_CAVALRY_3
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition THEY_LOTS_OF_CAVALRY_4
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element PREVIOUS_RECORD
condition NOT_FOUGHT_THEM_BEFORE
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition FOUGHT_THEM_BEFORE_A_BIT
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition FOUGHT_THEM_BEFORE_A_LOT
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition NEVER_LOST_AGAINST_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition LOST_LAST_BATTLE_AGAINST_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
condition NEVER_WON_A_BATTLE_AGAINST_THEM
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element VNV_MID
VnV Anger 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadAmbusher 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadAttacker 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadCavalryGeneral 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadDefender 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadDisciplinarian 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadInfantryGeneral 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadSiegeAttacker 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV BadSiegeDefender 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV Disciplinarian 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodAmbusher 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodAttacker 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodAttacker 4
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodCavalryGeneral 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodDefender 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodDefender 4
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodInfantryGeneral 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
VnV GoodSiegeAttacker 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
; Roman_Intro_01_1.wav
end
VnV GoodSiegeDefender 1
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element OMENS
omen FANTASTIC
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
omen GOOD
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
omen NEUTRAL
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
omen BAD
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
omen AWFUL
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element REINFORCEMENTS_NEAR
reinforcement NEAR_SOON
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
reinforcement NEAR_LATER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element VNV_END
VnV
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
element ONE_LINER
event
folder eb/data/sounds/Voice/Human/Localized/Pre_Battle_Speech
Roman_Intro_01_1.mp3
end
Save and exit.

The result - now before every battle my sound will play instead of the vanilla battle speech. Because we need to preserve all elements listed in the file the same sound will play several times over. It does not matter too much unless the sound is long and you would like to have subtitles for it. Because the subtitles will also be long and because they are on screen all the time the file is playing it will clutter the screen. Much better is to cut your intended speech into several parts - several sound-files and assign them to the elements in appropriate order.

Subtitles¨
The easiest part of all - open the [MyMod]\data\text\prebattle_speeches_subtitles.txt and change the entries for the files which names we used into what are the intended subtitles:

from this:

{Roman_Intro_01_1}
You know my reputation! I would not choose to send you to your deaths unless it were absolutely necessary.
into something like this:

{Roman_Intro_01_1}
Let us pray now...

That is all there is to it. Good luck and have fun!