Forum rules - please read before posting.

yarn spinner integration issue

hi, unity 6 6000.0.32f1 and adventure creator 1.83.0

maybe someone has encountered such an error:

ArgumentException: Default value  is not present in the list of possible values
UnityEngine.UIElements.PopupField`1[T]..ctor (System.String label, System.Collections.Generic.List`1[T] choices, System.String defaultValue, System.Func`2[T,TResult] formatSelectedValueCallback, System.Func`2[T,TResult] formatListItemCallback) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Controls/PopupField.cs:162)
Yarn.Unity.Editor.LanguagePopup.Create (System.String label, System.Boolean onlyNeutralCultures) (at ./Library/PackageCache/dev.yarnspinner.unity/Editor/Editors/LanguagePopup.cs:33)
Yarn.Unity.Editor.YarnProjectImporterEditor.CreateInspectorGUI () (at ./Library/PackageCache/dev.yarnspinner.unity/Editor/Editors/YarnProjectImporterEditor.cs:329)
UnityEditor.UIElements.InspectorElement.CreateInspectorElementUsingUIToolkit (UnityEditor.Editor targetEditor) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:592)
UnityEditor.UIElements.InspectorElement.CreateInspectorElementFromSerializedObject (UnityEditor.SerializedObject bindObject) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:495)
UnityEditor.UIElements.InspectorElement.HandleEventBubbleUp (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:398)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAtTargetAndDefaultPhase (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:100)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/Bindings/SerializedObjectBindingContext.cs:129)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/Bindings/SerializedObjectBindingContext.cs:139)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/Bindings/SerializedObjectBindingContext.cs:81)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Bind (UnityEngine.UIElements.VisualElement element) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/Bindings/SerializedObjectBindingContext.cs:66)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/Bindings/DefaultSerializedObjectBindingImplementation.cs:15)
UnityEditor.UIElements.BindingExtensions.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Bindings/BindingsInterface.cs:62)
UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.SerializedObject obj, UnityEditor.Editor editor, UnityEditor.UIElements.InspectorElement+DefaultInspectorFramework defaultInspectorFramework) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:328)
UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.Editor editor, UnityEditor.UIElements.InspectorElement+DefaultInspectorFramework defaultInspectorFramework) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:280)
UnityEditor.UIElements.InspectorElement..ctor (UnityEditor.Editor editor) (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:276)
UnityEditor.UIElements.EditorElement.BuildInspectorElement () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/EditorElement.cs:175)
UnityEditor.UIElements.EditorElement.CreateInspectorElement () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/EditorElement.cs:299)
UnityEditor.EditorElementUpdater.CreateInspectorElementsWithoutLayout (System.Int32 count) (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/EditorElementUpdater.cs:80)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/Core/PropertyEditor.cs:1207)
UnityEditor.InspectorWindow.RedrawFromNative () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/Core/InspectorWindow.cs:213)

The error appears if you configure AC integration and launch the dialog once.
Next, if you select the project.yarnproject file, the fields will not be available in the inspector.

! if you restart unity, the error is fixed and you can access the fields in the project.yarnproject file inspector again.

«1

