cutscene in start scene

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: cutscene in start scene

Post by Tony Li »

Hi,

Please post a screenshot of your Trigger Generic action. Include the part that plays the animation.
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: cutscene in start scene

Post by hrohibil »

Player is standing on a cube gameobject with its mesh render disabled. ON this cube i have the invector Trigger Generic Action.




User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: cutscene in start scene

Post by Tony Li »

What if you play the animation inside the conversation instead? For example, try changing the Sequence to:

Code: Select all

{{default}}; Camera(MyCameraAngle); AnimatorPlay(playerSleep)
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: cutscene in start scene

Post by hrohibil »

Yes Tony!!!

That works.....

Anyway to setup so when last node has been completed to end the animation ? Right now the animation plays longer than the text.

NOYE;:

Tony i have a script where i briefly turn on the joystick mode. Can i somehow run this script at the end of animation and also in end of node?

NOTE2:

Or better yet, how do write code so that JOYSTICK MODE IS ALWAYS ON?
I want his code SetInputDevice(PixelCrushers.InputDevice.Joystick); somehow set on end of each node so i know i regain my controls.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: cutscene in start scene

Post by Tony Li »

hrohibil wrote: Tue Jul 26, 2022 8:33 amAnyway to setup so when last node has been completed to end the animation ? Right now the animation plays longer than the text.
If you're using continue buttons and the last line is assigned to the player (i.e., blue), set the last node's Sequence to something like:

Code: Select all

required AnimatorPlay(playerIdle)@Message(Continued)
If the last line is assigned to the NPC (i.e., gray), set the Sequence to:

Code: Select all

required AnimatorPlay(playerIdle, listener)@Message(Continued)
This will play the animator state "playerIdle" when the player presses the continue button on the last node. Change "playerIdle" to the name of your animator state.
hrohibil wrote: Tue Jul 26, 2022 8:33 amOr better yet, how do write code so that JOYSTICK MODE IS ALWAYS ON?
Inspect the Dialogue Manager GameObject's Input Device Manager component. Set Input Device to Joystick. UNtick Detect Cursor Control. Clear Key Buttons To Check and Key Codes To Check so their sizes are zero.
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: cutscene in start scene

Post by hrohibil »

Two issues:


1:
The code i have in my last node is this " {{default}}; Camera(original)" how do i implement yours required AnimatorPlay(playerIdle)@Message(Continued) in the sequunser with this?


2:
As you recall from other threads, my setup with my mobile controls has me forced to have that on, else i cant use contols at all.
Which is why i had to create a little script where the end of an trigger animation fired of this code SetInputDevice(PixelCrushers.InputDevice.Joystick)
Then everything works fine. Please Tony is there somehow the last node in a dialogue can execute such code? Then i know my game works..
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: cutscene in start scene

Post by Tony Li »

hrohibil wrote: Tue Jul 26, 2022 11:29 amThe code i have in my last node is this " {{default}}; Camera(original)" how do i implement yours required AnimatorPlay(playerIdle)@Message(Continued) in the sequunser with this?
Just add the command. Make sure to separate commands with ';'

hrohibil wrote: Tue Jul 26, 2022 11:29 amAs you recall from other threads, my setup with my mobile controls has me forced to have that on, else i cant use contols at all.
Which is why i had to create a little script where the end of an trigger animation fired of this code SetInputDevice(PixelCrushers.InputDevice.Joystick)
Then everything works fine. Please Tony is there somehow the last node in a dialogue can execute such code? Then i know my game works..
Create a new script and add it to the Dialogue Manager GameObject. Add a method like:

Code: Select all

using UnityEngine;
using PixelCrushers;

public class SetJoystickAtConversationEnd : MonoBehaviour
{
    public void OnConversationEnd(Transform actor)
    {
        InputDeviceManager.instance.SetInputDevice(PixelCrushers.InputDevice.Joystick);
    }
}
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: cutscene in start scene

Post by hrohibil »

Thank you so much Tony...

You have been a true master solve maker in everything.

One last request on this thread then we can close it :-)

While the animation is running {{default}}; Camera(MyCameraAngle); AnimatorPlay(playerSleep)
Is there a way to lock movement during that animation? Right now while he plays it i can still move him.

Thank you Tony
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: cutscene in start scene

Post by Tony Li »

Make sure your conversation's Actor is set to the Player actor, and that the Player GameObject is assigned to the Dialogue System Trigger's Conversation Actor field.

Your Player GameObject should also have the Dialogue System Invector bridge component, which will disable player controls during the conversation as long as the setup above is correct.
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: cutscene in start scene

Post by hrohibil »

Ok.

Is there a way to disable another gameobject while the animation plays?
Post Reply