public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

message with choices in a loop

BMM_Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: message with choices in a loop
  • Original author: Brian87
  • Original date: December 29, 2018
  • Source thread: https://forums.rpgmakerweb.com/threads/message-with-choices-in-a-loop.103807/
  • Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Javascript/Plugin Support

Summary

I am trying to create a javascript function in my custom plugin that initiates a conversation in a loop. Text is displayed, and the user is offered the choice to continue or exit. If the user decides to continue, the text is displayed again with the same two options. This repeats until the user selects to exit, at which point the conversation ends. My final version will of course be more complex, but this example boils down the problem area for me. I have the logic working fine in RPG...

Archived First Post

I am trying to create a javascript function in my custom plugin that initiates a conversation in a loop. Text is displayed, and the user is offered the choice to continue or exit. If the user decides to continue, the text is displayed again with the same two options. This repeats until the user selects to exit, at which point the conversation ends.

My final version will of course be more complex, but this example boils down the problem area for me.

I have the logic working fine in RPG Maker MV:

Protected download

However, I cannot get this same functionality from my javascript. Here is my attempt:

Code:
Game_System.prototype.endlessConversation = function() {
  $gameMessage.add("Start of dialogue:");
  while (true) {
    $gameMessage.newPage();
    $gameMessage.add("Some text that repeats.");
    $gameMessage.setChoices(["Continue", "Exit"], 0, -1);
    $gameMessage.setChoiceCallback(function(n) {
        if (n === 1) {
          break;
        }
    });
  }     
}

This freezes up because the loop executes infinitely. The loop does not wait for user input between iterations like the one in RPG Maker itself. If I change it to a for loop with a set number of iterations, like 5, it will simply spit out "Some text that repeats." 5 times in a row.

Any ideas on how I can get this javascript code to behave like the RPG Maker logic would be greatly appreciated. Thanks.

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

Referenced Images / Attachments

in app logic.png
in app logic.png
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#rpg-maker-archive#js-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar