CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

Ren'Py How to allow characters to use special names in certain context?

ChaosOpen

Well-Known Member
Game Developer
Sep 26, 2019
1,014
2,144
Right now I've pretty much got the name your own character thing down, however, I want to give the player the option to have girls call him a different name during sex, while the dialogue name card still displays his original name.

So, here is the script for the intro:
Python:
label start:
    define p = Character( "[pName]"),color="#ff0000")
    $ pname = renpy.input("Choose a different name or stick with Logan", default="Logan").strip().capatalize()
And pretty much I can use "p" to use the name for the character card or put in [p] if I want the characters to say his name in dialogue. Standard "choose your own name" affair, works pretty well.

However, I'd like to have a second name the girls can refer to the MC as during sex or special occasions. I've tried several methods. Lets say the character they picked was "Bob" but they want the girls to call them," honey" during sex. How do I do that?

I've tried putting
Python:
label start:
    define m= Character( "[pName]"),color="#ff0000")
    $ pname = renpy.input("Choose a name for her to use during sex", default="Logan").strip().capatalize()
It changes the name to whatever they picked, so if I picked "sensei" they will say: "I love having sex with sensei" but the player name will also be permanently changed to sensei.

Putting
Python:
label start:
    define m= Character( "[mName]"),color="#ff0000")
    $ mname = renpy.input("Choose a name for her to use during sex", default="Logan").strip().capatalize()
The other characters will simply refer to [m] as [mName].
 

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,828
24,436
why do you create a 2nd Character object if you only need a pet name or whatever within dialogues.
use renpy.input to define a string variable and use it within your dialogues.

Python:
define p = DynamicCharacter("p_name", color="#ff0000")

label start:

    label .playername:
        $ p_name = renpy.input("Choose a different name or stick with Logan", default="Logan").strip().capitalize() or "Logan"
        $ p_pet = renpy.input("Choose a pet name for [p_name]", default="honey").strip() or "honey"
        
        menu:
            p "My name is [p_name] and my girl calls me [p_pet].\nIs this correct?"

            "Yes":
                pass
            "No":
                jump .playername
 

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
why do you create a 2nd Character object if you only need a pet name or whatever within dialogues.
use renpy.input to define a string variable and use it within your dialogues.

Python:
define p = DynamicCharacter("p_name", color="#ff0000")

label start:

    label .playername:
        $ p_name = renpy.input("Choose a different name or stick with Logan", default="Logan").strip().capitalize() or "Logan"
        $ p_pet = renpy.input("Choose a pet name for [p_name]", default="honey").strip() or "honey"
       
        menu:
            p "My name is [p_name] and my girl calls me [p_pet].\nIs this correct?"

            "Yes":
                pass
            "No":
                jump .playername
Hi there. How can I specify a certain point in the game when the second name should take effect?
 

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,828
24,436
Hi there. How can I specify a certain point in the game when the second name should take effect?
not sure what do you expect here.
if you've created a string variable as pet name, you can use it afterwards as you see fit.
if you've created a Character() object as pet name, you can use it after you've declared the variable determining the name, otherwise the variable substitution in Character("[p_name]") fails and shows [p_name] as string or raises a name not defined error in DynamicCharacter("p_name").
 

Niv-Mizzet the Firemind

Active Member
Mar 15, 2020
575
1,121
If we assume you've asked for the petname earlier with something like this:
$ mname = renpy.input("What does she call you during sex", default = "honey").strip()

Can't you just do this in the girl's dialogue during the scene, without creating an additonal character?
m "I'm having sex with [mname]"
 

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
not sure what do you expect here.
if you've created a string variable as pet name, you can use it afterwards as you see fit.
if you've created a Character() object as pet name, you can use it after you've declared the variable determining the name, otherwise the variable substitution in Character("[p_name]") fails and shows [p_name] as string or raises a name not defined error in DynamicCharacter("p_name").
Thanks for the reply. Sorry if I misunderstood the subject. I needed an option to add a name
at a later point in my game without changing the displayed name. I wa sunder the impression that it
had to be defined before the label start but actually could do it anywhere I want. (I'm a bit tired as of now)
Code I inserted:

mac "First we got to chose a name for the VaRena fights."
az "Chose a cool one."
mac "Let's see ..."

$ team = renpy.input("What´s our VaRriorname?")
$ team = team.strip()

mac "Our name for the VaRena is [team]."
az "Sounds really cool. [team]."
az "Now that our team has a name ..."
az "Where do we get my mods?"
 
  • Like
Reactions: the66