Forum rules - please read before posting.

articy integration error

Downloaded the integration and set up as instructed.

Title menu -> New Game button -> Actionlist used Object: Sends message to AC_FlowRunner's Interact method.

I could not use the Object: Call event, it won't allow me to add AC_FlowRunner to the object field.

I also noticed the Object: Sends message adds a floppy disk icon next to the AC_FlowRunner prefab.

This is the line that gives the error
_name = (speaker as IObjectWithDisplayName).DisplayName;

NullReferenceException: Object reference not set to an instance of an object
AC.Downloads.ArticyDraft.ArticyFlowPlayer.GetCharacterWithName (Articy.Unity.ArticyObject speaker) (at Assets/AdventureCreator/Downloads/ArticyDraft integration/Scripts/ArticyFlowPlayer.cs:344)
AC.Downloads.ArticyDraft.ArticyFlowPlayer.OnFlowPlayerPaused (Articy.Unity.IFlowObject aObject) (at Assets/AdventureCreator/Downloads/ArticyDraft integration/Scripts/ArticyFlowPlayer.cs:116)
Articy.Unity.ArticyFlowPlayer.OnFlowPlayerPaused (Articy.Unity.IFlowObject aObject) (at <3a5b9983721c45b5b36cea0a37baf9c3>:0)
Articy.Unity.ExecutionEngine.EnsureValidStop () (at <3a5b9983721c45b5b36cea0a37baf9c3>:0)
Articy.Unity.ExecutionEngine.Next (Articy.Unity.Branch aBranch) (at <3a5b9983721c45b5b36cea0a37baf9c3>:0)
Articy.Unity.ExecutionEngine.EnsureValidStop () (at <3a5b9983721c45b5b36cea0a37baf9c3>:0)
Articy.Unity.ExecutionEngine.set_StartNode (Articy.Unity.ArticyObject value) (at <3a5b9983721c45b5b36cea0a37baf9c3>:0)
Articy.Unity.ArticyFlowPlayer.set_StartOn (Articy.Unity.Interfaces.IArticyObject value) (at <3a5b9983721c45b5b36cea0a37baf9c3>:0)
AC.Downloads.ArticyDraft.ArticyFlowPlayer.RunFlow (Articy.Unity.Interfaces.IArticyObject articyObject) (at Assets/AdventureCreator/Downloads/ArticyDraft integration/Scripts/ArticyFlowPlayer.cs:87)
AC.Downloads.ArticyDraft.ArticyFlowRunner.Interact () (at Assets/AdventureCreator/Downloads/ArticyDraft integration/Scripts/ArticyFlowRunner.cs:24)
UnityEngine.GameObject:SendMessage(String, SendMessageOptions)
AC.ActionSendMessage:Run() (at Assets/AdventureCreator/Scripts/Actions/ActionSendMessage.cs:112)
AC.d__47:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:471)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:413)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:608)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:577)
AC.d__47:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:541)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:413)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:618)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:577)
AC.d__47:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:541)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Comments

  • I could not use the Object: Call event, it won't allow me to add AC_FlowRunner to the object field.

    You can't use the Object: Call event Action to reference an in-scene object from an ActionList asset. Object: Send message can be used in this way - the disk icon just indicates the link.

    This is the line that gives the error

    The error suggests there's no associated speaker with the "IObjectWithSpeaker" class. I've updated the integration to cater for this.

  • Thanks for the fix.
    Couple more questions
    1. After the send message to Interact, I want to move the character, but the move to to point starts during the conversation, is there a way to wait till the end of the articy convo to end the move the character?

    1. What's the best way to start different conversation? Attach the flow Flow to the NPC and assign it the AC_Flowrunner to initiate the dialogue?

    Thanks

  • After the send message to Interact, I want to move the character, but the move to to point starts during the conversation, is there a way to wait till the end of the articy convo to end the move the character?

    I have updated the package once more with a slight tweak that should allow for a custom Action to play flows, with a "Wait until finish?" option.

    Once you've imported the updated package, you can use the script below as a custom Action:

    using UnityEngine;
    using System.Collections.Generic;
    
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC.Downloads.ArticyDraft
    {
    
        public class ActionArticy : Action
        {
    
            public int constantID = 0;
            public int parameterID = -1;
            public ArticyFlowRunner runner;
    
    
            public override ActionCategory Category { get { return ActionCategory.ThirdParty; }}
            public override string Title { get { return "Articy"; }}
    
    
            public override void AssignValues (List<ActionParameter> parameters)
            {
                runner = AssignFile <ArticyFlowRunner> (parameters, parameterID, constantID, runner);
            }
    
    
            public override float Run ()
            {
                if (!isRunning)
                {
                    if (runner)
                    {
                        runner.Interact();
                    }
                    if (willWait)
                    {
                        isRunning = true;
                        return defaultPauseTime;
                    }
                    return 0f;
                }
    
                if (ArticyFlowPlayer.Instance.IsRunning)
                {
                    return defaultPauseTime;
                }
                isRunning = false;
                return 0f;
            }
    
    
            #if UNITY_EDITOR
    
            public override void ShowGUI (List<ActionParameter> parameters)
            {
                ComponentField("Flow runger:", ref runner, ref constantID, parameters, ref parameterID);
                willWait = EditorGUILayout.Toggle("Wait until finish?", willWait);
            }
    
            #endif
    
        }
    
    }
    

    What's the best way to start different conversation? Attach the flow Flow to the NPC and assign it the AC_Flowrunner to initiate the dialogue?

    The location of the flow / runner components shouldn't matter too much, but you'll need a separate AC_FlowRunner component for each Flow you wish to run.

  • edited 8:10AM

    Thanks for the code.
    It's half working.
    If a conversation is linear, the custom action ActionArticy will wait till it finishes.

    But if a conversation has a branch with options, the dialogue will stop at the branching, the dialog option UI will not show.

    I traced it till the following code in ArticyFlowPlayer

    if (conversation.options.Count > 1)
    {
    conversation.Interact ();
    KickStarter.stateHandler.EnforceCutsceneMode = false;
    }

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.