Page 1 of 1

[Solved] How to give the option to change default MC's name?

Posted: Tue May 14, 2013 7:27 pm
by Mimrose
Hi!

When creating my MC, I would like to have it so that the player is free to change the name of the MC to their own or to whatever name they'd like, also how to make it so the change is permanent. (For example, if the MC's name was changed to Cecilia, what would you need to do so that every time the MC's name shows up, it would show Cecilia instead of the default name). Unfortunately, since I'm fairly bad at coding outside the basics, I'm not quite sure how to go about it.

Any help would be appreciated!!

Thank you :)

Re: How to give the option to change default MC's name?

Posted: Tue May 14, 2013 7:39 pm
by Googaboga
Add this to the game when it is time for the player to choose their name:

Code: Select all

$ player_name = renpy.input("Enter name: ").strip()
$ p = Character(player_name, color="#736AFF")
You can change the p to something else if you want. p is the shortcut you use when writing dialog for the character. If you would rather have the short cut be mc or something it is fine.

You can also change the color section to whatever color you want. It determines the color that the name is written in. It doesn't change the dialog color just the name in the text box that shows who is speaking. That particular set of numbers is for a sort of blueish color.


Oh and when a character mentions the MC by name in the game use this in the code:

Code: Select all

%(player_name)s
In the game it will show up as whatever the chosen name is.


I'm not sure if there is another way or not but that is what I've been doing.

Re: How to give the option to change default MC's name?

Posted: Tue May 14, 2013 7:40 pm
by Mimrose
Thank you so much! This is very helpful :D

Re: How to give the option to change default MC's name?

Posted: Tue May 14, 2013 7:42 pm
by Googaboga
No problem. Good luck with your game :].