Is it possible to swap the ID of two actors? Of course not at runtime. I just don't want to delete the characters and create them again to have the ID's of the actors in a specific order that I need.
Thanks!

If you use this code in OnPrepareConversationLine, that's correct. This is because it's only considering the node; it hasn't chosen it yet. If you use the code in OnConversationLine, speakerInfo.id should be the actor ID of the current node.
I'm sorry, I don't understand. Would you please describe an example case?
Code: Select all
void OnEnable()
{
Lua.RegisterFunction("GetActualActorID", this, typeof(DialogueCharactersInfo).GetMethod("GetActualActorID"));
}
void OnDisable()
{
Lua.UnregisterFunction("GetActualActorID");
}
Code: Select all
public void GetActualActorID()
{
Debug.Log(PixelCrushers.DialogueSystem.DialogueManager.currentConversationState.subtitle.speakerInfo.id);
}
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
Debug.Log("Actor #" + subtitle.speakerInfo.id + " says: " + subtitle.formattedText.text);
}
Code: Select all
public static Subtitle m_DialogueEntry;
public void OnConversationLine(Subtitle subtitle)
{
m_DialogueEntry = subtitle;
Debug.Log("Process: " + subtitle.speakerInfo.id);
}
Code: Select all
void OnEnable()
{
Lua.RegisterFunction("GetActualActorID", this, typeof(DialogueCharactersInfo).GetMethod("GetActualActorID"));
}
void OnDisable()
{
Lua.UnregisterFunction("GetActualActorID");
}
public void GetActualActorID()
{
Debug.Log("Lua: " + ProcessActualDialogueNode.m_DialogueEntry.speakerInfo.id);
}
Code: Select all
public void OnPrepareConversationLine(DialogueEntry entry)
{
m_DialogueEntry = entry;
Debug.Log("Process: " + entry.ActorID);
}