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

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
360
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
193
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,711
Reaction score
2,824
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
360
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
193
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,372
Reaction score
8,395
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,711
Reaction score
2,824
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
360
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,711
Reaction score
2,824
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
781
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

IlluminaughtyStore.jpg
:kaojoy:
Welcome to the Illuminaughty store.
Yes... they are "wearing Illuminati branded everything, reclining on huge Illuminati body pillows. Occasionally they'll "teehee" at each other and have pillow fights with Illuminati branded pillows full of hundred dollar bills."
BCj
Working on Escalia again, feels good. Have this overwhelming urge to map as well, but need to get some extra tiles commissioned first :D
Lee Sang wrote on Bandito's profile.
Hi, I've just tried your plugin "Game is Active" and when I tested it on Android, it gave me an error, something about "Cannot read property 'underfined' of underfined.
With my project, I want the player to have access to all the tools they need to get from New Game to Credits as soon as possible; I want the player's progress to only be impeded by the player not knowing how to use the tools the game provides.
Just a little close up shot...
w2xZocX.jpg

Forum statistics

Threads
113,867
Messages
1,078,045
Members
147,958
Latest member
Disty
Top