Kato-A

Artist and developer
Veteran
Joined
Feb 9, 2017
Messages
197
Reaction score
441
First Language
Spanish
Primarily Uses
RMMV
OK, here is my problem.
I'm using the show choices command to make a small extra menu.
Is there a way to remember the last choice the player took?
For example if he took choice 2, when he returns to the choices command window, choice 2 is highlighted.

That brings me to the question: Is there any way to make the choice window highlighted the choice that I indicate? (only with that I think I'll be able to do it)

For example: I created a variable.
If option 2 is selected the variable becomes 2.
Before showing the choices window again I check if that variable is 2 and then highlighted the choice 2.

I explained myself well? English is not my language. If you don't understand me, I can continue explaining.
:rhappy:
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
450
Reaction score
370
First Language
German
Primarily Uses
RMMV
I can think of two ways to accomplish this. Sadly both are a bit convoluted as the default editor only allows you to set a fixed default choice in the show choice event command.

The first method uses pure eventing. Setup your choice like this:
Code:
◆If:Previous Choice = 1
  ◆Show Choices:A, B, C (Window, Right, #1, -)
  :When A
    ◆Common Event:A branch
    ◆
  :When B
    ◆Common Event:B branch
    ◆
  :When C
    ◆Common Event:C branch
    ◆
  :End
  ◆
:Else
  ◆If:Previous Choice = 2
    ◆Show Choices:A, B, C (Window, Right, #2, -)
    :When A
      ◆Common Event:A branch
      ◆
    :When B
      ◆Common Event:B branch
      ◆
    :When C
      ◆Common Event:C branch
      ◆
    :End
    ◆
  :Else
    ◆Comment:...
    ◆
  :End
  ◆
:End

The other method would be to head over to the script call list ( ) and take a look at how to setup a show choice with javascript instead of an event command. Then you can simply pass the value of your variable saving the previous choice as the defaultIndex parameter.
 

Kato-A

Artist and developer
Veteran
Joined
Feb 9, 2017
Messages
197
Reaction score
441
First Language
Spanish
Primarily Uses
RMMV
Thanks! @eomereolsson
I also came up with option 1 you gave. I'll try option 2 too and see which one works best for me.
Although I wish there was some script called for just changing the highlighted choice.
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
450
Reaction score
370
First Language
German
Primarily Uses
RMMV
Sadly a single script call is not possible, as the choice setup from an event command happens all inside a single function Game_Interpreter.setupChoices. To have a chance to modify only the default selection and leave the rest to the standard execution you would need a plugin to hook into that function.
 

Kato-A

Artist and developer
Veteran
Joined
Feb 9, 2017
Messages
197
Reaction score
441
First Language
Spanish
Primarily Uses
RMMV
I understand, I'll see if I ask for a plugin, I think it would make everything easier for me.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,936
Reaction score
15,991
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

Latest Threads

Latest Profile Posts

Sometimes I wonder why I still try and recruit others to help with my games. It never works.
ScreenShot_10_3_2022_4_27_17.png
welp, thanks to Luna MV, I was able to add the Balloon as a window... thus allowing me to edit the font color and outline... so now it looks like comic bubbles above characters. I have NO idea why I couldn't get this to work through more conventional means, but here we are.
CUTE CUTE CUTE.gif
I cannot cease doing cute art
War and Wonder is a 100% choice-based open-world visual novel.
1664821313732.png
1664821466359.png
1664821547746.png
Going live soon on Twitch, and will continue Fortunastreet's game "Verloren". For those who are curious, you are welcome to join ;)

-> Franz' Twitch channel

Forum statistics

Threads
125,749
Messages
1,173,225
Members
164,911
Latest member
KyzerKiba
Top