Player Names

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
SilverPhoenix34
Newbie
Posts: 5
Joined: Tue Nov 19, 2019 10:31 pm
Contact:

Player Names

#1 Post by SilverPhoenix34 »

Hi everyone, I'm working on a story, and I've figured out how to allow the player how to put a name in for their character, but I don't know how to get that to become the default name on the text box, or how to get the other characters to use that name when they're talking. Any advice?

User avatar
Palas
Newbie
Posts: 15
Joined: Thu Feb 14, 2013 3:19 pm
Soundcloud: palasvuash
itch: pequigames
Location: Brazil
Contact:

Re: Player Names

#2 Post by Palas »

I suppose you want to display the player's input, right? You just have to use [variable name] in the text string.

Check this page out.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Player Names

#3 Post by rayminator »

it should be something like this

Code: Select all

python:
        povname = renpy.input("What is your first name?")
        povname = povname.strip()

        if not povname:
            povname = "Yuuichi"
for the default name it should look like something like this

Code: Select all

define a = Character("[povname]", type=adv)
define Yuuichi = Character("Yuuichi")
define ch = Character("Chika")
for the line should look like this

Code: Select all

     ch "Hello there how are you today, [povname]."
     a "Just fine."

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Player Names

#4 Post by Kia »

I would change the character's name directly, saves you one step of defining an extra variable, but at the end there's not that much of difference between the two methods

Code: Select all

        python:
            name = renpy.input("My name is...")
            name = name.strip()
            if name:
                p.name = name
        "Hello [p.name]"
                

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Player Names

#5 Post by isobellesophia »

There are many to make that one, so i suggest this.

Code: Select all

label naming:
    python:
        name = renpy.input(_("Anything! But real names i really wanted."))

        name = name.strip() or __("Student")
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: No registered users