When the Dialogue System prepares a bark, it sets four Dialogue System Lua variables:
- Variable["Actor"]: The display name actor in the dialogue database that is associated with the barker.
- Variable["ActorIndex"]: The index into the Actor[] table for the barker.
- Variable["Conversant"]: The display name associated with the actor being barked at. (The bark target.)
- Variable["ConversantIndex"]: The index into the Actor[] table for the bark target.
Code: Select all
string barkerName = DialogueLua.GetVariable("Actor").asString;
Code: Select all
// Procedurally generate a barker:
string barkerName = GenerateRandomName();
GameObject barkerGO = new GameObject(barkerName);
DialogueActor dialogueActor = barkerGO.AddComponent<DialogueActor>();
dialogueActor.actor = barkerName;
CharacterInfo.RegisterActorTransform(barkerName, barkerGO.transform);
Code: Select all
string barkerName = DialogueLua.GetVariable("Actor").asString;
Transform barkerTransform = CharacterInfo.GetRegisteredActorTransform(barkerName);