Forum rules - please read before posting.

When speech audio and text have different number of translations

Hey! In our game we have many translations for subtitles, but only few for the voice. In the options menu we use textures for cycling through the languages. I made 2 seperate buttons, one for the text and one for the voice. Is there any way to tell adventure creator not to cycle through all languages for the voice one? Since not all of the languages have translated voice, the ones which dont have should not be included in the speech languages option.

Comments

  • What's the element type? If you're using a Button, are you using an ActionList or a custom script to change the language?

  • It is a button, it is set to cycle: language , and language type: voice only , and it is using per-option textures. And it works, but it ask for a texture for each language.

  • I tried keeping some of the textures empty, but it doesnt skip it, it just stays on the previous language. So for example I have english, then an empty texture, then another language, and I have to click twice to switch from english to the other language.

  • Just an update, I managed to do a workaround now, where I cycle through a variable instead of the languages, and run an actionlist on button click, in which i change the language based on this variable. This works :)

  • As speech audio can come from various sources, it's not possible for AC to "know" that a given language doesn't have associated audio.

    What you can do, however, is use a custom script that - once the user clicks - changes the selected language if the chosen one is unwanted.

    You'd need to hard-code which of these langues to discard, but something like this should do it:

    using System.Collections.Generic;
    using UnityEngine;
    using AC;
    
    public class AlterVoiceLanguage : MonoBehaviour
    {
    
        public List<int> wrongLanguageIndices;
        public string menuName = "MyMenu";
        public string elementName = "MyCycle";
    
        void OnEnable () { EventManager.OnMenuElementClick += OnMenuElementClick; }
        void OnDisable () { EventManager.OnMenuElementClick -= OnMenuElementClick; }
    
        void OnMenuElementClick (Menu _menu, MenuElement _element, int _slot, int buttonPressed)
        {
            if (_menu.title == menuName && _element.title == elementName)
            {
                int currentLanguage = Options.GetVoiceLanguage ();
                if (wrongLanguageIndices.Contains (currentLanguage))
                {
                    _element.ProcessClick (_slot, MouseState.SingleClick);
                }
            }
        }
    
    }
    
  • Ah thank you for this!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.