Text Plugin Doubt

I've been looking this for many weeks and I can`t find something similar... is there a way on RPG Maker MV of having a manual scrolling text? I mean.. something like a word document.. text that you can scroll manually up and down.. and not only an automatic down scrolling text... I've been looking on internet for a plugin for that, but I can`t find something related.

Do you have any suggestions, guys? Thank you very much in advance! 🙂
Not without a plug-in, as that isn't a built in feature of the program.

Moved to Plug-In Requests since the desired feature will require a plug-in

Not without a plug-in, as that isn't a built in feature of the program.

Moderator note: Moved to Plug-In Requests since the desired feature will require a plug-in

Got it, but what plugin? Can`t find a plugin for that 🙁
Which is why it's in Plugin Requests. If you can't find what you are looking for, you can ask others if they have seen something suitable, or maybe someone would write one for you. That happens in this particular forum, so your thread got moved from wherever it was to here.
Which is why it's in Plugin Requests. If you can't find what you are looking for, you can ask others if they have seen something suitable, or maybe someone would write one for you. That happens in this particular forum, so your thread got moved from wherever it was to here.

Thank you, I really hope to find help here 🙂
No one? 🙁
writing a plugin usually takes more than a few days, and there are only a limited number of people who have the programming knowledge to write something like that. Please continue asking (I consider it a good idea to have a plugin like this available for encyclopedia items or general world building descriptions), but it will probably take quite a while until it is done.
writing a plugin usually takes more than a few days, and there are only a limited number of people who have the programming knowledge to write something like that. Please continue asking (I consider it a good idea to have a plugin like this available for encyclopedia items or general world building descriptions), but it will probably take quite a while until it is done.

Of course I know this takes time. I just want to know if somebody could help me with this, I would really appreciate it!
@Andar, I know how he feels. He wants someone who might have taken this request into the works to respond with something like: "I'll do this, give me like a week or two." instead of just working in silence, not letting the requester even know that it's being worked on.

I see this a lot on the forums and it also bothers me.
If someone took the request and started working on it, they should respond letting you know instead of leaving you in the dark making you bump your threads/asking more.
I've just tinkered with the Game_Message and Window_Message a little bit. I keep making bad things happen to it trying to rewind it the text.

Is this really for the game messages? Because when you say scrolling text like a manual, I think story/instructions text and my mind goes straight to an HTML element with CSS overflow auto that can be read and scrolled manually. You can make that happen pretty easy.
@Andar, I know how he feels. He wants someone who might have taken this request into the works to respond with something like: "I'll do this, give me like a week or two." instead of just working in silence, not letting the requester even know that it's being worked on.

I see this a lot on the forums and it also bothers me.
If someone took the request and started working on it, they should respond letting you know instead of leaving you in the dark making you bump your threads/asking more.

Dictating what someone putting their time and effort into fulfilling a request "should" do is the best way to turn off anyone who might have been inclined to help. Sometimes (speaking for myself at least) we'll see a request and be like "Huh, that sounds neat. I think I'll have a bash at it" and we'll tinker around but we don't want to tie ourselves to a deadline or make promises we can't keep, so we won't post it unless and until we have it fully done.

The second I post in a topic "Yeah I'm working on this!" it creates an obligation between me and the requester, and sometimes I just don't want that obligation to be hanging over me.
I really think I'm on to something here, since it's the most "like a word document" thing I can think of happening in MV. The thing is basically a Chrome browser.
PHP:
var div = document.createElement("div");
var css = {
width:"500px",
height:"500px",
overflow:"auto",
background:'url("img/pictures/coolThing.png") 0 0 scroll #fff',
color:"#000",
position:"fixed",
left:"50%",
top:"90px",
marginLeft:"-250px",
zIndex:99
};
for(sty in css){
  div.style[sty] = css[sty];
}
var text = document.createTextNode(
  "This is a long body of text. "+
  "Scrollable when needed"
);
div.appendChild(text);
document.body.appendChild(div);

And then to remove again...
PHP:
div.parentNode.removeChild(div);

Heh. Like your avatar, is it Case Closed?
I really think I'm on to something here, since it's the most "like a word document" thing I can think of happening in MV. The thing is basically a Chrome browser.
PHP:
var div = document.createElement("div");
var css = {
width:"500px",
height:"500px",
overflow:"auto",
background:'url("img/pictures/coolThing.png") 0 0 scroll #fff',
color:"#000",
position:"fixed",
left:"50%",
top:"90px",
marginLeft:"-250px",
zIndex:99
};
for(sty in css){
  div.style[sty] = css[sty];
}
var text = document.createTextNode(
  "This is a long body of text. "+
  "Scrollable when needed"
);
div.appendChild(text);
document.body.appendChild(div);

And then to remove again...
PHP:
div.parentNode.removeChild(div);

Heh. Like your avatar, is it Case Closed?


Yes, I'm the official translator of Case Closed in Latin America (AKA Detective Conan) (In Spanish of course lol)

