Make SequencerCommand.cs GetSubject() prioritize children

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Make SequencerCommand.cs GetSubject() prioritize children

Post by Strook »

Hello!

Im having an issue right now using shared dialogue:

- I have one dialogue that used by multiple characters. I've assigned a generic actor from the Database. In this dialogue I have a lot sequencers command (AnimatorPlay, CinemachinePriority, LookAt, Timeline...)

-In my scenes I have multiples actors (with their hierarchy containing animators, virtual cams, transform used for sequences,...). Those actors each have a Dialogue Actor component with a unique name.

-I start this conversation assigning the transform of this unique actor from script like this:

Code: Select all

DialogueManager.StartConversation(targetConversation, this.transform, this.transform,entry);
It worked fine when I have had one instance of those actor in the scene. However with multiple ones, I start to get weird results.
For example if my sequence is :

Code: Select all

 CinemachinePriority(CM actorCam1, 999);
I was expecting the priority of the camera name "CM actorCam1" thats also a child of the current speaker to be changed, but unfortunately that's not what happens: it changes the priority of another random camera with the same name in my scene. Same thing for other sequencer commands like AnimatorPlay.


So my question is: Can I (and should I?) change the way the GetSubject() methods work in the SequencerCommand.cs, to try and first look for an transform with a matching name in children of the speaker first?

Thank you!
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Make SequencerCommand.cs GetSubject() prioritize children

Post by Tony Li »

Hi,

Can you give each vcam a unique name containing the actor's name?

For example, say you have actors "Ann", "Bob", and "Carl".

Name their vcam GameObjects "CM Ann 1", "CM Bob 1", and "CM Carl 1".

Then use this sequencer command:

Code: Select all

CinemachinePriority(CM [var=Conversant] 1, 999);
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: Make SequencerCommand.cs GetSubject() prioritize children

Post by Strook »

That could work indeed!

I would still love it they could share the same name (Its not only VCam, but also animator, objects with timelines and such), but I think you answer is probably the intended way sequences are meant to be used with shared dialogue and unique actors right?
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Make SequencerCommand.cs GetSubject() prioritize children

Post by Tony Li »

In most cases, you can specify a subject using a path, like: "Ann/CM actorCam1" or "Bob/CM actorCam1".
User avatar
Strook
Posts: 70
Joined: Fri Nov 08, 2019 10:51 am

Re: Make SequencerCommand.cs GetSubject() prioritize children

Post by Strook »

wow! :o

So in theory, this should work:

[var=Conversant]/mytargetObject

Thanks a lot for the Help Tony, that was really helpful
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
Post Reply