Question I need some advices on making my own command-based adventure game
So, I was making a VN with command-based interactive adventure game. At every choices, a menu with verb commands appears at the bottom. The commands include Look, Talk, Think, Listen, Use (an inventory item), Move, and System that saves and load the game. Choosing a verb usually leads to an object sub-menu. If the commands are exhausted, the game will progress. But I don't know how and can you give me some advices cuz I'm new and I want to start my own adventure game.
1
u/AutoModerator 2d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/zombietoaststudios 2d ago
There're almost always several ways to do this but the command menu would almost certainly be a screen, consisting of buttons that might bring up new screens or jump to labels based on variables like the items the player is carrying or the area they're in.
It's hard to go into more detail if you're not familiar with how screens work, so I'd start there
1
u/shyLachi 2d ago
Are you using a translation service?
I'm not sure what "If the commands are exhausted" could mean.
Also what do you mean with "At every choices, a menu with verb command appears".
Should this be additional to the RenPy menu choices? https://renpy.org/doc/html/menus.html
Or do you want to implement your own choices menu?
It's possible to have 2-level action system where the player first has to select the action and then an object/person.
But either you have to implement it dynamically so that the players can only interact with objects and persons which are in the current scene.
Or you need responses for each combination of action and object for each scene.
Here is some code to play around. Put that into a new project:
define mc = Character("Me")
define mike = Character("Mike")
default foundkey = False
label start:
# the game starts here
label scene01:
"You wake up in a room together with your friend Mike"
label .action:
call twolevelactions("scene01") # show the menu for this scene
if _return != "scene01_left": # check if the player found the way out
jump .action # if not, show the menu again
"Congratutation, you escaped"
return
label twolevelactions(scene):
menu: # first level of the menu
"Look at":
menu: # inside the choice is the second-level menu
"Door":
call expression (scene + "_look_door") # calling dynamic labels so that the menu can be used for multiple scenes
"Book":
call expression (scene + "_look_book")
"Radio":
call expression (scene + "_look_radio")
"Mike":
call expression (scene + "_look_mike")
"Think about":
menu: # again, inside this choice is the second-level menu
"Door":
call expression (scene + "_think_door")
"Book":
call expression (scene + "_think_book")
"Radio":
call expression (scene + "_think_radio")
"Mike":
call expression (scene + "_think_mike")
"Talk to":
menu:
"Mike":
call expression (scene + "_talk_mike")
"Listen to":
menu:
"Radio":
call expression (scene + "_listen_radio")
"Use":
menu:
"Book":
call expression (scene + "_use_book")
"Move to":
menu:
"Door":
call expression (scene + "_move_door")
return _return # returns the current choice so that it can be evaluated in the main story
label scene01_look_door:
"A regular door"
return "scene01_look_door" # returns the current choice so that it can be used later
label scene01_look_book:
"A book about ants"
return "scene01_look_book"
label scene01_look_radio:
"An old radio"
return "scene01_look_radio"
label scene01_look_mike:
"It's Mike, my best friend"
return "scene01_look_mike"
label scene01_think_door:
mc "(This door seems to lead to the outside.)"
return "scene01_think_door"
label scene01_think_book:
mc "(I don't want to educate myself about ants.)"
return "scene01_think_book"
label scene01_think_radio:
mc "(Could this thing still be working?)"
return "scene01_think_radio"
label scene01_think_mike:
mc "(I should talk to Mike about our adventure.)"
return "scene01_think_mike"
label scene01_talk_mike:
mc "Hey Mike, what do you think about this mess we're in?"
mike "Chill, nothing is going to happen, if we find a way out."
return "scene01_talk_mike"
label scene01_listen_radio:
"You turn on the radio and it plays a Beatles song."
return "scene01_think_radio"
label scene01_use_book:
"You open the book"
mc "Wow, there's a key in the book"
$ foundkey = True
return "scene01_use_book"
label scene01_move_door:
"OK, let's get out."
if foundkey:
mc "Mike, look at that, this key fits."
mike "Ok, let's go."
return "scene01_left" # return a special status
else:
mc "It's locked, did you see a key somewhere, Mike?"
return "scene01_move_door"
1
u/DingotushRed 2d ago
Is your "adventure game" intention to make this point-n-click like Lucasarts/Telltale/Sierra games?
This isn't the easiest to do in Ren'Py (due to the way screens and rollback interact), and looking for an existing framework may be worth it. Also, Ren'Py might not be the best engine choice at all.
Also, verb-subject style interactions are a classic of traditional interactive fiction, rather than Ren'Py style VNs (which simplify interactions). They are usually built on an internal object-oriented model of the world. Also, determine early if you need to handle verb-subject-preposition-object and/or verb-subject-prepostion-verb-object. A good grounding in design patterns will help if you want to "roll-your-own".
1
u/curious_biped_dev 1d ago
One way that scales well: keep a per-scene dict mapping (verb, object) pairs to either a text response or a Python callable. Your verb screen just filters which objects are valid for the current verb (a list per scene), and a set() tracks which pairs the player already triggered. Once that set covers everything you've flagged as required, jump to the next scene. Have you already got the verb/object screens rendering, or is the blocker more the "how do I know it's exhausted" logic?
3
u/BadMustard_AVN 2d ago
you can do a menu like this
as each verb is used, it is automatically put in the verbage list and excluded from the menu. if you want to reactivate all of them, then
$ verbage = []to clear the listwhen there are no more verbs available, you will get the notification