Coming back to the point, I really like your idea! I'm making a videogame for college, so I would like to be able to read text books in order to study (like in real life), but I don`t know anything about creating Plugins, and moreover if you can have color on the text, that would be great! 😀
With this plugin, you should be able to load txt files into a scrollable element.

overflowelement-o.gif

Call it by event script like so...
PHP:
loadTXTfile("loremipsum.txt"); // where loremipsum.txt is a file in your game folder

Keep in mind, this is an element not inside the canvas, so it could have disadvantages like being on top of menus and windows. If you can do a little CSS, you can pretty it up a little.

Spoiler: plugin brought to you, by web design
PHP:
var loadTXTfile = function(file){
   if($gamePlayer.canMoveAfterTxt === undefined){
       $gamePlayer.canMoveAfterTxt = $gamePlayer.canMove;
   }
   var xhr = new XMLHttpRequest();
   xhr.open("GET", file, true);
   xhr.onreadystatechange = function () {
           if(xhr.readyState === 4 && xhr.responseText.length > 0) {
               removeTXTelement();
               $gamePlayer.canMove = function(){
                   return false;
               }
               // create element
               var div = document.createElement("div");
               // style element
               var css = {
                   width:"420px",
                   maxHeight:"420px",
                   overflow:"auto",
                   background:'url("img/pictures/paper.png") 0 0 scroll #fff',
                   color:"#000",
                   font:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',
                   position:"fixed",
                   left:"50%",
                   borderRadius:"5px",
                   padding:"15px",
                   border:"3px solid #000",
                   boxShadow:"-3px 3px 50px #000",
                   top:"50%",
                   marginLeft:"-210px",
                   marginTop:"-210px",
                   zIndex:99999
               };
               for(sty in css){
                   div.style[sty] = css[sty];
               }
               div.id = "DOMElementWithText";
               // give the element the text of the text file
               div.innerHTML = xhr.responseText.replace(/\n/g, "<br>");
               document.body.appendChild(div);
               window.addEventListener("keyup", removeTXTelement);
           }
       };
   xhr.send();
};
var txtOpenInAction = false;
var removeTXTelement = function(e){
   var ok = e !== undefined && Input.keyMapper[e.keyCode] === "ok";
   if(ok && !txtOpenInAction){
       txtOpenInAction = true; // prevents from closing right when open  
   } else if(ok && txtOpenInAction){
       txtOpenInAction = false;
       window.removeEventListener("keyup", removeTXTelement);
       $gamePlayer.canMove = $gamePlayer.canMoveAfterTxt;
       if(document.getElementById("DOMElementWithText") !== null)
           document.getElementById("DOMElementWithText").parentNode.removeChild(
               document.getElementById("DOMElementWithText")
           );
   }
};
With this plugin, you should be able to load txt files into a scrollable element.

overflowelement-o.gif

Call it by event script like so...
PHP:
loadTXTfile("loremipsum.txt"); // where loremipsum.txt is a file in your game folder

Keep in mind, this is an element not inside the canvas, so it could have disadvantages like being on top of menus and windows. If you can do a little CSS, you can pretty it up a little.

Spoiler: plugin brought to you, by web design
PHP:
var loadTXTfile = function(file){
   if($gamePlayer.canMoveAfterTxt === undefined){
       $gamePlayer.canMoveAfterTxt = $gamePlayer.canMove;
   }
   var xhr = new XMLHttpRequest();
   xhr.open("GET", file, true);
   xhr.onreadystatechange = function () {
           if(xhr.readyState === 4 && xhr.responseText.length > 0) {
               removeTXTelement();
               $gamePlayer.canMove = function(){
                   return false;
               }
               // create element
               var div = document.createElement("div");
               // style element
               var css = {
                   width:"420px",
                   maxHeight:"420px",
                   overflow:"auto",
                   background:'url("img/pictures/paper.png") 0 0 scroll #fff',
                   color:"#000",
                   font:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',
                   position:"fixed",
                   left:"50%",
                   borderRadius:"5px",
                   padding:"15px",
                   border:"3px solid #000",
                   boxShadow:"-3px 3px 50px #000",
                   top:"50%",
                   marginLeft:"-210px",
                   marginTop:"-210px",
                   zIndex:99999
               };
               for(sty in css){
                   div.style[sty] = css[sty];
               }
               div.id = "DOMElementWithText";
               // give the element the text of the text file
               div.innerHTML = xhr.responseText.replace(/\n/g, "<br>");
               document.body.appendChild(div);
               window.addEventListener("keyup", removeTXTelement);
           }
       };
   xhr.send();
};
var txtOpenInAction = false;
var removeTXTelement = function(e){
   var ok = e !== undefined && Input.keyMapper[e.keyCode] === "ok";
   if(ok && !txtOpenInAction){
       txtOpenInAction = true; // prevents from closing right when open
   } else if(ok && txtOpenInAction){
       txtOpenInAction = false;
       window.removeEventListener("keyup", removeTXTelement);
       $gamePlayer.canMove = $gamePlayer.canMoveAfterTxt;
       if(document.getElementById("DOMElementWithText") !== null)
           document.getElementById("DOMElementWithText").parentNode.removeChild(
               document.getElementById("DOMElementWithText")
           );
   }
};

