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,768
Reaction score
8,192
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 Profile Posts

made a bio for the protag in my project!
Beggar : "I haven't eat for days..."
Kid : "Just do crime! You will get daily necessity for free in prison~"
Stream is a bit late but will be live shortly with some game development! Feel free to drop by!
omg, why persona 5 is so good?

Forum statistics

Threads
99,155
Messages
962,416
Members
130,725
Latest member
teendinsaikha
Top