RMMV Force a particular choice inside "show choice window" via script call

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
358
Reaction score
51
First Language
Spanish
Primarily Uses
RMMV
Should be possible, right?
I've tried these two, but it just closes the choice window.

Code:
SceneManager._scene._messageWindow._choiceWindow._number = 2;
SceneManager._scene._messageWindow._choiceWindow.processOk();
 
Joined
Jul 12, 2020
Messages
192
Reaction score
41
First Language
English
Primarily Uses
RMMV
How is your choice window setup? To my understanding (which is not fully developed for coding just yet), you're commanding the game to pick option 2. Is option 2 the choice that closes the window by any chance?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,707
Reaction score
2,808
First Language
English
Primarily Uses
RMMZ
If you're forcing the choice, then you're not giving the player a choice to begin with, so what do you even need a show choice window for?
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
358
Reaction score
51
First Language
Spanish
Primarily Uses
RMMV
How is your choice window setup? To my understanding (which is not fully developed for coding just yet), you're commanding the game to pick option 2. Is option 2 the choice that closes the window by any chance?
Nope, it shows a message. I've tried using parts of DK's code but I got the same result. I wonder if someone can figure it out
 
Joined
Jul 12, 2020
Messages
192
Reaction score
41
First Language
English
Primarily Uses
RMMV
Nope, it shows a message. I've tried using parts of DK's code but I got the same result. I wonder if someone can figure it out

As Trihan suggested earlier, if you're going to force a choice in a choice window, perhaps there is no need for one at all?

If you really want to keep a choice window, an alternate solution I can think of is to just make the exact same events of the forced choice happen no matter which choice you pick. (Copy and paste the same events in the 1st and 2nd choice). You could even use a label and jump label technique, but that might be overdoing it.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,325
Reaction score
8,383
First Language
German
Primarily Uses
RMMV
Should be possible, right?
why?
as several people above explained this idea is illogical.

and the second problem is how the script function should be executed - if the choice windows is active, then no other event can be active and give the script command.
without an event, you would need a plugin to enter the function into an automated part of the engine.
so what plugin would you use, and where would it place that function - again most possibilities for such a function would be illogical and likely break other parts of the engine.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,707
Reaction score
2,808
First Language
English
Primarily Uses
RMMZ
The only possible function I can think of for what you're asking is that you're doing some sort of tutorial on choices and want a bit where a choice is picked "automatically" without player input as part of said tutorial.

If that's the case, I would use pictures for the sequence instead.
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
358
Reaction score
51
First Language
Spanish
Primarily Uses
RMMV
It's too long to explain.
Of course, there are workarounds, but forcing a choice would be the simplest and the most flexible one. But if no one has an answer I guess I'll have to take a different path.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,707
Reaction score
2,808
First Language
English
Primarily Uses
RMMZ
It's too long to explain.
Of course, there are workarounds, but forcing a choice would be the simplest and the most flexible one. But if no one has an answer I guess I'll have to take a different path.
Andar has pretty much already given you your answer: if a choice window is active, it will wait for the player to make a choice. There isn't really an insertion point in between to run code that makes the choice for you, and that is completely antithetical to the reason the choice window exists in the first place.

I'm genuinely unable to conceive of what your use case could possibly be: literally the only function of a show choice window is to select a different branch of event code depending on what the choice was, and then it continues executing the event from that branch. I'm not being snarky here: the implementation of "selecting a choice automatically" is literally "don't have a choice window and put whatever code was in the branch for that choice after the point where the choice would have been in the event".

If you're showing choices but don't want the player to choose one, you're not using a show choice window for what it was built for. If you don't want the choices to show and want to pick from a list of choices automatically anyway, this is functionally identical to just coding the event as if the choice didn't exist.
 

BK-tdm

Manga Maker
Veteran
Joined
Jun 21, 2018
Messages
265
Reaction score
780
First Language
English
Primarily Uses
RMMV
IF you want to force the choice you could simply make it so:
1)Yes.
2)Yes.
3)No... but actually yes.

Player HAS to make the choice so the window can advance so you have a few options:

Either make it obvious all choices are the same like i posted above.

Skip the choice altogether.

Give only one choice option so the player can only read it and press ok.

Give "different options" but the outcome is the same anyways, no one is looking under the hood except you, the maker, so no one can possibly know in the first run of the game that all the given options are practically the same.

Please note that faking "freedom of choice" will get you some angry reactions from some people :kaoswt2:
 

Latest Threads

Latest Posts

Latest Profile Posts

Sometimes a mechanic that is meant to add challenge is just annoying. Even the Final Fantasy games did not completely escape this pitfall of design. (FF8 draw system I'm looking at you - grrrr)
starting working on the sprites for one of my games major antagonists finally. here's the first frame of his chanting motion in battle.
Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.
Shoot Enemy Off-Screen, Run RPG Maker Game as a Web Server, & Thai Keyboard | RPG Maker News #109

Forum statistics

Threads
113,734
Messages
1,077,036
Members
147,762
Latest member
Bad_At_Scripting
Top