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

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
354
Reaction score
49
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,699
Reaction score
2,800
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
354
Reaction score
49
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,279
Reaction score
8,361
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,699
Reaction score
2,800
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
354
Reaction score
49
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,699
Reaction score
2,800
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
772
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

Feel free to check out our "Touch the Stars" gamejam submission, "Starlight, Starbright!"
just finished playing one shot. im kinda disappointed with return the sun ending ngl. i was hoping there would be some after credits scene that would play with my emotions
So apparently the surprise Google Search page browser game saves your progress when you close the browser.

This really makes me miss the golden age of Flash gaming.
ohh man im ending oneshot now (im doing the last stepping puzzle rn) and the music is so...sad...like...ive been thinking recently about how fast moments pass and...my anxious thoughts combined with that music and nostalgia...like...im comfortably sad...and want to cry internally
We're playing one of the Touch the Stars game jam entries, come join us!

Forum statistics

Threads
113,552
Messages
1,075,790
Members
147,551
Latest member
ananansy
Top