this.setWaitMode proper usage.

Soulrender

Veteran
Veteran
Joined
Jan 12, 2019
Messages
411
Reaction score
244
First Language
Poland
Primarily Uses
RMMV
Some time ago I wrote procedural plugin to read dialouges from
external txt file and plugin works fine and this is what I wanted to achieve, but
as I said, it's procedural plugin, not object oriented, therefore in order to use it
inside RMMV without any issues I have to use it in this way.

So my question is, inside wich class I should put my functions and methods in order to
place this.setWaitMode(mode) to avoid using it inside "Script..." event?

I'm giving you code to have a better look:
Code:
ReadFile = function(filename)
{
    var xhr = new XMLHttpRequest();
    xhr.async = false;
    xhr.open("GET",filename,false)
    xhr.send(null);
    var fileContent = xhr.responseText;
    return fileContent;
}

Explode = function(txt, delim){
    var source = txt.split(delim);
    if (source){
        return source;
    }
    else return false;
}

DisplayText = function(source, line){
   
    const path = "./dialouges/";
   
    var data = ReadFile(path + source + ".txt");
    var handle = Explode(data, "\n");
    var line = Explode(handle[line], "|");
   
    $gameMessage.clear();
   
    var speech = "<WordWrap>\\hc[ffbd38]" + line[4] + ": \\hc[ffffff]<br>" + line[5];
    if(!$gameMessage.isBusy()){
        if (data[0]){
            $gameMessage.setFaceImage(line[3], Number(line[2]));
        }
        $gameMessage.setPositionType(Number(line[0]));
        $gameMessage.setBackground(Number(line[1]));       
        $gameMessage.add(speech);   
        //this.setWaitMode('message'); //Should be here!
    }
}
 
Last edited:

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

Latest Threads

Latest Profile Posts

Stream will be live shortly with some pixel art! Feel free to drop by!

Can't believe I forgot to put an image of my drawing pad! It looks kinda like this, maybe I'll get a better pic tomorrow...
Backup tip: If you don't want to back up your whole project every day, at least back up everything *except* your Image and Audio folders, which you can do weekly/as needed/etc.
The final version of our game is already available both in English and Spanish! ^___^
Can't believe this day has finally come... T_T
Im so happy that Dead By Daylight is getting a Silent Hill chapter! Cant wait to play as pyramid head

Forum statistics

Threads
97,814
Messages
947,147
Members
129,034
Latest member
jace00
Top