Wow dude, this is EXACTLY what I want! I just have one big doubt... how can I use it? I pasted the code inside a .js and I tried to load the "loadTXTfile" in the plugin command, but it doesn`t work.
I'm sorry. I've never used plugin commands before. I just made it so it takes an event script call (the one above plugin command)

Also in the plugins folder and turn it on whatever you name it, too.

Is that plugin command button new? I don't think I've noticed it until recently.
In order to add new plugin commands, you alias the pluginCommand function of Game_Interpreter, like so:

Code:
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command.toLowerCase() === YOUR COMMAND NAME HERE) {
            loadTXTfile(name);
        }
    };
paper.png
< put this in your /img/pictures/ folder too if you want the same background as the GIF example. Or you can make your own. I find elements a lot more dressable than what goes on inside of a canvas because they have hard browser legacy css.
OK now I'm totally lost hahahaha... what are you talking about, guys? How can I use that code? ;_;

How can I paste it into a .js file? ;_; Sorry, I'm not good with these things :headshake:
Ok. I've improved on this since last night. I notice MV was cancelling keyboard and wheel events preventing scrolling on the element, so I've commented out one line in the core. I've also added Trihan's command thing, so now you call either call this script by event...
PHP:
loadTXTfile("loremipsum.txt");
or by command
PHP:
loadTXTfile loremipsum.txt
PHP:
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command.toLowerCase() === "loadtxtfile") {
            loadTXTfile(args);
        }
    };
var loadTXTfile = function(file){
   if($gamePlayer.canMoveAfterTxt === undefined){
       $gamePlayer.canMoveAfterTxt = $gamePlayer.canMove;
       Input._shouldPreventDefaultAfterTxt = Input._shouldPreventDefault;
   }
   var xhr = new XMLHttpRequest();
   xhr.open("GET", file, true);
   xhr.onreadystatechange = function () {
           if(xhr.readyState === 4 && xhr.responseText.length > 0) {
               removeTXTelement();
               $gamePlayer.canMove = function(){
                   return false;
               };
               Input._shouldPreventDefault = function(){
                   return false;
               };
               // create element
               var div = document.createElement("div");
               // style element
               var css = {
                   width:"420px",
                   maxHeight:"420px",
                   overflow:"auto",
                   background:'url("img/pictures/paper.png") 0 0 scroll #fff',
                   color:"#000",
                   font:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',
                   position:"fixed",
                   left:"50%",
                   borderRadius:"5px",
                   padding:"15px",
                   border:"3px solid #000",
                   boxShadow:"-3px 3px 50px #000",
                   top:"50%",
                   marginLeft:"-210px",
                   marginTop:"-210px",
                   zIndex:99999
               };
               for(sty in css){
                   div.style[sty] = css[sty];
               }
               div.id = "DOMElementWithText";
               // give the element the text of the text file
               div.innerHTML = xhr.responseText.replace(/\n/g, "<br>");
               document.body.appendChild(div);
               document.getElementById("DOMElementWithText").focus();
               window.addEventListener("keyup", removeTXTelement);
           }
       };
   xhr.send();
};
var txtOpenInAction = false;
var removeTXTelement = function(e){
   var ok = e !== undefined && Input.keyMapper[e.keyCode] === "ok";
   if(ok && !txtOpenInAction){
       txtOpenInAction = true; // prevents from closing right when open  
   } else if(ok && txtOpenInAction){
       txtOpenInAction = false;
       window.removeEventListener("keyup", removeTXTelement);
       $gamePlayer.canMove = $gamePlayer.canMoveAfterTxt;
       Input._shouldPreventDefault = Input._shouldPreventDefaultAfterTxt;
       if(document.getElementById("DOMElementWithText") !== null)
           document.getElementById("DOMElementWithText").parentNode.removeChild(
               document.getElementById("DOMElementWithText")
           );
   }
};
TouchInput._setupEventHandlers = function() {
    document.addEventListener('mousedown', this._onMouseDown.bind(this));
    document.addEventListener('mousemove', this._onMouseMove.bind(this));
    document.addEventListener('mouseup', this._onMouseUp.bind(this));
//  document.addEventListener('wheel', this._onWheel.bind(this));
    document.addEventListener('touchstart', this._onTouchStart.bind(this));
    document.addEventListener('touchmove', this._onTouchMove.bind(this));
    document.addEventListener('touchend', this._onTouchEnd.bind(this));
    document.addEventListener('touchcancel', this._onTouchCancel.bind(this));
    document.addEventListener('pointerdown', this._onPointerDown.bind(this));
};

Original thread: https://forums.rpgmakerweb.com/threads/text-plugin-doubt.75590/