Input.isTriggered not working in game

GO TO ADMIN PANEL > ADD-ONS AND INSTALL ABSTRACT SIDEBAR TO SEE FORUMS AND SIDEBAR

Nikh

NPC
Joined
Feb 14, 2018
Messages
6
Points
11
Age
22
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)
{
console.log('hi');
}
 

trapless

Villager
Joined
Dec 28, 2015
Messages
57
Points
41
Age
35
Website
sqwisp.com
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.

Parameters:
  • keyName String
    The mapped name of the key
Returns:
Boolean:
True if the key is triggered
-------------------------------------------------------

"Input.isTriggered('left') == 1" is redundant as "Input.isTriggered('left')" will already return true if 'left' is pressed.
JavaScript:
if (Input.isTriggered('left')) {
  console.log('hi');
}
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?
 

Nikh

NPC
Joined
Feb 14, 2018
Messages
6
Points
11
Age
22
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.

Parameters:
  • keyName String
    The mapped name of the key
Returns:
Boolean:
True if the key is triggered
-------------------------------------------------------

"Input.isTriggered('left') == 1" is redundant as "Input.isTriggered('left')" will already return true if 'left' is pressed.
JavaScript:
if (Input.isTriggered('left')) {
  console.log('hi');
}
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?

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.
 

trapless

Villager
Joined
Dec 28, 2015
Messages
57
Points
41
Age
35
Website
sqwisp.com
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.
 
Last edited:

Nikh

NPC
Joined
Feb 14, 2018
Messages
6
Points
11
Age
22
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.
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 :)
 
Top