Animator state issues

Announcements, support questions, and discussion for the Dialogue System.
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Animator state issues

Post by soniclinkerman »

Hey! I just picked this up yesterday!

I want the player animation state to change depending on the node, but for some reason, its not switching.

Here's my scene
Scene example.png
Scene example.png (485.3 KiB) Viewed 501 times
I simply want the character to change sprite color when they talk.


I thought doing

Code: Select all

AnimatorPlay(Talking)
in sequence would do the trick, but it looks as if it's not even recognizing the animator at all

Here's my Inspector
Inspector 1.png
Inspector 1.png (95.53 KiB) Viewed 501 times
Furthermore, I would like the "text box:: only to appear when a character is talking. Here's an example image of what I mean
Scene example 2.png
Scene example 2.png (464.44 KiB) Viewed 501 times

The image above is what I pretty much want the final product to look like, every character becomes dark except for the one talking and the text box becomes visible for them ONLY if they are talking.

Thanks!
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animator state issues

Post by Tony Li »

Hi,

Thanks for getting the Dialogue System!

The Dialogue System Extras page has a patch that improves the VN Template Standard Dialogue UI to darken portrait images more nicely. (direct download) I recommend importing the patch and checking out the VN prefab. The improvements in this patch are also in the upcoming version 2.2.16.

This sequence:

Code: Select all

AnimatorPlay(Talking)
will play the animator state "Talking" on the GameObject associated with the speaker's GameObject.

I also recommend modifying the sequence to something like this:

Code: Select all

AnimatorPlay(Talking);
required AnimatorPlay(Idle)@{{end}}
The second line will wait for a duration based on the text length, and then it will change the animator to the "Idle" state. The required keyword guarantees that it runs this command even if the player clicks ahead early. More info: Sequence Tutorials

If you want to play it the speaker's portrait image instead, take a look at the AnimatedPortraitExample scene also available on the Extras page. (direct download)

If you want to play it on the speaker's GameObject, please read Character GameObject Assignments. In general, according to the screenshot of your dialogue entry's inspector, it should look for the Animator on the "Zent" GameObject. But the conversation may use a different GameObject in various circumstances that are covered in that link.

A helpful way to figure out what's going on with sequencer commands is to temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log detailed information to the Console. Among the logs will be two lines for each sequencer command. The first line shows the result of the Dialogue System parsing the sequencer command and putting it in the queue to run. The second line appears when the command actually runs, and it shows the GameObjects, etc., that are being used for it.
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: Animator state issues

Post by soniclinkerman »

Thank you for your response.

I downloaded the extra packs you linked and am using the first one that was linked. For some reason, whenever I want the other character(Carton) to speak, nothing happens.

My dialogue db
Image 1.png
Image 1.png (729.31 KiB) Viewed 496 times
My left side portrait settings in inspector
Left Side Settings.png
Left Side Settings.png (830.81 KiB) Viewed 496 times

My dialogue Manager settings
Image 4.png
Image 4.png (817.88 KiB) Viewed 496 times

Template I downloaded from here
Image 2.png
Image 2.png (776.46 KiB) Viewed 496 times
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: Animator state issues

Post by soniclinkerman »

UPDATE


I was able to get the text to show when showing thee Player "Carton".

It was because I had "Is Player" clicked in the dialogue DB character window. The player won't be able to talk so it will only be back and forth dialogue so I guess that isn't needed.

The issue of Player highlighting is still there though. Will continue to work on it and post updates
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: Animator state issues

Post by soniclinkerman »

Ok I'm currently just running across an issue where there will only ever be 1 character image on screen when I really want 2. It seems to happen when I turn off "Is Player", is there a way I can get 2 of them on screen without having to turn on " Is Player" ?
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animator state issues

Post by Tony Li »

Hi,
soniclinkerman wrote: Thu Apr 01, 2021 12:35 amOk I'm currently just running across an issue where there will only ever be 1 character image on screen when I really want 2. It seems to happen when I turn off "Is Player", is there a way I can get 2 of them on screen without having to turn on " Is Player" ?
If I understand you correctly, here are two separate solutions:

1. For the player actor, tick Is Player. Inspect the Dialogue Manager, and UNtick Display Settings > Input Settings > Always Force Response Menu.

2. And/or add a Dialogue Actor component to the GameObject that corresponds to the Player actor. (See Character GameObject Assignments.) Set Standard UI Display Settings > Subtitle Panel Number to a different panel number, such as Panel 1.
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: Animator state issues

Post by soniclinkerman »

Hey Tony. So Unticking it seemed to work. Is there a way to have the "Player" have a "forced" dialogue.


What I mean is,

I simply want the player to act LIKE the NPC where dialogue is already determined. The player shouldn't have an option in this scenario
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: Animator state issues

Post by soniclinkerman »

***Update***


It seems if I make "isPlayer" false and switch panels(As you mentioned).

The dialogue works fine for both characters.

The last thing I need to do is simply make things lighter or darker depending on who's speaking. I replaced my previous set up with the VN package, but for some reason, the player that is meant to be talking isn't changing color like needed
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animator state issues

Post by Tony Li »

Hi,

If you can start with the 'VN Template Standard Dialogue UI' prefab, it's already configured to darken the other portraits.

Here's an example scene:

DS_VNFocusStyleDialogueUI_2021-03-23.unitypackage
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: Animator state issues

Post by soniclinkerman »

Implemented it and everything seems to work! Once I figure out how to disable player movement in "Dialogue", I should be set
Post Reply