Comments

  • edited April 20

    What's your YarnSpinner version? The error log makes no reference to AC - instead it looks like it's coming from YarnSpinner directly.

    To be clear: you're saying this error is only temporary - with it working after a restart?

  • What's your YarnSpinner version? The error log makes no reference to AC - instead it looks like it's coming from YarnSpinner directly.

    2.5.1

    To be clear: you're saying this error is only temporary - with it working after a restart?

    Yes, if you restart unity, everything will work fine until you start the dialog at least once.

  • I cannot reproduce such an issue with Yarn's test project in 2.5.2. Try importing the latest release - otherwise, you may need to contact the Yarn devs as I can't see AC's involvement in the above error message.

  • edited April 23

    I will contact the yarn spinner community, but first, I want to ensure that I am using the yarn spinner integration properly.

    images: https://imgur.com/a/8Gkb3HM

    [unity 6 6000.0.32f1];
    [adventure creator 1.83.0];
    [yarn spinner 2.5.1];
    [localization 1.5.1];

    I installed yarn spinner using Unity Package Manager, following this guide:
    https://docs.yarnspinner.dev/using-yarnspinner-with-unity/installation-and-setup#installing-from-other-sources

    next, I installed unity localization; I used the official yarn spinner integration for adventure creator, taken from this page:
    https://adventurecreator.org/downloads

    --- the process of error occurrence --

    when starting the game, the dialog works fine: the language change and the entire dialog work;
    then, after stopping the game, the yarn project file inspector issues errors; you can get rid of the errors by restarting unity, but after starting the game the problem returns; I note that I tried using yarn spinner versions: 2.5.0 and 3.0.0-beta2

    I note that the error does not appear if adventure creator is not imported into the project.

    the problem probably lies in adventure creator integration, yarn support's answer:

    then it might be a problem with Adventure Creator or its integration with YarnSpinner and not YarnSpinner itself. You can try to reach out to whatever resources you have with Adventure Creator for help there, but unless someone can diagnose for sure that the problem is within YarnSpinner then we can't help further in this server.

  • Thanks for the details, I've recreated the issue.

    It's hard to pinpoint where the bug lies - it could even be from within Unity itself.

    However, it does look to be caused by AC's setting of the culture, which shouldn't be an issue, but does happen by default.

    To prevent this, you can uncheck Use invariant culture for saving? in the Settings Manager's "Save game settings" panel.

  • To prevent this, you can uncheck Use invariant culture for saving? in the Settings Manager's "Save game settings" panel.

    Thank you for the instructions. They solved the problem for me. I am grateful for your help and will share information about the solution with the Yarn Spinner community.

  • @ChrisIceBox hi,

    Yarn Spinner has recently undergone a major upgrade to version 3.0. As a result, the Yarn Spinner integration is currently not working.

    Is an update to the Yarn Spinner integration expected in the near future?

  • edited June 15

    I will look into it.

  • Updated.

  • Integration is working;

    I have a global variable PlayerDress, which is responsible for the character's current outfit;

    can I change the value of this variable from the yarn spinner dialog?

  • What's the variable's type? If it's Int, Bool, Float, or String, a Yarn script should be able to access it with $PlayerDress. See the integration's Readme file for details.

  • PopUp variable: 0, 1 ... etc;

    I was reading the manual and didn't quite understand the logic, so I'm asking

    The manual says that I can use AC variables in the yarn script, but I need the opposite: to be able to assign a new value to the AC variable from the yarn script.;

    example of a dialog:

    This old closet is full of clothes, what am I going to wear?

    • a skirt with a blouse {PlayerDress = 0}
    • pants with a top {PlayerDress = 1}
  • It should be both ways - the integration lets you get and set AC variables through Yarn scripts.

    If you change PlayerDress to an Integer, does it work?

  • If you change PlayerDress to an Integer, does it work?

    nope

    title: start
    ---
    playerName: line
    <<declare $PlayerDress = 0>>
    
    -> option 1
        playerName: line 
        <<set $PlayerDress to 1>>
    -> option 2
        player: line
        <<set $PlayerDress to 0>>
    

    0 - naked
    1 - defDress

    Can you tell me if I'm doing something wrong?

  • I can't recreate the issue, but your syntax looks fine.

    Are you using the integration's EventRunner prefab? Its AC Yarn Variables compoent is required to be set as the runner's "Variable Storage Behaviour".

    I have updated the integration to work with PopUps.

  • Are you using the integration's EventRunner prefab? Its AC Yarn Variables compoent is required to be set as the runner's "Variable Storage Behaviour".

    I'm sorry, Chris, that was the case, now everything works with PopUp.

  • my player and npc are built on sprites unity complex, they have sub-state "emotions";

    since I use yarn, expressions tokens are not available to me;

    is it a good practice to create a global variable for each character, which will trigger an event that changes the value of the parameter in the animator?

    In addition to the emotions of the characters, the game has full-size art scenes that have an animator with several states, and I would also like to be able to change these states from the yarn dialog;

    My experience is not enough to choose the right direction, so I'm asking for a hint.

  • Global or Local variables are an option, but it's also a good case for the use of custom commands in your Yarn project.

  • Global or Local variables are an option, but it's also a good case for the use of custom commands in your Yarn project.

    Yes, that's what I need.


    Yarn spinner 3 features the once operator, which allows you to play a phrase only once.

    can we expect this to be supported in integration? because now the console is giving an error:

    Cannot find AC Variable of the name Yarn.Internal.Once.0cb888c7

  • I've updated the integration with support for once - stored in a new Global String variable named OnceLined.

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.