Forum rules - please read before posting.

Disable Languages

Hello Chris and AC followers!
Just one week before the release of ENCODYA... so excited!!!
There's one thing I need to fix for our first patch, which will include new languages (to be release a bit after the official release of 26th January).
The fact is: for some platforms I need to deactivate some languages, and I want to handle that maybe with a script definition in Player rather than creating two projects. For instance using "#if DISABLECHINESE". So when I build for one platform I've all the languages, when I build for another one, I deactivate some.
Now, what I'd like is to tell AC not to cycle the removed languages in the options menu. I've a Menu for Options with a Cycle element with the standard AC Cycle type: Language and I wonder what's the safest way to do that. Maybe a script in the persistent engine or just one on my first scene that tells AC to remove entirely those languages? Or, even better, one that works in the editor and remove the languages when I build...?
Any hints?
Thanks again!

Comments

  • edited January 2021

    Just uncheck visibility of language cycle in options and the player won't be able see and cycle that option. That's what I did. Make sure when you deliver your builds english active.
    Oh sorry, I see you need to deactivate for some platforms and keep for others in one build. I guess you need to check the platforms on the first start and then disable the visibility of the language cycle menu.

  • You could feasibly duplicate your Speech Manager asset file, and then - in the duplicate - remove the unwanted language(s). Then, when building only to the platform in question, use this duplicate Speech Manager instead of the original.

    This would only work if you have no more text-gathering to do, though. If you gather up new lines, you'd have to repeat the steps above.

    Alternatively, you could consider leaving the language in the build - but use a script to automatically select a different language if the unwanted one is chosen. If this occurs in the same frame, it may be that the unwanted language isn't shown in the Cycle element:

    using UnityEngine;
    using AC;
    
    public class SkipLanguage : MonoBehaviour
    {
    
        public int languageToSkip = 1;
        public int replaceWithLanguage = 0;
    
        private void OnEnable () { EventManager.OnChangeLanguage += OnChangeLanguage; }
        private void OnDisable () { EventManager.OnChangeLanguage -= OnChangeLanguage; }
    
        void OnChangeLanguage (int language)
        {
            if (language == languageToSkip)
            {
                Options.SetLanguage (replaceWithLanguage);
            }
        }
    
    }
    
  • edited January 2021

    @SkyTree yeah, the thing is having the same project for two different builds (one with all the languages, one that exclude some...) but I'll see if I can write a script that disable the visibility... I'm not sure I understood your method, can you write me a PM? thanks!

    @ChrisIceBox uhmmm interesting, haven't thought of the SpeechManager, which seems a bit "risky" though (but if I'm careful I might duplicate ONLY right before a build, keeping only the main one as my working one). The script sounds interesting, I'll try that too, but might result on a wonky cycle (for instance, if I've to remove CN and JP, replace them with EN and DE, will result on a cycle with: EN-DE-IT-ES-RU-EN-DE-|-EN-DE-IT-etc)

  • UPDATE: I think I might go for simply removing the AC cycle, having small flags buttons in the Options and disable the un-wanted language buttons via script with a #if definition when building for specific platforms. That way the language is in the build, but there's no way for the player to change it.

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.