Forum rules - please read before posting.

Suddenly can't create inventory interactions

edited December 2021 in Technical Q&A

I added a new inventory item in the AC Game Editor, named it, added the Main and Active graphics, everything is working fine and I can pick it up in game and see it in the inventory menu, but when I click create on the Examine in the Standard interactions it does nothing and the console fills up :( (same for Use etc)
ArgumentException: parsing "[^\w_]" - Unrecognized escape sequence _.
System.Text.RegularExpressions.RegexParser.ScanCharEscape () (at :0)
This means nothing at all to me, hope someone can help?
Thanks in advance!

Comments

  • What are your AC and Unity versions?

    It sounds like there's an issue with the item's name. Does it contain any special characters?

    Clicking "Create" beside an Interaction is optional, however. If the button is not working for this item, you can separately create a new ActionList asset by right-clicking inside the Project window, and then drag-drop it into the Interaction field to manually assign it.

  • Thanks for the reply Chris my version is v1.60.4 I checked and checked for special characters but it seems to be no different to any of my other inventory items, I tried renaming them to something very simple and it still didn't allow me to create, so I made an action list and assigned it, but it didn't work, as if there still wasn't one. This is weird I already have 20 inventory items and they all worked fine, I haven't updated recently so there shouldn't be anything different :/

  • What is the item's name, and what is the error message in full?

    As you're using a very old AC version, it's likely this has since been fixed - what's your Unity version?

    so I made an action list and assigned it, but it didn't work, as if there still wasn't one

    Can you elaborate on this? Do any messages appear?

  • My Unity version is 2020.2.5f1
    This is the full error:
    ArgumentException: parsing "[^\w_]" - Unrecognized escape sequence _.
    System.Text.RegularExpressions.RegexParser.ScanCharEscape () (at :0)
    System.Text.RegularExpressions.RegexParser.ScanCharClass (System.Boolean caseInsensitive, System.Boolean scanOnly) (at :0)
    System.Text.RegularExpressions.RegexParser.CountCaptures () (at :0)
    System.Text.RegularExpressions.RegexParser.Parse (System.String re, System.Text.RegularExpressions.RegexOptions op) (at :0)
    System.Text.RegularExpressions.Regex..ctor (System.String pattern, System.Text.RegularExpressions.RegexOptions options, System.TimeSpan matchTimeout, System.Boolean useCache) (at :0)
    System.Text.RegularExpressions.Regex.Replace (System.String input, System.String pattern, System.String replacement, System.Text.RegularExpressions.RegexOptions options, System.TimeSpan matchTimeout) (at :0)
    System.Text.RegularExpressions.Regex.Replace (System.String input, System.String pattern, System.String replacement) (at :0)
    AC.ActionListAssetMenu.AssetGUI (System.String label, AC.ActionListAsset actionListAsset, System.String api, System.String defaultName) (at Assets/AdventureCreator/Scripts/ActionList/ActionListAsset.cs:224)
    AC.InventoryManager.ItemsGUI () (at Assets/AdventureCreator/Scripts/Managers/InventoryManager.cs:338)
    AC.InventoryManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/InventoryManager.cs:147)
    AC.AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:244)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <22954a70fcec46f29620f943d3d7bf23>:0)
    UnityEditor.DockArea.OldOnGUI () (at <22954a70fcec46f29620f943d3d7bf23>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcher.OpenGate () (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <0050475d167947ea9f166ad030caa84f>:0)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at :0)

  • The items name is Scrubbing Brush, I have other items that work fine like Silver Key, so it can't be spaces or Capital letters giving me the issue, as far as I can tell the new item is just like any other :/

  • Fixed now, found the answer in an older thread,
    Chris, you said:
    defaultName = System.Text.RegularExpressions.Regex.Replace (defaultName, "[^\w\_]", "");

    And replace it with:

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

    And that has fixed it, older version of AC I guess. Didn't know where to find that file let alone edit it so needed some help but It's fixed now :) Thanks Chris and thanks Adam

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.