Jump to content

programattically setting voice, and aliens with voices?


davidlallen

Recommended Posts

So, for the playable advent mod, one player suggested that the aliens should use voices from some of the existing voice packs. For example, the muton could use one of the krogran voice packs (wrex, grunt) and the chryssalid could use the legion voice pack. I have written code which gets a target voice name from my ini file and looks for a voice template that matches. Then, it sets the character voice to that template. So, if the player likes the grunt voice pack, they can tell the playable advent mod to set that voice for any playable muton character.

 

Nice idea, but it doesn't work. There seem to be two problems: first, even though I call SetVoice on the unit, I can see in the soldier customize screen that it doesn't take effect; the voice field is blank. Second, when I set the voice field manually for *playable aliens*, there is no effect: the unit is silent. Humans in the squad at the same time say their lines correctly.

 

For the first problem, I am using the following code. Can you see anything I missed? I have similar code to set the first and last name on the same unitstate (SetCharacterName()), and that is working.

    UnitState.kAppearance.iGender = 1; // male

    if (AUTOMATIC_VOICE != "") {

        `log("davea debug chrys-auto-voice " @ AUTOMATIC_VOICE);

        PartTemplateManager = class'X2BodyPartTemplateManager'.static.GetBodyPartTemplateManager();

        PartTemplateManager.GetUberTemplates("Voice", AllVoiceTemplates);

        foreach AllVoiceTemplates(VoiceTemplate) {

            VoiceName = VoiceTemplate.ArchetypeName;

            `log("davea debug chrys-voice-available " @ VoiceName);

            if (VoiceName ~= AUTOMATIC_VOICE) {

                `log("davea debug chrys-voice-set " @ VoiceName);

                UnitState.SetVoice(name(VoiceName));

            }

        }

    }

    UnitState.StoreAppearance();

For the second problem, can anybody suggest what may be different between alien pawns and human pawns, to prevent them from speaking lines?

Edited by davidlallen
Link to comment
Share on other sites

Re-post of my thread on 2k forums


The main difference between voices for soldiers and enemies is that enemies have a LOT of their voices baked in their animations: sectoid, sectopod, muton etc have a number of animations baked with voice. Advent troopers are a relative exception.


XcomMetadata.ini regulates the Speech Events that actually prompt audio: however, the soundsets are built on EU\EW instances. Take GrenadierAbilitySet.uc for example: his ultimate ability, Rupture, has Template.ActivationSpeech = Bulletshred, which is listed in Metadata.ini but NOT in the EVENT list inside the editor.


so, if you wonder why you hear no special audio for psi powers or skills, you know why now.

Link to comment
Share on other sites

We did a similar sort of customization for the Centurion WarCry ability. We found and used an otherwise unused "Berserker roar" voice-type sound effect. However, in order to time it to the animation at a certain point it gets trigger during the anim via a notify. This is configured in UnrealEd, and allow more precise control of when sound effects play relative to an animation. However, it makes it more difficult to change it up at run-time, or to mod, as you've found.

Link to comment
Share on other sites

Thanks for the information, but I am not sure how to use it. In the soldier customization menu for one of my aliens, I can set one of the predefined voices like American English 1. (This is not possible in the release version but it is possible in my local prerelease version.) I can save the game and load it, and this data is kept. I play a tactical map with this alien and some human. For the same action such as moving, the alien is silent and the human speaks a line such as "Moving to target location". What may be preventing these alien soldiers from speaking?

Link to comment
Share on other sites

Thanks for the information, but I am not sure how to use it. In the soldier customization menu for one of my aliens, I can set one of the predefined voices like American English 1. (This is not possible in the release version but it is possible in my local prerelease version.) I can save the game and load it, and this data is kept. I play a tactical map with this alien and some human. For the same action such as moving, the alien is silent and the human speaks a line such as "Moving to target location". What may be preventing these alien soldiers from speaking?

 

The Advent Voice mod shows that there are a number of inconsistencies in the audio playback system; have you taken that into account?

Link to comment
Share on other sites

I read through all the 60-odd comments on Advent Voices at steam, plus only 4 comments at nexus. I do not find anything in there about inconsistencies. That voice pack had one bug which was fixed, nothing to do with the unrealscript files. There was a big discussion about removing the shader cache file.

 

Is there some other discussion somewhere related to the unrealscript part, or alien pawns? Even after choosing one of the vanilla predefined voices, my aliens are silent.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...