Forum rules - please read before posting.

Action list creation problem


Hi,

sorry if this has been answered somewhere, couldn't find anything through the search box.

Getting an error when clicking "Create" an Inventory interaction. Also, when I create an Action List manually (Create>Adventure Creator>ActionList), I can create one action, but others just disappear. Unity says "importing small assets" and the action vanishes.

I'm on 2018.2.0f2 
AC 1.65.2

Here is the error log when creating inventory interaction


ArgumentException: parsing "[^\w\_]" - Unrecognized escape sequence \_.
System.Text.RegularExpressions.RegexParser.ScanCharEscape () (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Text.RegularExpressions.RegexParser.ScanCharClass (System.Boolean caseInsensitive, System.Boolean scanOnly) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Text.RegularExpressions.RegexParser.CountCaptures () (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Text.RegularExpressions.RegexParser.Parse (System.String re, System.Text.RegularExpressions.RegexOptions op) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Text.RegularExpressions.Regex..ctor (System.String pattern, System.Text.RegularExpressions.RegexOptions options, System.TimeSpan matchTimeout, System.Boolean useCache) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Text.RegularExpressions.Regex.Replace (System.String input, System.String pattern, System.String replacement, System.Text.RegularExpressions.RegexOptions options, System.TimeSpan matchTimeout) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Text.RegularExpressions.Regex.Replace (System.String input, System.String pattern, System.String replacement) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
AC.ActionListAssetMenu.AssetGUI (System.String label, AC.ActionListAsset actionListAsset, System.String defaultName, System.String api, System.String tooltip) (at Assets/AdventureCreator/Scripts/ActionList/ActionListAsset.cs:263)
AC.InventoryManager.ItemsGUI () (at Assets/AdventureCreator/Scripts/Managers/InventoryManager.cs:356)
AC.InventoryManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/InventoryManager.cs:156)
AC.AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:244)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:261)
UnityEditor.DockArea.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:390)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, System.Boolean isComputingLayout) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:237)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:380)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:359)
UnityEngine.Experimental.UIElements.EventDispatcher.DispatchEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:260)
UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:243)
UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:74)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:171)

Comments

  • Re: Inventory - what's the name of your item?

    Re: ActionList - can't recreate.  Any Console messages associated with this?  What platform are you working on and building to?
  • Hi, thanks for the quick reply. 

    Doesn't matter which Inventory item. I tried different names, removing spaces etc...
    Also tried renaming Inventory manager to no avail. 

    No console message with the ActionList problem I'm afraid. 

    Working on MacOS Mojave 10.14.1 and building to PC, Mac & Linux standalone. 

    I'm disabling Metal Editor Support in the Player Settings, but the problem persists even when it's enabled. 

    Also tried reimporting AC, but no luck.

    Creating scene action lists works seamlessly, though.

  • edited November 2018
    As I can't recreate these issues, I'll need you to do a bit of debugging if you don't mind.

    In ActionListAsset.cs, find line 263:

    defaultName = System.Text.RegularExpressions.Regex.Replace (defaultName, "[^\\w\\_]", "");

    And replace it with:

    defaultName = System.Text.RegularExpressions.Regex.Replace (defaultName, "[^\\w\\._]", "");

    Do either of the two issues resolve?

    About the ActionList issue: can you share more detail?  If you modify the first Action, what happens to that?  Are you working in the Inspector or ActionList Editor window?

    There's no other reports of these issues, and I can't recreate, so it may be unique to your system.  Can you share your project's Editor Settings?

    It may be a Mojave issue - are you able to revert back to High Sierra to confirm?
  • Hi again,

    very happy to debug, but unfortunately it didn't work.

    However, I decided to try upgrading Unity to 2018.3 beta and the problem just went away!

    So sorry couldn't find a solution, but everything's fine now :)







  • edited November 2018
    Glad to hear it.  Both issues?  Odd - it could be a bug with Unity.

    As a final double-check, would you mind reverting the line change above back to its original state?
  • So I downgraded back to 2018.2.17f1 and the issues came back.

    BUT after modifying ActionListAssets.cs as you suggested, the problem went away again.

  • So the change works in 2018.2.17f1, but not in 2018.2.0f2. Odd, could well be a Unity issue in that case.

  • Yup looks like it is - also I forgot to say thanks for the help again!

  • Just wanna report that I get an identical error when trying to create an inventory item interaction in 2018.2.16f1 with and without fix, it does however work with fix in 2018.2.18f1.

  • Thank you for the feedback, @harald921.

  • I'm working in 2018.3 and was having the same issue as OP. I changed that line in ActionListAssets.cs and it works now. Just fyi.

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.