Forum rules - please read before posting.

Direct Control: Keyboard or Controller: Crash when Options menu opens.

Hi!, sorry to bother you guys yet again (I still have a few other questions, but they'll have they're own post xD). Anyways, I'm getting an error when I try to open the Options menu, but it only happens when I'm in direct control, using the Keyboard or Controller option. The only thing I've changed in the Options menu is the addition of a Controls button that opens another menu. But as I said, it only happens when Using the Keyboard or Controller setting, else it works flawlessly, so, I'm stumped, I'm not sure what I've done wrong, or if I've missed creating some input or something...

By the way this is the error:

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[AC.MenuElement].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
AC.Menu.ControlSelected (Int32 selected_option) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/Menu.cs:2044)
AC.PlayerInput.InputControlMenu (AC.Menu menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:2180)
AC.PlayerMenus.UpdateMenu (AC.Menu menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:708)
AC.PlayerMenus.UpdateAllMenus () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1412)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:307)

Anyways, as always, any advice would be greatly appreciated.

Comments

  • edited April 2016
    Just as an Update, it seems to happen when, in an ActionList, I call the menu used solely to pause the game (the one you're told to make in the title menu tutorial - which in this case I called FreezeGameplay), if I remove that step the error stops.

    I had the error happening in two buttons, one for the load button, which isn't a problem (just removed the step and clicked Pause during game play). Problem is: the "Controls" button, by way of Object: Send message, is calling a custom UI (rewired controlmapper - with a script on the "Done" button to call an action script to reopen the options once you're done using it), but if I don't call the FreezeGamplay menu the game obviously doesn't pause for that menu... funny thing is, it works flawlessly when using Direct control: Keyboard and mouse... Is there any other way to pause the game? I've seen the scripting guide, saw two methods (one related to the camera, the other to sceneSettings) but I don't know how to use them... I'll try giving it a shot again to connect the menus the normal way, but the Control mapper is kinda complex, and has many dynamic buttons and stuff (and I'm still a noob on UnityGUI), so I'm not even sure what equal elements to use in AC to connect them...
  • So this is a Unity UI menu rather than an AC one?

    If you're involving custom scripts, it's best to remove them until you've got this working - as we need to eliminate the possibility that they're what's causing the issue.  If you revert back to the original Options menu, does the issue persist?

    Please also be sure to update to the latest release of AC - it's important when posting console messages as the line endings must be correct.
  • Alright, I'll try removing it temporarily, and anyways, I am re-structuring all of the menus so I'll try to verify if I left any actions hanging, just in case.
  • Hey, I figured it out. I noticed while creating my other menus and linking them. Basically, I get the crash when I try to open any AC menu which contains nothing (like the pause/freeze gameplay from the tutorial). All I had to do was create a button or an empty label and the error was gone. Dunno why it happens, but mind you, I'm using version v1.51d.  Updating plugins always gives me the jeebies...

    Anyways, all's good now!
  • edited May 2016
    Sorry wrong post
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.