Forum rules - please read before posting.

Mobile Phone Menu get Input from AC

edited August 2014 in Technical Q&A
Hello,

after the player puts in an "Input" how would I get what text/number they put in either through script or to run an action.

I have a menu title, and an input box to input some numbers, then a button to acknowledge. Once the button is pressed I want to read which numbers was put in the text/input box, afterwards I will run either a custom script or a PlayMaker state with the inputed value.

thanks 

Comments

  • edited August 2014
    Here is what I have so far (and I'm still missing some brains behind it... trying to pinpoint how to get the input value xD) 

            public static void OnElementClick (Menu _menu, MenuElement _element, int _slot, int _buttonPressed)
            {
    //            Debug.Log (_element.GetType().Name); // for debug purposes only
                if(_element.GetType().Name == "MenuCycle")
                {
                MenuCycle _cycle = (MenuCycle) _element;
                Debug.Log ("Chosen option is " + _cycle.selected); // this is which option
                Debug.Log ("The current text is " + _cycle.optionsArray [_cycle.selected]); // the text if needed...
                Debug.Log ("kz cycle name: " + _cycle.name); // doesnt say...
                Debug.Log ("kz : " + _cycle.label); // nope
                Debug.Log ("kz : " + _cycle.title); // it says the cycle element name which is: kzCycle sweet
                // This function is called whenever a clickable element has a click type of "Custom Script".
                }

                else if (_element.GetType().Name == "MenuButton")
                {
                    MenuButton _button = (MenuButton) _element;
                    Debug.Log ("Button Title is: " + _button.title); // the element name
                    Debug.Log ("Button simulate value: " + _button.simulateInput); // says Button    
                    Debug.Log ("Button name is: " + _button.name); // is blank
                    Debug.Log ("ButtonPressed int? : " + _buttonPressed); // shows int 1
                    Debug.Log ("Slot? : " + _slot); // shows slot 0
                }
            }

    For some reason I think this "  'Enter' key's linked Button: " has something to do with what I'm missing, I tried entering the buttons element name in that text field and hoped once it was pressed the value would show in the debug above, but still coming out empty handed.

  • thanks that has cleared things up a bit, i will let you know if i run into any other issues. 
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.