Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Input.isTriggered not working in game

Nikh

Villager
Xy$
0.00
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
Xy$
0.00
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

Villager
Xy$
0.00
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
Xy$
0.00
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

Villager
Xy$
0.00
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