You are on page 1of 20

Event Page 1 Messages

Updated: April 25, 2021 (GMT+8:30)


Command Name Script Call Script Call (Alternative) / (Example) Description
imageFilename = The name of the image.

rowIndex = Starting from 0.

// Set Character Faceset bgType:


$gameMessage.setFaceImage('imageFilename', rowIndex); 0 = Window
// Set Window Background $gameMessage.setFaceImage('Actor1', 0); 1 = Dim
$gameMessage.setBackground(bgType); $gameMessage.setBackground(0); 2 = Transparent
// Set Message Window Position $gameMessage.setPositionType(2);
Show Text
$gameMessage.setPositionType(Position); $gameMessage.setSpeakerName('\\c[6]\\n[1]'); Position:
// Set Speaker Name (MZ Only!) $gameMessage.add('I am \\c[6]\\n[1]\\c[0]!'); 0 = Top
$gameMessage.setSpeakerName('characterName'); 1 = Middle
// Set Message / Dialogue 2 = Bottom
$gameMessage.add("Show Text Script Call");
characterName:
It can be any string as long as it's inside a "" or ''
If you wish to use message text codes, you need to add "\\" or it will not
appear. So for example, to display Party Leader's name it has to be \\p[0].
defaultType = The default choice that is selected when you press cancel
button.

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);

◆Text:\n[8], Actor1(7), Window, Bottom


: :Give me a key item! itemType:
◆Script:$gameMessage.setItemChoice(3, 2); 1 = Regular Items,
Select Item $gameMessage.setItemChoice(variableIndex, itemType); 2 = Key Items
◆Text:\n[8], Actor1(7), Window, Bottom 3 = Hidden A
: :Give me a hidden a item! 4 = Hidden B
◆Script:$gameMessage.setItemChoice(3, 3);

◆Text:\n[8], Actor1(7), Window, Bottom


: :Give me a hidden b item!
◆Script:$gameMessage.setItemChoice(3, 4);
// Insert your story inside an array. scrollingSpeed = 1-8.
const text = [ 1 being the slowest, 8 being the fastest.
'People have been coming to the wise man,\ncomplaining about the same
problems every time.', fastForward:
'One day he told them a joke and everyone roared \nin laughter.', 0 = Allows Fast Forward
'After a couple of minutes, he told them the same joke \nand only a few of 1 = Disallows Fast Forward
them smiled.',
'When he told the same joke for the third time no one \nlaughed anymore.', Note:
$gameMessage.setScroll(scrollingSpeed, fastForward); 'The wise man smiled and said:\n', If you need line breaks, you need to add '\n'
Show Scrolling Text
$gameMessage.add("Text"); '"You can’t laugh at the same joke over and over.\n So why are you always
crying about the same problem?"' Trivia:
] If you want to know what .join does, you can read any of these articles to
// Now put your array inside Variable 2! get an idea.
$gameVariables.setValue(2, text.join('\n\n'));
- MDN Documentation
// Scrolling Text Script Call - w3Schools
$gameMessage.setScroll(3, 0);
$gameMessage.add($gameVariables.value(2)); You can think of it as combining a list together.

Advanced Script Calls


Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description
Event Page 1 Messages
Updated: April 25, 2021 (GMT+8:30)
Command Name Script Call Script Call (Alternative) / (Example) Description

You might also like