Forum rules - please read before posting.

Options Menu

Hello!

I am start job options menu and collided a number of problems.

1) Screen resolution

I did everything according to the tutorial and it all worked. But you need to make a choice of permissions through dropdown and ran into the problem of filling and selecting rows. How can I fill in the lines in dropdown and switch the resolution to the value I need?

This is my perfect option:

I’m also wondering how can I create a list of permissions for a PC based on the supported permissions of the device?

2) Slider
My task is to adjust the sensitivity of the mouse, for this I use the recommendations given in the tutorial Screen Resolution, but it doesn’t want to work, what is my mistake?

https://drive.google.com/open?id=1q_uKGOEvtqlBXGq4YZhohekvjulbN_ML


3) Slider music and sound.
These sliders worked well until we started using them in the project FMOD, after which they stopped working, tell me if there is AC functions to solve this issue.

4) Brightness.

Perhaps there is AC a ready-made solution for screen brightness that will affect both the game and GUI?

P.S. I would like to see more information on interaction in the official documentation AC and GUI.

Thank!

«1

Comments

  • 1) Screen resolution

    I'm not sure what you're asking about how to fill in the lines in the dropdown, because that's exactly what the tutorial shows. Can you share a screenshot to show the actual issue?

    As for limiting choices to only those permitted: this is a good point. Unity does actually provide a means to detect available resolutions (see here). I shall see about updating this tutorial to incorporate this, hopefully to avoid the need to manually enter resolutions into the Menu Manager.

    2) Slider

    Your script refers to a custom "FirstPersonAIO" script, but only reads that script's value. I don't know the script's contents, but I expect you instead need to replace your Run() function with the following:

    override public float Run()
    {
    
        float sensitivity = GlobalVariables.GetFloatValue (2);
        Player.GetComponent<FirstPersonAIO>().mouseSensitivity = sensitivity;
    
        return 0f;
    }
    

    3) Slider music and sound

    AC uses Unity's own audio components for sound. It does not support FMOD. Custom Actions, however, can be written to trigger FMOD sound components.

    Brightness

    There's no standard way to control brightness - you could use Unity's Post Processing Stack, a full-screen shader attached to the camera, etc. Once you have a separate script/means of controlling brightness, you can then follow steps similar to the screen-resolution option tutorial to integrate it into your Options menu.

    I would like to see more information on interaction in the official documentation AC and GUI.

    Can you elaborate? Which aspect on Interactions in particular? With the different interaction methods and Hotspot fields, this is a wide-ranging topic.

  • I'm not sure what you're asking about how to fill in the lines in the dropdown, because that's exactly what the tutorial shows. Can you share a screenshot to show the actual issue?

    As for limiting choices to only those permitted: this is a good point. Unity does actually provide a means to detect available resolutions (see here). I shall see about updating this tutorial to incorporate this, hopefully to avoid the need to manually enter resolutions into the Menu Manager.

    I just have a question with filling in the lines, because if button everything worked, then it dropdown doesn’t work.





  • You'll need to create the same number of Options in the Dropdown as you have in the Cycle element. AC will override their labels, but they need to exist first.

    I've updated the tutorial to be dynamic, so that the Cycle's options are set at runtime according to Unity's Screen.resolutions array.

    To incorporate a Dropdown here, you'll need to set the number of Dropdown options through script - because how many options you have will depend on this array as well.

    Something like this, attached to the Dropdown GameObject, should do it:

    using UnityEngine;
    using UnityEngine.UI;
    using System.Collections.Generic;
    
    public class SetDropdownOptions : MonoBehaviour
    {
    
        void OnEnable ()
        {
            Dropdown dropdown = GetComponent <Dropdown>();
            dropdown.ClearOptions ();
            List<string> newOptions = new List<string>();
            for (int i=0; i<Screen.resolutions.Length; i++)
            {
                newOptions.Add ("New option");
            }
            dropdown.AddOptions (newOptions);
        }
    
    }
    
  • edited October 2019

    Hi!

    I continue to work on the settings menu. And I have some problems with the slider:

    https://i.gyazo.com/a678827b17b5a9e8c9d915f4509e41f4.mp4
    https://i.gyazo.com/29a45d9822126a756c9fa33486cb7074.mp4
    https://i.gyazo.com/87316e809d795f0b32e9b974fee14039.mp4

    The slider resets the value to the maximum, while during the video recording a strange feature is noticed that if this is the first click, it remembers the desired value.

    For the purity of the experiment, I checked it in the build, but there even with switching to another screen it does not remember the desired value. I apply scripts.

    Music Setting Fmod:

    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class Music_Setting : Action
        {
            public enum MusicSetting { MusicValue, SFXValue, MuteSound };
            public MusicSetting musicSetting = MusicSetting.MusicValue;
    
            FMOD.Studio.Bus MasterBus;
            FMOD.Studio.Bus SFXBus;
            FMOD.Studio.Bus MusicBus;
    
            float MasterVolue = 1.0f;
    
            public Music_Setting()
            {
                this.isDisplayed = true;
                category = ActionCategory.Engine;
                title = "Music_Setting";
                description = "Music Setting";
            }
    
            override public float Run()
            {
    
                MasterBus = FMODUnity.RuntimeManager.GetBus("bus:/Master");
                MusicBus = FMODUnity.RuntimeManager.GetBus("bus:/Master/Music");
                SFXBus = FMODUnity.RuntimeManager.GetBus("bus:/Master/SFX");
    
                float SFXValue = GlobalVariables.GetFloatValue(4);
                float MusicValue = GlobalVariables.GetFloatValue(5);
                bool MuteSound = GlobalVariables.GetBooleanValue(3);
    
                if (musicSetting == MusicSetting.MusicValue)
                {
                    MusicBus.setVolume(MusicValue);
                }
    
                if (musicSetting == MusicSetting.SFXValue)
                {
                    SFXBus.setVolume(SFXValue);
                }
    
                if (musicSetting == MusicSetting.MuteSound)
                {
                    if (MuteSound == true)
                    {
                        MasterVolue = 0;
                        MasterBus.setVolume(MasterVolue);
                    }
    
                    if (MuteSound == false)
                    {
                        MasterVolue = 1;
                        MasterBus.setVolume(MasterVolue);
                    }
                }
    
              //  AC.KickStarter.playerMenus.RecalculateAll();
                return 0f;
            }
    
    
            override public void Skip()
            {
    
                Run();
            }
    
    
    #if UNITY_EDITOR
    
            override public void ShowGUI()
            {
                musicSetting = (MusicSetting)EditorGUILayout.EnumPopup("Music Setting:", musicSetting);
                AfterRunningOption();
            }
    
    
            public override string SetLabel()
            {
                string labelAdd = "";
                return labelAdd;
            }
    
    #endif
    
        }
    
    }
    

    Mouse Sensetive

    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class MouseSensetive : Action
        {
            private GameObject Player;
            public MouseSensetive()
            {
                this.isDisplayed = true;
                category = ActionCategory.Engine;
                title = "MouseSensetive";
                description = "Mouse Sensetive";
            }
           
            override public float Run()
            {
                Player = GameObject.FindWithTag("Player");
                float sensitivity = GlobalVariables.GetFloatValue(2);
                Player.GetComponent<FirstPersonAIO>().mouseSensitivity = sensitivity;
                return 0f;
            }
    
            override public void Skip()
            {
    
                Run();
            }
    
    
    #if UNITY_EDITOR
    
            override public void ShowGUI()
            {
    
                AfterRunningOption();
            }
    
    
            public override string SetLabel()
            {
                string labelAdd = "";
                return labelAdd;
            }
    
    #endif
    
        }
    
    }
    

    Screen:



    This is for the slider. Above you asked about more detailed documentation, I would like to see in the official documentation or manual a more detailed analysis of how to interact with the sliders and dropdown in bundles Unity and AC.

    About your code higher screen resolution. Yes, it allows me to fill out dropdown items GUI but I don’t understand how can I fill them in AC Variables and moreover, how do I assign the desired value to the screen.

    I also noticed an unpleasant work situation GUI when the mouse cursor resets to the center of the screen after processing the action, and I do not quite understand what this is connected with.

    https://i.gyazo.com/246a02224bf43d87704519f1cf972f7b.mp4

  • edited October 2019

    I also noticed an unpleasant work situation GUI when the mouse cursor resets to the center of the screen after processing the action, and I do not quite understand what this is connected with.

    I wonder if this is key to the values being set to their maximum, because I can't see anything wrong from the screenshots. As the sliders are all on the left side of the screen, perhaps they're being set to the maximum because the cursor is centred - to the right of the sliders.

    Are you using the mouse cursor, and is this rendered with Software or Hardware? Unless you're overriding it's position with a custom script, the only time the mouse cursor should get centred is if it gets locked. You don't have the "Toggle Cursor" input mapped to anything in Unity's Input Manager? The ActionList that runs upon clicking should also be set to "Run In Background".

    About your code higher screen resolution. Yes, it allows me to fill out dropdown items GUI but I don’t understand how can I fill them in AC Variables and moreover, how do I assign the desired value to the screen.

    The dropdown labels should get assigned automatically via the script covered in the tutorial. Have you been through it since it was updated?

    It's very difficult to analyse such issues from screenshots and gifs alone. It's probably best to see this for myself, if you can create a unitypackage file of only the assets necessary to experience them.

  • Uploaded files: https://drive.google.com/open?id=120Tcl1c7NRKlrtnJhHlpzXwU0pUzeovR

    I wonder if this is key to the values being set to their maximum, because I can't see anything wrong from the screenshots. As the sliders are all on the left side of the screen, perhaps they're being set to the maximum because the cursor is centred - to the right of the sliders.

    Are you using the mouse cursor, and is this rendered with Software or Hardware? Unless you're overriding it's position with a custom script, the only time the mouse cursor should get centred is if it gets locked. You don't have the "Toggle Cursor" input mapped to anything in Unity's Input Manager? The ActionList that runs upon clicking should also be set to "Run In Background".

    Thanks, really it was in the settings.

    The dropdown labels should get assigned automatically via the script covered in the tutorial. Have you been through it since it was updated?

    It's very difficult to analyse such issues from screenshots and gifs alone. It's probably best to see this for myself, if you can create a unitypackage file of only the assets necessary to experience them.

    Yes, I went through all the steps in the lesson. But as I understand it, it is made on the principle that we have a value of 0 in the value of the button, and the same value in "Choice" and if this button is pressed, select the desired value.

    When working with a new script when we automatically fill dropdown i don't know how to fill "Choice" in AC MenuManager. And correspondingly ActionScript does not work.

  • Open up MenuCycle.cs, and remove the null-check for uiDropdown on line 189:

    if (uiDropdown != null)
    
  • Hi Chris!

    Final code on Dropdown "Screen Resolution" It turned out the following, maybe useful in the new tutorial:

    using UnityEngine;
    using UnityEngine.UI;
    using System.Collections.Generic;
    using AC;
    
    public class SetDropdownOptions : MonoBehaviour
    {
        Resolution[] rsl;
        List<string> resolutions;
    
        void OnEnable()
        {
            Dropdown dropdown = GetComponent<Dropdown>();
            resolutions = new List<string>();
            rsl = Screen.resolutions;
            foreach (var i in rsl)
            {
                resolutions.Add(i.width + "x" + i.height);
            }
            dropdown.ClearOptions();
            dropdown.AddOptions(resolutions);
            dropdown.value = GlobalVariables.GetVariable(0).IntegerValue;
        }
    
        public void Resolution(int r)
        {
            Screen.SetResolution(rsl[r].width, rsl[r].height, Screen.fullScreen);
        }
    }
    

    I have the following question, above so that we have sliders working, we canceled lock and hide cursor. But I need the cursor in the game to be lock and hide but my attempts lock and hide cursor across script character controller failed. How can this be resolved?

  • You can manually lock the cursor through script with:

    AC.KickStarter.playerInput.SetInGameCursorState (true);
    

    If you want to alter the state of the Hide cursor when locked in screen's centre? field at runtime, you can get an API reference to it by right-clicking the field's label. This is true of all Manager fields:

    AC.KickStarter.settingsManager.hideLockedCursor = true;
    

    Just be aware that changes made to Manager fields will surive restarting the game executable, so you should set this to your desired default value when the game begins as well.

  • Hi Chris!

    Tell me, is AC there solution for QTE with a full rotation of the stick around its axis? As it was in Tomb Rider and Heavy Rain. QTE where you want to track the sequence of clicks: Axis or Button.

    Thanks!

  • is AC there solution for QTE with a full rotation of the stick around its axis?

    No, but I can consider if this will be possible to add.

    QTE where you want to track the sequence of clicks: Axis or Button.

    You could have a "sequence" QTE by lining up a series of short single-button QTEs.

  • edited February 2020

    Hi Chris!

    I use the standard menu with the save / load screen in the project. The problem is that the game only loads when you click on the picture, and I would like the game to load when I click on both the picture and text.

  • That's just down to how your UI is set up - it's not AC related.

    Move your Button's Image component to a child GameObject alongside the Text. The Button's RectTransform can then span both the image and label.

  • edited February 2020

    I don’t quite understand you, I’ll try to work on this issue again. It doesn’t work out yet.

    Chris, I encountered such a problem that AK loads the text when the scene loads (I mean translating the text into other languages). But my part of the text is turned off (AC triggers with dialogs), and turn on only after a certain event. Tell me how can I solve this problem, is it possible to download them initially, and then turn off or update the language?

    https://i.gyazo.com/e2c2d6230846afa27cdd4f169d323224.mp4

    Can I check to save the game or not from the code?

  • I don’t quite understand you, I’ll try to work on this issue again.

    Each slot of the AC SavesList element is linked to a separate Button component in your UI prefab. A Button typically has an Image component on the same GameObject, but it doesn't need to be - it can be a child instead.

    Move the Image component to a child of the Button. The Text component should already be such a child similarly. If you then re-shape the Button's RectTransform, so that it covers both the image and the text, clicking either should load the save game.

    I encountered such a problem that AK loads the text when the scene loads (I mean translating the text into other languages).

    These aren't subtitle menus but displayed separately? You can run a Menu: Change state Action to lock them / turn them off once loading a save game by assigning an ActionList after loading in the SavesList element's properties.

    Can I check to save the game or not from the code?

    As in, check if it's currently possible to save (restricted by e.g. in a Cutscene)?

    You can do this using either the Save: Check Action, or through code:

    bool canSave = !AC.PlayerMenus.IsSavingLocked ();
    
  • Each slot of the AC SavesList element is linked to a separate Button component in your UI prefab. A Button typically has an Image component on the same GameObject, but it doesn't need to be - it can be a child instead.

    Move the Image component to a child of the Button. The Text component should already be such a child similarly. If you then re-shape the Button's RectTransform, so that it covers both the image and the text, clicking either should load the save game.

    Thanks, that helped. Although I couldn’t make the text interactive (color change).

    These aren't subtitle menus but displayed separately? You can run a Menu: Change state Action to lock them / turn them off once loading a save game by assigning an ActionList after loading in the SavesList element's properties.

    This also applies to individual menus in the form of prefabs and subtitles. Yes, you can really do this, but in my situation it will be somewhat problematic, so there is no way to update the text relative to the current language after loading the scene?

    As in, check if it's currently possible to save (restricted by e.g. in a Cutscene)?

    You can do this using either the Save: Check Action, or through code:

    Sorry for the inaccurate question posed. No, this is not what I need. I have a “Continue” button in the main menu, which I would like to deactivate if there are no saves. And it is also desirable to do this using code.

  • Although I couldn’t make the text interactive (color change).

    Set the "Target Graphic" to the Text, or rely on Animation-based transitions for full control.

    Yes, you can really do this, but in my situation it will be somewhat problematic, so there is no way to update the text relative to the current language after loading the scene?

    What's the actual situation, then? I'm really not clear on what type of text / menu you're referring to here.

    Through code, though, you can hook into the OnFinishLoading event and call the GetTranslation function to get text for a given Speech Manager ID in a given language:

    private void OnEnable () { EventManager.OnFinishLoading += OnFinishLoading; }
    private void OnDisable () { EventManager.OnFinishLoading -= OnFinishLoading; }
    
    private void OnFinishLoading ()
    {
        // The save file has been loaded
        int speechLineID = 50; // For example
        string myText = "Current text"; // For example
        string newText = KickStarter.runtimeLanguages.GetTranslation (myText, speechLineID, Options.GetLanguage ());
    }
    

    I have a “Continue” button in the main menu, which I would like to deactivate if there are no saves

    You can get the number of save game files with:

    int numSaves = KickStarter.saveSystem.GetNumSaves ();
    
  • edited February 2020

    Hi,

    I wanted to get this kind of audio effect during the dialogue:


    If I understand correctly, this menu is responsible for this. But unfortunately we use FMOD, where we can find access to this menu to reconfigure it to FMOD?

  • Text-scrolling audio is played via the Dialog script's PlayScrollAudio function. I can see about virtualising this so that you can override it via subclassing.

  • Chris, tell me if we can make the change of language instant. Standard system used AC?

    https://i.gyazo.com/936ee96a4588443ac4df5551ea482c54.mp4

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.