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!
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:
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!