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

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
412
Reaction score
69
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
214
Reaction score
63
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,756
Reaction score
2,849
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
412
Reaction score
69
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
214
Reaction score
63
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,720
Reaction score
8,503
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,756
Reaction score
2,849
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
412
Reaction score
69
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,756
Reaction score
2,849
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
267
Reaction score
794
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

RivalRamen_Games wrote on jacobv1014's profile.
I really like your profile picture! Who is that in it? is she an OC?
Making his first game
This scene was suppose to be a test... but now, it's going in the game as official side/optional content. :kaosalute:


functionality(This is function demo not game demo)
1 The door of ABS map can open upon clearing all the monsters
2 Secret room/road arrow/lighting/whatever others can be shown upon clearing too
3 Boss HP bar and loot effect, loot jump and item name color as well as the pick-up animation effect
4 Back to town and "victory aftermath" screen for ABS maps/rooms
Playing one of the two RM2k3 games I was best known for back in the day, one I made in the Spring semester of my Freshmen year in college like 15 years ago, feeling all kinds of ways about it. I have not played this game in WELL over 10 years. I feel a million years old RN.

Forum statistics

Threads
115,328
Messages
1,089,005
Members
149,985
Latest member
bagil
Top