• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py Single Choice Menu Workaround

Atmus

New Member
Mar 28, 2018
10
7
Tired of single choice menus? So am I.

So I wrote this simple script that works around them as long as you use the 'enter' key to advance the dialogue. What it does is overrides the choice screen and checks how many items in the menu there are. If there is only 1 item, it sets that item as the default focus. So pressing enter will choose the single choice and advance past the menu.

This might not work on all games. Specifically ones that already modify the choice screen.

Edit: Updated to work with renpy versions older than 7.3.1.
 
Last edited:

jezzoo

Newbie
May 12, 2020
32
28
Interesting tool, do many games use "single choice" (no choice) menus? And what will your script do in standard multiple choice menus?
 

Atmus

New Member
Mar 28, 2018
10
7
I would say there are quite a few people who use single choice menus, much to the dismay of everyone else.

As for standard multiple choice menus, my code operates as default. No item will be selected.
 

majdaddin

Member
Nov 29, 2019
324
380
I add this to the end of the choice screen:

Python:
    if preferences.afm_enable and len(items) == 1:
        timer 3.0 action items[0].action
so you see the single choice menu for 3 seconds, and then automatically 'click' the button
 
Last edited:

Mattyd_OmOnekoVN

New Member
Oct 26, 2021
2
0
Hi, hope it's alright if I jump in here.
I have a single choice menu option in my game and if you can use the code, feel free:

```
label choiceA13:
call imenu ("choiceA13")
if _return == m1:
call iscene ("A13a")
```
and

```

jump choiceA13
# choice option starts here:

label en_choiceA13:
menu:
"Beat Goro at his own Game":
return m1
with dissolve


label en_A13a:
```
 

Mattyd_OmOnekoVN

New Member
Oct 26, 2021
2
0
Oops, The above bb code didn't add the indents - added here so you can see,
Top code I have ion a library.rpy file, and the bottom is in the script.rpy

(Placement is wonky, but this is a WiP)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,231
14,991
Code:
label choiceA13:
    call imenu ("choiceA13")
[...]
label en_choiceA13:
    menu:
        "Beat Goro at his own Game":
            return m1
Er... I get from your code that you should take a look at the part of Ren'py documentation regarding the . There's really no need to have a mechanism so complicated for your game support more than one language.
 

TDoddery

Member
Apr 28, 2020
166
152
Single choice menu can be good though, in the sense that it hints to the player that there may be other choices not yet unlocked.
 
  • Like
Reactions: majdaddin

jospaghettio

Member
Donor
Feb 13, 2019
419
1,404
Tired of single choice menus? So am I.

So I wrote this simple script that works around them as long as you use the 'enter' key to advance the dialogue. What it does is overrides the choice screen and checks how many items in the menu there are. If there is only 1 item, it sets that item as the default focus. So pressing enter will choose the single choice and advance past the menu.

This might not work on all games. Specifically ones that already modify the choice screen.

Edit: Updated to work with renpy versions older than 7.3.1.
Helpless question, is there a similar approach when there are two menu items where one is advance and one is end? Is there a way to set the advance option to default? Leaving the end option as cursor select.

Have a game where the advance option is 20 steps deep. It's tiring to move the cursor to advance 20 times. Thx.