Forum rules - please read before posting.

Get all characters from a conversation

Hi! Is there any way to get all characters that are participating in a determined conversation and their transforms?

Comments

  • As in, which characters speak in a given ActionList?

    You'd need to use scripting, but it's quite simple: just search the Actions for instances of "Dialogue: Play speech", and then extract the characters involved.

    Something like:

    public AC.Char[] GetSpeakingCharacters (AC.ActionList actionList)
    {
        List<AC.Char> speakers = new List<AC.Char> ();
    
        foreach (var action in actionList.actions)
        {
            if (action is AC.ActionSpeech)
            {
                AC.ActionSpeech actionSpeech = action as AC.ActionSpeech;
                if (actionSpeech.ReferencesPlayer ())
                {
                    if (!speakers.Contains (AC.KickStarter.player))
                    {
                        speakers.Add (AC.KickStarter.player);
                    }
                }
                else if (!speakers.Contains (actionSpeech.Speaker))
                {
                    speakers.Add (actionSpeech.Speaker);
                }
            }
        }
    
        return speakers.ToArray ();
    }
    
  • Exactly that! Thank you so much, I'm trying to add all characters in a conversation to a Target Group so I can focus all of them in a Cinemachine camera shot. You're the best!

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.