Forum rules - please read before posting.

Next/previous buttons in conversation menu...

I've adapted the default conversation menu using the Unity UI, and added next/previous buttons to it to scroll through dialogue options. The list understands that the maximum number of slots is 4, and I initially set the buttons to Only Show When Effective

When running the game, only the Next button appears, and when it reaches the bottom of the list, produces an error.

IndexOutOfRangeException: Array index is out of range.
AC.MenuDialogList.RecalculateSize (MenuSource source) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuDialogList.cs:465)
AC.MenuButton.ProcessClick (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuButton.cs:537)
AC.MenuElement.ProcessClickUI (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:230)
AC.MenuElement+<CreateUIEvent>c__AnonStorey1B.<>m__2 () (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:196)
UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:153)
UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:630)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:765)
UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
UnityEngine.EventSystems.EventSystem:Update()


I unselected Only Show When Effective, and the buttons both appear, and both function as expected, but the Next button still produces the same error at the bottom of the list. Have I forgotten to set something, or is this the result of the UnityUI system malfunctioning?

Thank you!

Comments

  • Please use the latest version before posting console errors, as the line numbers will be wrong otherwise.

    Does the Menu work if you switch its Source back to Adventure Creator?  We'll know the problem lies with Unity UI if so.
  • Ah, a new version!

    Okay, having updated, here's what the error is producing.

    IndexOutOfRangeException: Array index is out of range.
    AC.MenuDialogList.RecalculateSize (MenuSource source) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuDialogList.cs:465)
    AC.MenuButton.ProcessClick (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuButton.cs:537)
    AC.MenuElement.ProcessClickUI (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:230)
    AC.MenuElement+<CreateUIEvent>c__AnonStorey1B.<>m__2 () (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:196)
    UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:153)
    UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:630)
    UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:765)
    UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
    UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
    UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
    UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
    UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
    UnityEngine.EventSystems.EventSystem:Update()


    I switched it over to Adventure Creator menu, and the buttons appear and disappear as they're expected to, and the issue persists in the Unity UI mode.
  • Thanks, I'll try to recreate and will post if I need more info.
  • The problem appears to be with the Mark options already used? option - try unchecking it until a fix is issued.
  • Hey, this seems really interesting, if you get it working I wouldn't mind if you shared :)
  • edited August 2016
    Hm. Switching the Mark options already used? off has half-fixed it; the next button no longer appears at the bottom of the list (and therefore the error in the console doesn't manifest), but the previous button still doesn't show up.
  • What do you mean by "previous button"?  Screenshots to illustrate would be handy.
  • Apologies, the last issue was me being silly - I seem to have disabled the button in the hierarchy. It's now working as expected with the Mark options already used? switched off.
  • Expect a fix in v1.53a.
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.