Hi, We are now working on a quite complex animation system and would like to attach data on each conversation node that when each node trigger, I can receive an information data set from dialogue system which contains actor, emotion id, animation id, etc... Most important of all, we want our artist to edit it. so we might like to modify that data easly from the inspector of the node
I know that there are sequence and script utility which is very flexable to use, but it also has the disadvantage as string. If something type wrong or maybe having need to rename method, variable name. It will be difficult to track all the conversation node that use it the keyword.
so we are wondering if there's a way for as to add one more serialized data at the buttom of the conversation node's inspector? or is there any other way that you suggest?
Receive dialogue data when each conversation node start
Re: Receive dialogue data when each conversation node start
Hi,
Yes, you can do this. Add fields to the dialogue entry template (see Templates), and tick the Main checkbox:
They will appear in the Inspector like this:
In the screenshots above, the field type is Text. You may want to change this to a dropdown menu (e.g., Emotion ID = Happy, Sad, Angry, etc.). To do that, define a Custom Field Type.
Then add a script with an OnConversationLine method to the Dialogue Manager GameObject. In this method, access the fields:
Yes, you can do this. Add fields to the dialogue entry template (see Templates), and tick the Main checkbox:
They will appear in the Inspector like this:
In the screenshots above, the field type is Text. You may want to change this to a dropdown menu (e.g., Emotion ID = Happy, Sad, Angry, etc.). To do that, define a Custom Field Type.
Then add a script with an OnConversationLine method to the Dialogue Manager GameObject. In this method, access the fields:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
string emotionID = Field.LookupValue(subtitle.dialogueEntry.fields, "Emotion ID");
// Do something with emotionID.
}
Re: Receive dialogue data when each conversation node start
Thank you! Tony!
You really explain it clearly and make it so easy to understand!
You really explain it clearly and make it so easy to understand!