Unique Strat Map Voices for Unique Characters
This is based on the findings here, starting half way down that post and in subsequent posts.
It uses script to play the voice sound whenever any general (named character) is selected on the strat map. If it's the custom general then the sound played is chosen from one pool of voice audio files; if it's any other general then it's chosen from a different pool.
This example is for Galadriel, a general of the Lorien faction. Selecting Galadriel plays a custom Galadriel voice. Selecting anybody else plays a 'generic' voice.
A new "Lorien" accent was created, copied from one of the existing ones, and assigned to only the Lorien faction.
In export_descr_sounds_stratmap_voice.txt the normal general-selected sounds were removed...
Code:
accent Lorien
...
type General
...
vocal Selected
event
folder data/sounds/Voice/Human/Localized/Camp_Map
end
Do likewise for Selected_Dread and Selected_Chivalry.
All of the other character types and events are there, just not shown here. The point is that these Selected events have no sound files in them, so at the moment if a Lorien general was selected then nothing would be played. (I don't know if the "folder" still needs mentioning like it is above, nor if the event is even needed at all here.)
In descr_sounds_generic.txt two entries were added. These are what script plays.
Code:
event GALADRIEL_SELECTED streamed
folder data/sounds/SFX/campaign_map
gala01.mp3
gala02.mp3
gala03.mp3
gala04.mp3
end
event LORIEN_GENERAL_SELECTED streamed
folder data/sounds/Voice/Human/Localized/Camp_Map
xEnglish_General_Selected_3.mp3
xEnglish_General_Selected_4.mp3
end
Those LORIEN_GENERAL_SELECTED MP3s are the ones that were removed from export_descr_sounds_stratmap_voice.txt. i.e. The normal voices for selected generals of this Lorien accent.
The GALADRIEL_SELECTED MP3s are custom made ones of Galadriel's voice.
In campaign_script.txt we add some monitors to play the sounds...
Code:
monitor_event CharacterSelected Trait Galadriel > 0
play_sound_event GALADRIEL_SELECTED
end_monitor
monitor_event CharacterSelected FactionType turks
and AgentType = named_character
and not Trait Galadriel > 0
play_sound_event LORIEN_GENERAL_SELECTED
end_monitor
The Galadriel character has a trait, also named "Galadriel". Nobody else ever gets this trait. Therefore, if a character is selected and they have this trait then we are certain that it is Galadriel who was selected. So we play her voice via the play_sound_event command: this will make descr_sounds_generic.txt play one of the GALADRIEL_SELECTED MP3s.
The second monitor is for any Lorien general EXCEPT Galadriel:
- FactionType turks => Lorien
- AgentType = named_character => general (i.e. selecting other Lorien agent types - captains, admirals, spies, etc. - won't play this sound)
- not Trait Galadriel > 0 => does not have the Galadriel trait => is not Galadriel
This will play one of the LORIEN_GENERAL_SELECTED MP3s via descr_sounds_generic.txt.
In summary: for all generals of this faction, when selected, don't play voices via export_descr_sounds_stratmap_voice.txt, play them via script instead. Script is able to figure out who the character is and therefore which voice to play.
More characters could be added of course. It isn't limited to one unique character.
However, it ONLY works for the Selected event because that's the only one for which an associated scripting event exists (CharacterSelected). So when Galadriel is told to move somewhere, for example, then her voice will still be as per export_descr_sounds_stratmap_voice.txt (Movement_Ordered) and therefore a 'standard' voice, not her custom voice.
NOTE: It might not be necessary to create a new Accent. For example, if Lorien and some other factions are of the same Culture (e.g. "greek"), and all of those greek-culture factions have the same Accent (e.g. "Greek"), and no other faction has that Accent, then you could instead remove the General-Selected voices from the Greek accent and have this as the second script monitor...
Code:
monitor_event CharacterSelected CultureType greek
and AgentType = named_character
and not Trait Galadriel > 0
play_sound_event LORIEN_GENERAL_SELECTED
end_monitor
(In this case LORIEN_GENERAL_SELECTED is a poor name choice because it's not just for Lorien voices now.)
~~~
Ngugi, perhaps you could add a link to this in the OP?