Scripting a show choices - need a wider width for some options

mfexplorer

Veteran
Veteran
Joined
Aug 9, 2022
Messages
84
Reaction score
18
First Language
English
Primarily Uses
RMMZ
Hi, I find this code works fine if the options for the multiple choice are not too long. Is there any way to increase the maximum width that will display correctly? Here is my code:
Code:
function askMcQn() {

    $gameMessage.add($gameVariables.value(45));  // Question

    $gameMessage.setChoices([$gameVariables.value(46), $gameVariables.value(47), $gameVariables.value(48), $gameVariables.value(49)], 0, -1);

    // Set background: Dim
    $gameMessage.setChoiceBackground(1);
    // Set position: Center
    $gameMessage.setChoicePositionType(0);
    // Bottom
    $gameMessage.setPositionType(0);
    
    // On choice, set variable #1 equal to the selected index
    $gameMessage.setChoiceCallback(n => {
        var letterChoice;
        if (n === 0) letterChoice = 'A'
        else if (n === 1) letterChoice = 'B'
        else if (n === 2) letterChoice = 'C'
        else if (n === 3) letterChoice = 'D';
        $gameVariables.setValue(5, letterChoice);
    });
    // Wait for a choice to be selected
//    this.setWaitMode("message");
//    console.log($gameVariables.value(5));


}
 

MemoriesLP

Veteran
Veteran
Joined
Jun 12, 2016
Messages
41
Reaction score
10
First Language
Portuguese
Primarily Uses
Not sure if I get what you mean. I just tested a long choice and the max width is the resolution of your game. Not sure if that's the normal behaviour of the engine, or if Yanfly Core Message did that.

What I said was related to your question?
 

mfexplorer

Veteran
Veteran
Joined
Aug 9, 2022
Messages
84
Reaction score
18
First Language
English
Primarily Uses
RMMZ
Part of the problem was extra spaces I was putting in the options. It does now go to the end of the screen. But now some choices are too long still, my screen dimensions are changed for mobile use. Can I reduce the font size of the options? I tried prepending \} to them but that didn't seem to work. I am using Yanfly plugins.
 

MemoriesLP

Veteran
Veteran
Joined
Jun 12, 2016
Messages
41
Reaction score
10
First Language
Portuguese
Primarily Uses
If text codes don't work inside choice options, you can use VE_ControlText plugin to allow that (requires VE_BasicModule).
With this plugin you can add text codes in many places, including items/skills descriptions. Even Yanfly text codes work too.

I don't remember exactly why, but I had to place both VE plugins ABOVE Yanfly_CoreEngine.
I think VE_BasicModule overwrites important stuff from Yanfly, so Yanfly should come first (to overwrite VE). I have never had any issue after I placed VE first.
 

Latest Threads

Latest Posts

Latest Profile Posts

Learn how to do custom face parts with my latest tutorial!
Generatorpartsfromscratch.png
The Legion
T7T0hR2.gif
Made a title screen, and by ''made'' I ofc mean I slapped a simple title on some cool art I bought xD This side project might be fun.

sIMPLE.png
CDF.png

Trying for a Classical RPG with Pokemon Elements. Capture monsters like Zombies and Harpys and use them on your team.
ow28O4A.png

Astarte in her usual demeanor: mocking people.

Forum statistics

Threads
129,872
Messages
1,205,836
Members
171,049
Latest member
Azkaelika
Top