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
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
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.
Code: Select all
$ adv_mode.register_action("use", "Chair", "use_chair_label")
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.
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