Japanese ADV Interaction Menu

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
TheSchnappi
Newbie
Posts: 4
Joined: Sat Aug 22, 2020 7:13 pm
Contact:

Japanese ADV Interaction Menu

#1 Post by TheSchnappi »

Hi there,

when I started messing arround with RenPy I really wanted to create a game that was like the old japanese ADV games from the 80's and 90's, where you could walk arround the game world and had to interact with the game through a simple menu system. For people who are not familiar with this kind of navigation, here is a simple video from the Eve Burst Error Remake, that shows how these kind of menues work: https://www.youtube.com/watch?v=FKNLoJEgnpM

Anyway I soon had to realize that RenPy missed this feature so I had to write this feature by my own. And while I often switched projects over the last couple of years, this module always stayed with me in each new project. With each failed project the module became more powerful and at some point I realized that maybe other people would find this useful too.
So I started to rewrite and restructure the ADV module from scratch, added a ton of comments so other people could understand what was going on and trued to make the module as easy to use as possible for people even without much coding knowledge.

Changelog:
  • Separated the verb action menu into its own screen to reduce code redundancy
FAQ:
What is this module?
This module adds a menu based interaction system to RenPy like it was popularized by "The Portopia Serial Murder Case" and used by many games in the 80's and 90's.

Features
  • Old style ADV menu
  • Automatic tracking of options the player interacted with
  • Displays if an action was not yet selected
  • Displays if an action is exhaust and can be ignored by the player
  • Icon symbols for verbs
  • Verbs can be selected by pressing the number keys
  • Supports modern hamburger style menu or old-school box menu
  • Easy separate menu styling based on RenPys styling
How do I install the module?
Simply copy the two attached files somewhere into your project. To inizialize the module simply call the init_module_adv label at the beginning of your game (Using the call function will intialize the module and then return to your game code).

How can I customize the menu?
I know that the default's appearence of this module is very basic at best and more a demonstration.
The appearance for the menu can be modified in the module_adv_config.rpy file. The options for customization are based on RenPys default appearance options with global variables to simply edit the the look of the menu without meddling with RenPy's style system.

How do I create a menu window?
First you want to clear all previously registered actions with the adv_mode.clear_actions() function.
Then you need to register your different actions the player should interact with. To register an action you simply call the adv_mode.register_action() function with three parameters:
  • The first parameter is the verbs internal name you want to use for this action, like "use" or "look".
  • The second parameter is the text of the action, something like "Room" or "Chair".
  • The third parameter is simply the name of the label the action will jump when clicked.
For example to register the use of a chair you would write something like this:

Code: Select all

$ adv_mode.register_action("use", "Chair", "use_chair_label")
After you have registered all your actions, you simply call the adventure menu screen with call screen adv_menu to display al registered options.

How do I add or modify the verbs of the game?
If you want to change or add your own verbs to the game you just have to modify the verb registration inside the init_module_adv_verbs label in the module_adv_config.rpy file.
Adding a new verb can be done with the adv_mode.register_verb() function that takes three parameters:
  • The first parameter defines the verbs internal name you will use when registering actions.
  • The second parameter defines the icon of the verb. You can either add images as a text tag or use a special font icon. I would suggest the use of a font for more styling options.
  • The third parameter is the displayed name of the verb in the game itself.
Can you give an example how one might create a game with the module?
Here is a simple two room setup to give you an idea how one might use the module. The example can be used without any customization. To start the demo, simply jump to the example_room_enter label.

Code: Select all


define t = Character("Tipsy")

####### ROOM 1 ########
# Jump to this label after initializing the module to start the demo
label example_room_enter:
    scene bg uni
    jump example_room_menu


# Creation of the room menu
label example_room_menu:
    # First we clear all old ADV actions
    $ adv_mode.clear_actions()

    # Now we register the new ADV menu interactions
    $ adv_mode.register_action("look", "Around", "example_room_look_room")
    $ adv_mode.register_action("look", "Information board", "example_room_look_board")
    $ adv_mode.register_action("look", "Students", "example_room_look_students")
    $ adv_mode.register_action("look", "Street Lamps", "example_room_look_lamp")

    $ adv_mode.register_action("think", "Self", "example_room_think_self")

    $ adv_mode.register_action("use", "Street Lamps", "example_room_use_lamp")

    $ adv_mode.register_action("move", "Club Rooms", "example_room2_enter")

    # After we registered all ADV actions, we call the ADV menu
    call screen adv_menu


