Issues with spawnpoints pand sequencer (2D project)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
will_888
Posts: 26
Joined: Mon Feb 07, 2022 4:09 am

Issues with spawnpoints pand sequencer (2D project)

Post by will_888 »

Hello!
I'm getting some trouble using the Dialogue System Trigger for transitioning between scenes. The transition works fine and variables are passed between scenes (a very neat system!). However, my 2D character (custom controller made by me) NEVER spawns inside the level.

Here's my setup inside the Dialogue System Trigger component :

LoadLevel(scene_name, Spawnpoint from scene_name2)

Inside scene_name2, I've got a GameObject called Spawnpoint from scene_name

Is there possibly some solution for 2D control ready-made from the plugin I can use?

I also have another similar question:
When I'm using the same system for transition, I'm unable to play Sounds as the Action gets ignored and the character just transitions to the next scene. I was also wondering how can I play video cutscenes/display still images or animations between one scene and the other.
Thank you so much in advance for your help! I'm stuck on this and would really need a helping hand.
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issues with spawnpoints pand sequencer (2D project)

Post by Tony Li »

Hi,
will_888 wrote: Mon Mar 28, 2022 10:44 amI'm getting some trouble using the Dialogue System Trigger for transitioning between scenes. The transition works fine and variables are passed between scenes (a very neat system!). However, my 2D character (custom controller made by me) NEVER spawns inside the level.
Is your 2D character already in the level (scene)? It should already be in the scene. Add a Position Saver component to it, and tick "Use Player Spawnpoint".
will_888 wrote: Mon Mar 28, 2022 10:44 amIs there possibly some solution for 2D control ready-made from the plugin I can use?
No, there's no 2D controller. If you're looking for a good 2D controller, check out More Mountains' Corgi Platformer Engine or TopDown Engine. They're complete frameworks, though, so they may be overkill for what you're looking for.
will_888 wrote: Mon Mar 28, 2022 10:44 amWhen I'm using the same system for transition, I'm unable to play Sounds as the Action gets ignored and the character just transitions to the next scene. I was also wondering how can I play video cutscenes/display still images or animations between one scene and the other.
Play the transition on the Standard Scene Transition Manager's GameObject. In other words, put the Standard Scene Transition Manager component on the same GameObject as your Save System component. Add an Audio Source to this GameObject or a child in its hierarchy. Then configure the Standard Scene Transition Manager to play audio on that audio source. Alternatively, you can set up a loading screen scene that automatically plays audio. Then add that scene to your build settings, and put the name of the scene in the Standard Scene Transition Manager's Loading Scene field.
will_888
Posts: 26
Joined: Mon Feb 07, 2022 4:09 am

Re: Issues with spawnpoints pand sequencer (2D project)

Post by will_888 »

Thank you for the help. It actually worked like a charm!
I've still got problems with understanding how the Sequencer works, though.
When I'm using a Sequencer command such as Animation, I'm able to start an animation but after the animation is played the dialogue is stuck and I can't go on.
I would like to actually play cutscenes during dialogues. Do you perhaps know what I'm doing wrong? Thanks in advance for your help!
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issues with spawnpoints pand sequencer (2D project)

Post by Tony Li »

Hi,

What Sequence are you using? For example, maybe it looks something like:

Code: Select all

AnimatorPlayWait(Dance)
If you've set the Dialogue Manager's Subtitle Settings > Continue Button mode to a value that waits for a continue button click, such as Always, the dialogue entry will still wait for the player to click the continue button even after the sequence is done.
will_888
Posts: 26
Joined: Mon Feb 07, 2022 4:09 am

Re: Issues with spawnpoints pand sequencer (2D project)

Post by will_888 »

Actually, I'm using a scene event that interacts with a Game Object (triggering a PlayMaker Event).
I think I will switch to an animation
However, I still want to know how can I add a delay between such an interaction with Game Object, have it finish, then make the continue button appear
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issues with spawnpoints pand sequencer (2D project)

Post by Tony Li »

If a dialogue entry node has a scene events, it will run a scene event as soon as the dialogue entry node starts.

If your scene event runs a PlayMaker FSM, you can set up that FSM to deactivate the continue button GameObject until your FSM process is finished.

Alternatively, instead of a scene event, you can use a sequence in the Sequence field. For example:

Code: Select all

SetContinueMode(false);
AnimatorPlayWait(Dance)->Message(Danced);
SetContinueMode(true)@Message(Danced)
The first line hides the continue button.

The second line plays an animator state named "Dance" on the speaker and waits until it's done. When done, it sends the sequencer message "Danced".

The third line waits for the sequencer message "Danced". Then it turns the continue button back on.
will_888
Posts: 26
Joined: Mon Feb 07, 2022 4:09 am

Re: Issues with spawnpoints pand sequencer (2D project)

Post by will_888 »

Ok!
What I feel is confusing, is what you refer as:

AnimatorPlayWait(Dance)

Is that going to be a GameObject with an Animator on it that has a state called Dance?
Or does Dance need to be a Trigger/Bool?

I mean, I can't understand properly the way the Sequencer interacts with the animated object on the Scene.
Thank you so much as always :))
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issues with spawnpoints pand sequencer (2D project)

Post by Tony Li »

The Dialogue System provides a library of sequencer commands, and you can even write your own. AnimatorPlayWait(stateName) plays the state named stateName on a GameObject that has an Animator component. There are other commands, too, which can set animator bool parameters, animator trigger parameters, etc. I recommend watching the Cutscene Sequence Tutorials.
Post Reply