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.
-
Lydenia
- Newbie
- Posts: 13
- Joined: Mon Apr 08, 2013 11:32 pm
-
Contact:
#1
Post
by Lydenia » Wed Apr 10, 2013 11:31 pm
Hay,
i use this to define the playername:
Code: Select all
$ player_name = renpy.input("Enter your Name.")
$ player_name = player_name.strip()
And now i want to show the playername like the others
charakter's at the top of the messages. I tryed two things:
1.
Code: Select all
"%(player_name)s" "Message that the player will say"
2.
Code: Select all
$ P = Character('%(player_name)s', color="#1d61cc")
But both will show %(player_name)s as name instead of the name that the
player choosed.
Anyone got a idear how to fix this?
Last edited by
Lydenia on Thu Apr 11, 2013 2:38 am, edited 1 time in total.
-
RangerDanger
- Regular
- Posts: 45
- Joined: Wed Jun 27, 2012 11:36 pm
-
Contact:
#2
Post
by RangerDanger » Thu Apr 11, 2013 12:52 am
You simply would need to pass the string object that is returned from renpy.intput() to the Character() function, like so:
Code: Select all
$ player_name = renpy.input("Enter name: ").strip()
$ p = Character(player_name, color="#FFFFFF")
p "I can now say things!"
-
Lydenia
- Newbie
- Posts: 13
- Joined: Mon Apr 08, 2013 11:32 pm
-
Contact:
#3
Post
by Lydenia » Thu Apr 11, 2013 2:37 am
Awesome!
Thank you!

Users browsing this forum: No registered users