Forum rules - please read before posting.

Inventory: Change Interaction = Out of Range

Hey there,

got a new problem with AC and Unity.
I have two items in the inventory from the beginning of the game. I want to disable the combination of them at the start which works perfectly fine (I disable both, since if I left out one, I can still combine them).
Now if I want to enable the interaction again, I always get this error message:
"ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

I don't know why. Here are pics of the action(s) that causes the error as well as the whole error message:
ac

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
AC.InvInstance.SetCombineInteractionState (System.Int32 ID, System.Boolean state, System.Boolean useItemID) (at Assets/AdventureCreator/Scripts/Inventory/InvInstance.cs:1131)
AC.ActionInventoryInteraction.Run () (at Assets/AdventureCreator/Scripts/Actions/ActionInventoryInteraction.cs:81)
AC.ActionList+<RunAction>d__41.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:429)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <127e81e1cb3441cc97d26b1910daae77>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at 

Comments

  • edited February 2022
    Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:581)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:540)
        AC.<RunAction>d__41:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
        UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
        AC.ActionList:BeginActionList(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:346)
        AC.ActionList:Interact(Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:247)
        AC.ActionList:Interact() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:210)
        AC.SceneSettings:PlayStartCutscene() (at Assets/AdventureCreator/Scripts/Game engine/SceneSettings.cs:332)
        AC.SceneSettings:OnStart() (at Assets/AdventureCreator/Scripts/Game engine/SceneSettings.cs:110)
        AC.SaveSystem:InitAfterLoad() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:692)
        AC.MultiSceneChecker:Start() (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:62)
    

    (Part 2 of the error message)

  • Thanks for the bug report.

    To fix it, open up AC's InvInstance script and look for line 1131. It should currently read:

    if (InvItem.interactions[i].ID == ID)
    

    Amend this to instead read:

    if (InvItem.combineInteractions[i].ID == ID)
    

    I shall apply this fix to the official release.

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.