Forum rules - please read before posting.

not able to add any actions to corrupted?? action list.

Actionlist stopped allowing me to add new actions.

I get the following error:

NullReferenceException: Object reference not set to an instance of an object
AC.ActionListEditorWindow.PerformEmptyCallBack (System.String objString) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:2287)
AC.ActionListEditorWindow.EmptyCallback (System.Object obj) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:2177)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <5ad584e208e14caaa9e6b2e6027e9204>:0)

Comments

  • What were the circumstances at the time this message started appearing?

    Open up AC's ActionListEditorWindow.cs file, and replace line 2287:

    if (currentLastAction.endings.Count == 1 && currentLastAction.endings[0].resultAction == ResultAction.Continue)
    

    with:

    if (currentLastAction != null && currentLastAction.endings.Count == 1 && currentLastAction.endings[0].resultAction == ResultAction.Continue)
    

    Does that resolve it?

  • I started getting the error after auto-arranging the action nodes several times in a row. But this is the only example I've come across. I will try copy pasting the nodes into a new actionlist.

    After replacing the line with your new code I get the following error when trying to add a new action:

    NullReferenceException: Object reference not set to an instance of an object
    AC.ActionListEditorWindow.PerformEmptyCallBack (System.String objString) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:2259)
    AC.ActionListEditorWindow.EmptyCallback (System.Object obj) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:2177)
    UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <5ad584e208e14caaa9e6b2e6027e9204>:0)

  • Copy pasting action nodes into a new actionlist cleared up the error. I will let you know if I ever run into this issue again. Thanks.

  • Spoke too soon. Tried reopening new actionlist i created and it's empty. Looks like I'll just start the actionlist from scratch.

  • It sounds like a case of the ActionList somehow becoming corrupted.

    If it crops up again, the second error can be fixed by replacing the same script's line 2259:

    if (currentAction.NumSockets == 1 && currentAction.endings[0].resultAction == ResultAction.Continue)
    

    with:

    if (currentAction != null && currentAction.NumSockets == 1 && currentAction.endings[0].resultAction == ResultAction.Continue)
    

    I will make the same changes to the next 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.