Forum rules - please read before posting.

Choice of dialogue sentences with use of gamepad's buttons.

edited April 2016 in Technical Q&A
Hello.

I use AC version 1.51b and Unity 3D version 5.3.3f1.

It is possible to select dialogue sentences with use of keyboard's buttons (1, 2, 3, 4). But, how to make it possible to use gamepad's buttons (e.g. X, Y, A, B of Xbox gamepad), to choose sentences during conversation?

image



When I set:
image
Then I can choose first sentence with use of "g" keyboard's button, but gamepad's button (joystick button 0) does not work.


Best regards,
  Motoman.

Comments

  • Are you sure it's button 0 you want to be detecting?  If it's picking up "g" then it doesn't sound like an AC issue.
  • edited April 2016
    Hi. Yes, "joystick button 0" is right. I modified AC's sources a little bit, for debug purposes...

    PlayerInput.cs:
    if (/*InputGetButtonDown("DialogueOption1") || */Input.GetButton("DialogueOption1"))
    {
        activeConversation.RunOption(0);
    }
    else if (/*InputGetButtonDown("DialogueOption2") || */Input.GetButton("DialogueOption2"))
    {
        activeConversation.RunOption(1);
    }


    Now, I am able to run dialogue sentences with use of "joystick button 0". I do not know, why Input.GetButton (which I used for debug) returns true when DialogueOption1 (joystick button 0) is pressed, but InputGetButtonDown (used in original AC's source code) does not. As I have written earlier, InputGetButtonDown works for "g" keyboard's button, but does not work for "joystick button 0" -- Input.GetButton works for "joystick button 0".

    Finally, I wrote simple code in PlayerInput.cs based on Input.GetButton (with detection if button was released previously and now is pressed). So, I achieved what I wanted, but I do not know what is a reason of the problem I described earlier.
  • AC's InputGetButtonDown is similar to Input.GetButtonDown except it also allow for input overriding.  The difference with your code is that you're now using Input.GetButton (i.e. without the "Down").

    I believe I know the cause of this.  I shall likely include an "unlisted" fix in v1.51c - so-called as a get out if my hunch is wrong :p
  • edited April 2016
    I believe I know the cause of this.  I shall likely include an
    "unlisted" fix in v1.51c - so-called as a get out if my hunch is wrong

    Now it works right with version 1.51d   :D
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.