Change player's name with a fixed first letter
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- Lockvia
- Regular
- Posts: 124
- Joined: Wed Mar 26, 2014 8:02 pm
- Projects: Prank Masters
- Organization: Lockvia Studios
- Tumblr: Lockvia
- Deviantart: Lockvia
- Location: Australia
- Contact:
Change player's name with a fixed first letter
I have been thinking of using a story plot where the protagonist first letter in their name is the same as the rest of their family. Which made me wonder if it's possible to have an option of having a custom player's name but with a condition that the first letter needs to start with a specific letter like the letter 'M'.
- 78909087
- Veteran
- Posts: 277
- Joined: Sat Aug 16, 2014 2:33 pm
- Completed: Dungeons and Don't Do It, Wake Up
- Projects: Lethe
- IRC Nick: Pacermist
- Contact:
Re: Change player's name with a fixed first letter
To be honest, I became rather annoyed quickly with allowing people to choose their names. Now I set it as a menu, with prespecified names that people can choose. Here's a script example.
Under characters:
In the script, where the person should choose their name:
Don't mind the nvl clear- I was using a menu in NVL mode, but this would work in normal mode too.
You can use this idea with names that start with 'M' and it shouldn't make much of a difference.
Under characters:
Code: Select all
define me = DynamicCharacter("povname", color=(192, 64, 64, 255))Code: Select all
menu:
nvlq "Your name..."
"Alex.":
$ povname = "Alex"
nvl clear
"Aaron.":
$ povname = "Aaron"
nvl clear
"Jack.":
$ povname = "Jack"
nvl clear
"Ben.":
$ povname = "Ben"
nvl clear
"Iden.":
$ povname = "Iden"
nvl clearYou can use this idea with names that start with 'M' and it shouldn't make much of a difference.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Change player's name with a fixed first letter
Slightly more complex, you could redefine the input screen to be:
and then use:
Code: Select all
screen input(prompt):
window style "input_window":
has vbox
text prompt style "input_prompt"
hbox:
text "M"
input id "input" style "input_text"
use quick_menu
Code: Select all
$ povname = "M" + renpy.input("I know my name begins with M, but what is it?").strip()
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Contact:
Re: Change player's name with a fixed first letter
You can try:
Code: Select all
label start:
$ povname = ""
while not povname.startswith("M"):
$ povname = renpy.input("My name is...", default="M").strip()
if not povname.startswith("M"):
"Mmmmmm. I don't think so. My name starts with 'M'."Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Who is online
Users browsing this forum: Bing [Bot]
