Best way to set model state?
Best way to set model state?
Hi,
I am changing 3 things based on each dialogue node.
1. Animator' animation of 3d model
2. Facial expression - I have a custom component that sets "angry"/"smile" etc
3. Additional emote fx - sweat, exclamation mark and etc
What is the best way to implement these in Dialogue System? I didn't find any tutorial for it so wanted to get it right from the start. Let me know if I have missed any good resources that are already available!
I am changing 3 things based on each dialogue node.
1. Animator' animation of 3d model
2. Facial expression - I have a custom component that sets "angry"/"smile" etc
3. Additional emote fx - sweat, exclamation mark and etc
What is the best way to implement these in Dialogue System? I didn't find any tutorial for it so wanted to get it right from the start. Let me know if I have missed any good resources that are already available!
Re: Best way to set model state?
Hi,
Cutscene sequences were designed for that. (Tutorial series)
Sequences are very flexible and have a lot of options, including shortcuts and custom sequences. If you have any questions, just let me know.
Cutscene sequences were designed for that. (Tutorial series)
Sequences are very flexible and have a lot of options, including shortcuts and custom sequences. If you have any questions, just let me know.
Re: Best way to set model state?
Great- Watching through it and I love the ideas/implementations.
One quick question-
Would Message "Done" or any custom message from Node can be propagated to the regular script? so I can subscribe?
Like opposite way of
One quick question-
Would Message "Done" or any custom message from Node can be propagated to the regular script? so I can subscribe?
Like opposite way of
Code: Select all
PixelCrushers.DialogueSystem.Sequencer.Message("TouchedPlatform");
Re: Best way to set model state?
No, to send a message to a script, use the SendMessage() sequencer command, which works like the C# SendMessage() method:
Sequence:
C# script on GameObject named "Bomb":
Or you can write a custom sequencer command. For example, the Dialogue System's PlayMaker integration adds a custom sequencer command that sends a message to a PlayMaker FSM.
Sequence:
Code: Select all
SendMessage(Explode,,Bomb)
Code: Select all
public class Bomb : MonoBehaviour
{
public void Explode() { ... }
}
Re: Best way to set model state?
Great.
So youi said that the third argument of SendMessage(functionname, ,Bomb) is the game object's Name but also you stated Bomb Class as well.
Is third argument is going to be Specific game object with the Class in the scene? or Game Object with the name?
Would it send to all the GameObject with the name + GameObject with the component?
So youi said that the third argument of SendMessage(functionname, ,Bomb) is the game object's Name but also you stated Bomb Class as well.
Is third argument is going to be Specific game object with the Class in the scene? or Game Object with the name?
Would it send to all the GameObject with the name + GameObject with the component?
Re: Best way to set model state?
Like the C# SendMessage() method, it calls Bomb() on all scripts on the GameObject that have a Bomb() method.
Re: Best way to set model state?
Makes sense- very helpful -thank you!
Re: Best way to set model state?
I've called
and I have a script
I've tested attaching the component to the NPC or Dialogue Manager as well.
None worked. (which gameobject should I attach it to btw?)
Let me know what I am missing!
Code: Select all
AudioWait(VA/test/test_v02);
AnimatorTrigger(Idle);
SendMessasge(SendMsgText, ,EmotionAnimator);
Code: Select all
public class EmotionAnimator : MonoBehaviour
{
public void SendMsgText()
{
Debug.Log("test");
}
}
None worked. (which gameobject should I attach it to btw?)
Let me know what I am missing!
Re: Best way to set model state?
The third parameter to the SendMessage() sequencer command must be a GameObject name or the special keyword 'speaker' or 'listener'. For example, if your NPC's GameObject is named "NPC X", then use:
Code: Select all
SendMessasge(SendMsgText, , NPC X);
Re: Best way to set model state?
Any GameObject in the scene, right?
In the Dialogue Node Seqeunce Command textfield.
Code that is attached to Yuna_P
GameObject Inspector V
Still no function call happened.. What am I missing here..? hmm
In the Dialogue Node Seqeunce Command textfield.
Code: Select all
SendMessasge(SendMsgText, ,Yuna_3P);
Code: Select all
public class EmotionAnimator : MonoBehaviour
{
public void SendMsgText()
{
Debug.Log("test");
}
}