Message window doesn't show when called more than once

henryking88

Warper
Member
Joined
Feb 28, 2020
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi

I'm writing this code in a plugin.
I want to display another text message window using the $gameMessage object. The first message "Do you want to have dinner?" will show correctly including the choices of "Yes" and "No" but after I chose "Yes" or "No" the next
$gameMessage.add("This doesn't show up") just doesn't show up but the console log does display "Yes!" or "No!" indicating the other code is correct.
How do I get the message window to show up after the player makes the choice.

$gameMessage.add("Do you want to have dinner?");
$gameMessage.setChoicePositionType(1);
$gameMessage.setChoices(["Yes", "No"], 0, -1);

$gameMessage.setChoiceCallback(function(responseIndex) {
if (responseIndex == 0) {
$gameMessage.add("This doesn't show up");
console.log("Yes!");
}
if (responseIndex == 1) {
$gameMessage.add("This doesn't show up too");
console.log("x =" + x);
console.log("No!");
}
} );
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,771
Reaction score
8,193
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.

 

henryking88

Warper
Member
Joined
Feb 28, 2020
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ok. thanks. This is my first post. Will look out next time. Anyone can help? Much appreciated.
 

deykuzor

Korean Guy Screaming in Italian American
Member
Joined
Sep 7, 2017
Messages
23
Reaction score
5
First Language
English
Primarily Uses
RMMV
$gameMessage.newPage();
$gameMessage.add("This doesn't show up");
console.log("Yes!");

I think would work. Not testing that yet but yeah. Is there a reason you don't use the rpgmaker editor for this? I don't see a reason to do this all in JavaScript as is
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Okay someone really needs to fix that broken railing, its a health hazard...

I'm starting to wonder if I should go the Half Minute Hero route with my game. The character's main weapon is logistically way too strong. So I can't really let the player continuously grow it.... But if they had to build it up each time like HMH, that could work. Also it lets me take advantage of my randomly generated maps so much more. Hmm... This could work! :LZSexcite:
std::vector, std::map and std::string. Three reasons why I'd take C++ over C. :D

Forum statistics

Threads
99,203
Messages
963,002
Members
130,791
Latest member
xericho
Top