RPG Maker Forums

Hiya, I've been searching the forums since I know this is a confusing script but I'm still lost and I can't make it work.

From what I've gathered I think I got the first part:

Code:
choices = [];    // make an empty array
$gameMessage.setChoices(choices, 0, -1);     // 0 is the first choice pre-selected, -1 to disallow cancel,
// And push the strings on the choices array.
choices.push("hello"); // would be index 0
choices.push("bye"); // // would be index 1
I still don't get what does the params = []; array does, or the params.push() does on the script call Google Sheet.
I've seen the code and it also includes this:
this._index++;
this.setWaitMode('message');

Is it necessary to implement them on the script call too? Do I have to switch the "this." with $gameMessage.? I don't really get what that Index++ does there, isn't it to increase the number?

Even without the params the choices show up on the screen so at least that first part works.

Now for the callBack, this is the part that I can't figure out:

Code:
$gameMessage.setChoiceCallback(function(n) {
        this._branch[this._indent] = n;  // THIS 
 }.bind(this));

// I guess this one is the function that stores the index chosen?
Game_Message.prototype.setChoiceCallback = function(callback) {
    this._choiceCallback = callback;
};

// And this one the ones that makes it null if no choice is called? Perhaps this is why nothing happens when I choose an option?
Game_Message.prototype.onChoice = function(n) {
    if (this._choiceCallback) {
        this._choiceCallback(n);
        this._choiceCallback = null;
    }
};
If I do something like this it doesn't work, it returns me to the map normally:

Code:
$gameMessage.setChoiceCallback(function(n) {
            if (n === 0) {
                  $gameMessage.add("Say hello");
            } else {
                  $gameMessage.add("Say bye");
            }
});

I guess I'm missing something with this._branch[this._indent] = n;, I don't understand how it works or how to call back the index of the choices.

Any help on this matter would be appreciated, my brain is a mess right now.

(I'm trying all of this on a new project without plugins).

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top