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

mfexplorer

Regular
Regular
Joined
Aug 9, 2022
Messages
89
Reaction score
19
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

Regular
Regular
Joined
Jun 12, 2016
Messages
41
Reaction score
11
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

Regular
Regular
Joined
Aug 9, 2022
Messages
89
Reaction score
19
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

Regular
Regular
Joined
Jun 12, 2016
Messages
41
Reaction score
11
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 Profile Posts

Woke up in the middle of the night with some game mechanic ideas. Unfortunately, they're for a new game, not the one I'm currently working on. Must... not... get... distracted!
I'm wondering about making a new pack of monsters or just divide them and add to my current packs. I'll end up having like 10+ packs If I just have 27 per pack xD
cesariohelp wrote on Ms Littlefish's profile.
Hi ! I see that you're a mod, right ? Can I ask you a question here ? If not, where ? So sorry
I just whipped up the blueprints for the final level in my game. (I say final, when really there is a final boss stage after this, but it's only like two maps long)
The good thing about making a scarecrow is, I can just use a T-pose on it and call it an animation. :kaojoy:
SA145K_idle.gif

Wait... it is starting to move on its own?:kaoswt2:

Forum statistics

Threads
134,936
Messages
1,252,020
Members
177,777
Latest member
bobg
Top