# The labels the menu jumps to
label example_room_look_room:
    "This is an example to show you the potential and the features of the ADV menu."
    $ set_choice_exhaust("example_room_look_room")
    jump example_room_menu


label example_room_look_board:
    "Hello and welcome to the presentation of the Japanese Style Adventure Menu."
    "When you are done familiarizing yourself with the menu, move to the Club Rooms and talk with Tipsy for an in-depth explanation."
    $ set_choice_exhaust("example_room_look_board")
    jump example_room_menu


label example_room_think_self:
    if get_choice_repeat("example_room_think_self") == 0:
        "Hm... I don't have any idea who I am..."
    elif get_choice_repeat("example_room_think_self") == 1:
        "Come on, you have to get yourself together, THINK!"
        "..."
        "Still nothing."
    elif get_choice_repeat("example_room_think_self") == 2:
        "Maybe if I try to remember REALLY REALLY hard, something will come to my mind."
        "*concentrate*"
        "*CONCENTRATE*"
        "... No use... there is nothing inside my head..."
        $ set_choice_exhaust("example_room_think_self")
    else:
        "I don't think that thinking any harder will change anything at this point."
    jump example_room_menu


label example_room_look_students:
    if get_choice_repeat("example_room_look_students") == 0:
        "A bunch of students are running around."
    elif get_choice_repeat("example_room_look_students") == 1:
        "Hey, one of them has a very nice jacket!"
    else:
        "They are just students."
        if get_choice_repeat("example_room_look_students") == 2:
            "Wait... maybe I am a teacher?"
            $ set_choice_exhaust("example_room_look_students")
    jump example_room_menu


label example_room_look_lamp:
    "Electric lamps in the style of an old gas lamps are decorating the path."
    $ set_choice_exhaust("example_room_look_lamp")
    jump example_room_menu


label example_room_use_lamp:
    if get_choice_repeat("example_room_use_lamp") == 0:
        "How do you find the light switch? This is a street lamp."
    else:
        "As hard as you try to look, you can not find a switch for the lamp."
        $ set_choice_exhaust("example_room_use_lamp")
    jump example_room_menu




####### ROOM 2 ########
label example_room2_enter:
    scene bg club
    jump example_room2_menu


label example_room2_menu:
    # First we clear all old ADV actions
    $ adv_mode.clear_actions()

    # Now we register the new ADV menu interactions
    $ adv_mode.register_action("look", "Around", "example_room2_look_room")

    $ adv_mode.register_action("talk", "Tipsy", "example_room2_talk_tipsy")

    # This is a demonstration how you can enable or disable a action based on its state
    if not get_choice_exhaust("example_room2_use_tipsy"):
        $ adv_mode.register_action("use", "Tipsy", "example_room2_use_tipsy")

    $ adv_mode.register_action("move", "Club Rooms", "example_room_enter")

    # After we registered all ADV actions, we call the ADV menu
    call screen adv_menu


label example_room2_look_room:
    "This is an example to show you the potential and the features of the ADV menu."
    "Here you can find Tipsy, who can provide you with more information."
    $ set_choice_exhaust("example_room2_look_room")
    jump example_room2_menu


label example_room2_talk_tipsy:
    show tipsy
    t "Hey, I am Tipsy and I am here to help you with the Adventure Menu."
    t "I hope on your way to me you already got a small impression for what this module can do."
    hide tipsy
    jump example_room2_menu


label example_room2_use_tipsy:
    show tipsy
    if get_choice_repeat("example_room2_use_tipsy") == 0:
        t "Of course you have to \"use\" the NPC. Great Job."
    if get_choice_repeat("example_room2_use_tipsy") == 1:
        t "Hey, stop using me, once was enough!"
    if get_choice_repeat("example_room2_use_tipsy") == 2:
        t "I said, stop using me!"
    if get_choice_repeat("example_room2_use_tipsy") == 3:
        t "..."
        t "Are you finished? Good, because I now remove this option!"
        $ set_choice_exhaust("example_room2_use_tipsy")
    hide tipsy
    jump example_room2_menu

