1. Dismiss Notice
  2. Within our Resources section we have over 150 Audio files, with room to grow. You may find exactly what you have been looking for. Just CLICK HERE to start your listening adventure.
    Dismiss Notice
  3. Why would you want to upload your resources directly to RMMV.co? It makes it easier for other members to download them. Click HERE for more information.
    Dismiss Notice
  4. Click HERE to see our four new featured resources by TheUnproPro, Starbird, iblamevictoria, and VGM MarkH.
    Dismiss Notice
  5. Here are the The Resource Rules.
    Dismiss Notice
  6. Please read these RULES before posting.
    Dismiss Notice

Input.isTriggered not working in game

Discussion in 'Javascript Support' started by Nikh, Feb 14, 2018.

  1. Hello!!

    So I'm trying to make a plugin that triggers when a certain button is pressed (namely it can take you to a message that was previously written and vice versa), but whenever I playtest my game, it never works out for me. I'm trying to use the isTriggeered javascript code, but it doesn't seem to work unless it's in a parallel event. Is there a way/plugin of checking button inputs in plugins? THANKS IN ADVANCE.

    Code I used is here:

    var A = ['hi' , 'hello', 'C', 'RPG'];

    //if (Input.isTriggered('shift') == 1)
    // $gameMessage.add(A[1,1]);

    //var X = 0;

    //if (Input.isTriggered('left') == 1)
    // console.log('hi');

    while (Input.isTriggered('ok') == 1)
  2. From "RPG Maker MV Help / JS Library" found in the menu bar under "Help / Contents F1".
    isTriggered ( keyName ) Boolean [static]

    Checks whether a key is just pressed.

    • keyName String
      The mapped name of the key
    True if the key is triggered

    "Input.isTriggered('left') == 1" is redundant as "Input.isTriggered('left')" will already return true if 'left' is pressed.
    Code (Javascript):
    if (Input.isTriggered('left')) {
    will do.

    Because you mentioned it working in a parallel event I doubt my reply will solve the issue. Some more information may help solve this. Where are you trying to make this happen? On the map, in battle, a menu, somewhere else or everywhere?

  3. I'm trying basically to use this on the map more than anything. Specifically, when an NPC or something is talking to the characters. Rn I'm trying to make a plugin that allows someone to go back through previous text when the player presses a specific button. Hope that makes sense.
  4. #4 trapless, Feb 26, 2018
    Last edited: Feb 26, 2018
    Do you create he list of messages in your code, or are you using messages buit inside of an event?

    I think the two main things involved here are
    Game_Message & Window_Message

    have a look in those to see how the messages are built and delivered to the screen.
  5. Thanks for responding!! Sorry for late response, had work

    As for what I'm doing, for now I'm just trying to figure out how to do it from a list of messages in the code. Right now they're in an array, but putting them on the screen on a button press is the hard part. Thanks for the direction though!! Gonna see what I can learn :)

Share This Page