Professional Documents
Culture Documents
You can also use variables to form an array for Show Choices. The advantage
cancelType:
of doing this is you can use two script calls and have plenty of space. It
You start from 0 - maxChoices. In the example's case, it's 0-7.
would look something like this:
0 If you cancel, the first choice will be automatically selected.
-1 = Disallow Cancelling
// Initialize Choices Array using Variable #2
-2 = Show Cancel Button (MZ Only!)
This must be in a single script call: $gameVariables.setValue(2,
[
If you wish to replace the Variable, just replace variableIndex =
// Initialize Choices Array "This is choice #1",
$gameVariables.setValue(variableIndex, n);
const choices = ["choice1", "choice2", "choice3", "choice4", "choice5", "choice6", "This is choice #2",
"choice7", "choice8"]; "This is choice #3",
Background:
// Set Message Choices "This is choice #4",
0 = Window
$gameMessage.setChoices(choices, defaultType, cancelType); "This is choice #5",
1 = Dim
// Set Message Background "This is choice #6",
2 = Transparent
$gameMessage.setChoiceBackground(background); "This is choice #7",
Show Choices // Set Message Position "This is choice #8"
Position Type:
$gameMessage.setChoicePositionType(positionType); ]);
0 = Left
// Record Outcome in a Variable
1 = Center
$gameMessage.setChoiceCallback(n => { // Set Message Choices
2 = Right
this._branch[this._indent] = n; $gameMessage.setChoices($gameVariables.value(2), 2, -1);
$gameVariables.setValue(variableIndex, n); // Set Message Background
Note:
}); $gameMessage.setChoiceBackground(background);
It's important to add the following code, otherwise it will not work:
// Set Message Position
this.setWaitMode("message");
// You must add this in a new script call $gameMessage.setChoicePositionType(positionType);
this.setWaitMode("message"); // Record Outcome in Variable #1
However, since Script Call space is limited or maybe you don't want to add a
$gameMessage.setChoiceCallback(n => {
new script call command, you can also skip it if you have a message box
$gameVariables.setValue(1, n);
immediately after the show choice before the results of the show choice.
});
// Add this otherwise it will not work.
Trivia:
this.setWaitMode("message");
If you are curious about '=>', you can read this supplementary material.
Basically => is a more compact version of function(). Which has no binding or
arguments except for a basic callback. In some languages its -> or >>.
variableIndex = The ID of the variable you want to use.
Input Number $gameMessage.setNumberInput(variableIndex, digits);
digits = The amount of digits do you want the player to be able to input.
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
◆Text:\n[8], Actor1(7), Window, Bottom
: :Give me a regular item!
◆Script:$gameMessage.setItemChoice(3, 1);