Attachments
module_adv_config.rpy
(8.22 KiB) Downloaded 142 times
module_adv.rpy
(14.69 KiB) Downloaded 147 times

User avatar
Critical Deluxe
Newbie
Posts: 5
Joined: Sun Mar 24, 2019 9:12 pm
Contact:

Re: Japanese ADV Interaction Menu

#2 Post by Critical Deluxe »

This is so cool!! I was reminded of playing YU-NO as soon as it started. I could totally imagine using this for certain exploration segments in a game for example, so thanks for making it!

User avatar
TheSchnappi
Newbie
Posts: 4
Joined: Sat Aug 22, 2020 7:13 pm
Contact:

Re: Japanese ADV Interaction Menu

#3 Post by TheSchnappi »

Thanks! It is funny that it reminds you of YU-NO because YU-NO was actually the main trigger for me to try and fix the tracking problem in these games with showing the state of your actions. Navigating YU-NOs different time lines over and over again really amplified all the problems I had with the system.

User avatar
Moshibit
Regular
Posts: 50
Joined: Wed Oct 16, 2019 1:58 pm
Location: Mexico
Contact:

Re: Japanese ADV Interaction Menu

#4 Post by Moshibit »

Hello, good job, I really liked this system, I did not know the way in which Japanese visual novels were made before, it is very interesting, thanks for sharing.

User avatar
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Japanese ADV Interaction Menu

#5 Post by Morhighan »

Thank you for sharing this, I was considering making one but you've saved me the effort. :)

User avatar
comicsansdev
Newbie
Posts: 11
Joined: Wed Feb 10, 2016 8:27 pm
Completed: Lost Dreams
Organization: Dream Syrup
Tumblr: dreaming-pixels
itch: cecilchestnut
Contact:

Re: Japanese ADV Interaction Menu

#6 Post by comicsansdev »

hey! this looks really neat and i'd really love to use it, but whenever i try to use just your example coding there to see what it would look like (i also have the files in my game folder), the whole thing is just one big error and i can't do anything with it. i wonder if this has something to do with the newest version of renpy breaking the code or something? or maybe i'm doing something wrong?

i was wondering if there was any way for you to post a demo file so i can see what i was doing wrong with the set up?

User avatar
Moshibit
Regular
Posts: 50
Joined: Wed Oct 16, 2019 1:58 pm
Location: Mexico
Contact:

Re: Japanese ADV Interaction Menu

#7 Post by Moshibit »

comicsansdev wrote: Mon Nov 07, 2022 7:30 pm hey! this looks really neat and i'd really love to use it, but whenever i try to use just your example coding there to see what it would look like (i also have the files in my game folder), the whole thing is just one big error and i can't do anything with it. i wonder if this has something to do with the newest version of renpy breaking the code or something? or maybe i'm doing something wrong?

i was wondering if there was any way for you to post a demo file so i can see what i was doing wrong with the set up?
so that you can use the framework you have to put in the start label:

Code: Select all

label start:

    call init_module_adv

    jump example_room_enter

    return
Create a new rpy file, and place the example code.

I have tested the framework in RenPy 3.0.8 and it works fine. Maybe you are skipping a step.
Attachments
test_adv_jap.zip
(808.89 KiB) Downloaded 45 times

User avatar
comicsansdev
Newbie
Posts: 11
Joined: Wed Feb 10, 2016 8:27 pm
Completed: Lost Dreams
Organization: Dream Syrup
Tumblr: dreaming-pixels
itch: cecilchestnut
Contact:

Re: Japanese ADV Interaction Menu

#8 Post by comicsansdev »

Moshibit wrote: Sat Nov 12, 2022 1:29 pm
so that you can use the framework you have to put in the start label:

Code: Select all

label start:

    call init_module_adv

    jump example_room_enter

    return
Create a new rpy file, and place the example code.

I have tested the framework in RenPy 3.0.8 and it works fine. Maybe you are skipping a step.
ah thank you! yeah it looks like i was missing a step; its been a bit since i've done any coding in renpy so i forgot to call the module. thank you again for the help!!

Post Reply

Who is online

Users browsing this forum: Nozori_Games