Forum rules - please read before posting.

Custom Actions ActionList Assets Throwing Error

I'm not sure if this is because my action lists were created on v1.69.5 and I've imported into a project using v1.70.4.

I have custom actions being referenced by actionlist assets which are throwing an error and not working correctly in the editor, after an import into a newer project.

NullReferenceException: Object reference not set to an instance of an object AC.ActionsManager.GetActionTypeIndex (AC.Action _action) (at Assets/AdventureCreator/Scripts/Managers/ActionsManager.cs:638) AC.ActionListAssetEditor.OnInspectorGUI () (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListAssetEditor.cs:131) UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Can anybody advise on this? These action lists are quite long and complex and it would be a shame if I have to update these every major update.

Thanks.

Comments

  • Simply upgrading AC itself should not, in general, cause issues with ActionLists. That one was made with a previous version should not be the issue.

    However, if an ActionList contains a custom Action that is no longer installed in the Actions Manager, then you will get an error. As part of the upcoming v1.71 update, I am looking to stop this error from breaking ActionLists - but a deleted custom Action will still remain so.

    What exactly were your steps in bringing about this error? Are your custom Actions still listed in the Actions Manager?

    The line the error refers to is line 638 of ActionsManager:

    string className = _action.GetType ().ToString ();
    

    Try inserting the following just above it:

    if (_action == null) return defaultClass;
    
  • All of my custom actions are in the same directory on the newer project, and are being referenced correctly by AC. I can access them fine from a new action list asset, I have recreated a broken one to make sure.

    To recreate this I'm just importing the action list after the custom actions scripts are installed, then selecting an action list which uses a custom action and it will constantly throw this error when I move my mouse in the editor.

  • After adding the code I'm now getting this error

    NullReferenceException: Object reference not set to an instance of an object AC.ActionListAssetEditor.RebuildAction (AC.Action action, System.Int32 typeIndex, AC.ActionListAsset _target, System.Int32 insertIndex, AC.ActionEnd _end) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListAssetEditor.cs:225) AC.ActionListAssetEditor.OnInspectorGUI () (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListAssetEditor.cs:135) UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

  • I think this may be a case of dealing with one error causes another.

    It would be best for me to experience this myself. Can you share a test package / stripped-down project via PM that lets me see the issue first-hand?

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.