Forum rules - please read before posting.

Dialog scrolling speed and movement during dialog

Hello, I have 3 questions regarding dialog:

1. Is it possible (even with heavy coding) to pause within a dialog? Such as "Hello...(wait for 1 second) my name is Rekize"

2. I am using Direct control and Manual movement control, and during !KickStarter.stateHandler.IsInGameplay() the motion control will change to Automatic. This works well as desired, but when a dialog popup when the player is moving, the player will continue moving until the motion control is switched back to Manual.

I tried everything I know to stop the player when the dialog pops up but no luck. Previously, my Conversation Menu faced the same problem, and I solved it by making the movement control vector to 0 when the Conversation Menu pops up. The same trick doesn't work on the Subtitles Menu. I also tried to Constrain the Player Movement, Halt(), but none of these work...

How can I absolute stops the player's movement when it is in Automatic motion control?

Thanks

Comments

  • 1. Yes - text tokens such as [wait] and [wait:2] can be inserted into speech text to pause indefinitely or for a set time.  A full list of available tokens can be found in the Manual's "Text tokens" chapter.

    2. Does the dialogue block gameplay, so that the GameState then becomes Cutscene?  (You can see the game's current state by checking List active ActionLists in Game window? at the bottom of the Settings Manager).

    Calling Halt() should do the trick, but it shouldn't be called permanently whenever not in gameplay as that would interfere with AC's control over it during Cutscenes.  (Unless you never want AC to take control, in which case you should just leave the Motion control as Manual).

    The better-practice method of controling custom behaviour according to the game state is to rely on the OnEnterGameState / OnExitGameState events.  This way, you can make modifications (such as changing the Motion control setting, or halting the player), only when transitioning between gameplay and non-gameplay - as opposed to every frame.  See the "Custom events" chapter of the Manual for more information as well as an example.

    If changing to that method still gives no luck with Halt(), you'll have to share some more information about how exactly you're controlling the player via your custom script.
  • 1. Yes - text tokens such as [wait] and [wait:2] can be inserted into speech text to pause indefinitely or for a set time.  A full list of available tokens can be found in the Manual's "Text tokens" chapter.

    Cool, this is an awesomely powerful function!


    2. Does the dialogue block gameplay, so that the GameState then becomes Cutscene?  (You can see the game's current state by checking List active ActionLists in Game window? at the bottom of the Settings Manager).

    Yes, I checked and the GameState is Cutscene during speech. After trying OnGameStateEnter there is still no luck using Halt().

    I used this trunk of code to toggle the control:

    void Start () {
         conversationMenu = PlayerMenus.GetMenuWithName ("Conversation");
         AC.EventManager.OnEnterGameState += My_OnEnterGameState;
    }

    void My_OnEnterGameState (GameState newGameState)
    {
         if (newGameState == GameState.Normal) {
             KickStarter.player.motionControl = MotionControl.Manual;
             KickStarter.player.GetComponent<CharACMotorMoveJumpController> ().enabled = true;
    // Make the player control axis always "facing the camera" (have the camera at the -ve z-axis)
    KickStarter.player.transform.eulerAngles = new Vector3 (KickStarter.player.transform.eulerAngles.x,    KickStarter.mainCamera.attachedCamera.transform.eulerAngles.y, KickStarter.player.transform.eulerAngles.z);
         } else {
             KickStarter.player.motionControl = AC.MotionControl.Automatic;
             if (conversationMenu.IsOff ()) {
                   KickStarter.player.GetComponent<CharACMotorMoveJumpController> ().enabled = false;
             } else {
                   KickStarter.player.GetComponent<CharACMotorMoveJumpController> ().enabled = true;
    }
    }
    }

    No matter where I put Kickstarter.player.Halt(); under !newGameState == GameState.Normal (the "else" part), it doesn't stop the player continue moving when player's speech pops up. It can stop the player from going to markers though.

    If I remember it right, this issue is new after updating to v1.62.1. Though I am not 100% sure if I remember it correctly.
  • If the player is moving during gameplay due to a custom motion controller, then it may be that same controller that's causing him to move during a cutscene.

    Halt() will stop the character moving so far as AC controls it - so if he continues to move then it's either due to him being commanded to move by AC afterwards, or that a separate controller is still moving him.  Is it possible it's the latter?
  • I believe your are right. I managed to stop the motion by disabling the manual controller. But this gives 2 side effects:

    1. The player will totally stop when enter cutscene, even in the air when jumping. So I would like to disable the Interactions when the player is not grounded. Can you advise me on the script to disable Interactions? Or disable the InteractionA & InteractionB buttons?

    2. If the interaction starts when the player is walking, although the walking motion stops during the interaction, the the player will move one step when the GameState.Normal is resumed. This is weird but I don't seem to be able to remove the seeming "residue" input from before the interaction. I tried Input.ResetAxis() when the game state changes but it doesn't help. Do you have any ideas about this strange behaviour?
  • 1. The interaction system can be enabled or disabled via:

    KickStarter.stateHandler.SetInteractionSystem (true / false);

    2. Again, we'll need to determine if that's down to the custom controller.  If you don't re-enable the controller script after resuming gameplay, does he no longer take a step?

    It may be that disabling the controller script is not the best approach.  Perhaps a flag within the script can be used to dictate whether or not it reacts to input, which you can set through your interaction script instead of disabling the component entirely.
  • 1. Thanks.

    2. Thanks, I am using a global boolean variable to toggle whether the game response to use inputs. It is working well in all current scenarios.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.