2

I am working on a Dragon Warrior - type rpg game in Game Maker studio and can't figure out how to get a show choice option that doesn't use the mouse. I have setup the game to run completely with a gamepad, but when I am confronted with the situation that requires feedback (choice selection) from the player I am unable to get the gamepad working. Heres the GML

if (distance_to_object(obj_judy)) <= 64 {
    if keyboard_check(vk_space) || gamepad_button_check_pressed(0, gp_face3) {
        show_question(mine_crystal);
        if true {
            global.energy -= 10;
            global.power_crystal += 1;
            instance_destroy();
        }
    }
}

The problem is " show_question(); " uses a windows-type popup and doesn't work with the gamepad.

How do I get feedback from the player using only inputs from the gamepad? Thanks for your time reading and your help with this small issue.

Rob
  • 4,927
  • 4
  • 26
  • 41
  • I think you will have to create your own custom message window (it's good practice to do so anyway). With a little more info I can give an example of how to do this. Are you using Game Maker Studio? What level (lite, standard, pro, etc.)? And do you need the game to pause when the message is given? – PGmath Dec 19 '14 at 16:45
  • I am using Game Maker Studio Pro. Yes I would like the game to pause for the text box popup so they aren't able to run away in the middle of a show choice box. I've made some custom start menu graphics and I could use the same design for the text boxes I suppose. – Michael Paul Schaffer Dec 19 '14 at 21:01
  • Is this a relatively new game or have you been working on it for a while? Essentially I am asking if you are at a stage where you can add a new variable and new code to most actions of all objects. If not there are other ways of pausing but they are more complex. – PGmath Dec 20 '14 at 02:36
  • This is a relatively new project. I am able to add new code without too much work. – Michael Paul Schaffer Dec 20 '14 at 13:30
  • 1
    @MichaelPaulSchaffer if your question was answered, could you please mark it as such? Thanks in advance! – Rob Jun 05 '19 at 11:23

1 Answers1

1

So yeah, you'll need to write that logic yourself. Also, that code you wrote there looks kinda scary, i'd use this;

    if (show_question(mine_crystal) == true) {
        global.energy -= 10;
        global.power_crystal += 1;
        instance_destroy();
    }

because

show_question(mine_crystal);
if true {
    global.energy -= 10;
    global.power_crystal += 1;
    instance_destroy();
}

Will show a question, and then always do the mine crystal action (because your if (true) will always evaluate to true, it doesn't know about the line above

Rob
  • 4,927
  • 4
  • 26
  • 41