default player_name = "Unnamed"
define mc = Character("[player_name]")
label start:
scene black with fade
$ player_name = renpy.input("What is your name? {i}(Just press ENTER for 'Steve'){/i}", )
$ player_name = player_name.strip() or "Steve"
mc "My name is [mc]"
"*** THE END ***"
return
player_name.strip()
is to remove spaces on the beginning or end of names.or "Steve"
is just shorthand. If [player_name] is blank, it'll use "Steve" instead.$ mc = renpy.input()
... it's stupid. You're effectively throwing away the Character()
object with all it's attributes and replacing it with just a String() object. No colors, no outline colors, etc. It's just a bit of simple code that lots of people have been copy-pasting without knowing any better for years.mc "My name is [player_name]"
too. Using the mc
Character() object instead is a slightly better habit, since it means you can do it with other character names too... which is a good habit which leaves things open for changing other character names too in addition to the mc..rpa
files). You can unpack them using tools like UnRen. (Grab the current 0.9 alpha version, as 0.8 won't unpack some more recent games)..rpy
files still aren't there, you can use UnRen again to convert the .rpyc
files back into .rpy
files..rpy
file separately).steves_house.png
or steve_sitting.png
. You could avoid changing them on accident by not using "Change All...", but it'll be a lot of wasted time checking things line by line. My suggestion is that if you go this route, do the "Change All..." and then fix anything that breaks as you go along.Or, to avoid the many issues you talked about, there's the possibility to do it in the fly :Let's assume the standard name is "Steve" and you want to use "Xander"...
A simple edit would be to use a text editor [...]
init python:
def myNameChange(text):
return renpy.re.sub( r'\b{}\b'.format( MODmcName ), MODwantedName, text )
config.say_menu_text_filter = myNameChange
default MODmcName = "Steve"
default MODwantedName = "Xander"
Character
object.If you really are talking about other people's games, and those games didn't give you the choice to change the mc's name... then you have two options...
"No".
Okay... That's the simple answer. The author didn't think to allow you to change the character's name and therefore the code probably doesn't even come close to working that way.
"Maybe".
This one would require some work and a bit of understanding of the way RenPy games are coded.
Most games are compressed to use RenPy Archive files (.rpa
files). You can unpack them using tools like UnRen. (Grab the current 0.9 alpha version, as 0.8 won't unpack some more recent games).
Once unpacked, you should be able to edit the source code. If the.rpy
files still aren't there, you can use UnRen again to convert the.rpyc
files back into.rpy
files.
Let's assume the standard name is "Steve" and you want to use "Xander"...
A simple edit would be to use a text editor (RenPy uses versionYou must be registered to see the linksas it's recommended editor) to change all the places where it says "Steve" to "Xander". (Editors as good as Atom will let you do "Change all" across multiple files at the same time... less complex editors might mean you need to edit each.rpy
file separately).
Except... because the game wasn't written that way... you might cause some unintended changes. Like maybe there are a series of pictures likesteves_house.png
orsteve_sitting.png
. You could avoid changing them on accident by not using "Change All...", but it'll be a lot of wasted time checking things line by line. My suggestion is that if you go this route, do the "Change All..." and then fix anything that breaks as you go along.
You could of course change all the references of "Steve" to "[mc]" and add the code I wrote in the first post. But it that seems like it might be hard work for you... then don't.
That was some lovely devotion to precise explanation.. ty.If you're talking about your own game... it sounds like you want something like this:
You'll see lots of variations on this in various game.Python:default player_name = "Unnamed" define mc = Character("[player_name]") label start: scene black with fade $ player_name = renpy.input("What is your name? {i}(Just press ENTER for 'Steve'){/i}", ) $ player_name = player_name.strip() or "Steve" mc "My name is [mc]" "*** THE END ***" return
Theplayer_name.strip()
is to remove spaces on the beginning or end of names.
Theor "Steve"
is just shorthand. If [player_name] is blank, it'll use "Steve" instead.
You'll see lots of games that will do$ mc = renpy.input()
... it's stupid. You're effectively throwing away theCharacter()
object with all it's attributes and replacing it with just a String() object. No colors, no outline colors, etc. It's just a bit of simple code that lots of people have been copy-pasting without knowing any better for years.
You could domc "My name is [player_name]"
too. Using themc
Character() object instead is a slightly better habit, since it means you can do it with other character names too... which is a good habit which leaves things open for changing other character names too in addition to the mc.
It you want the completely over the top version... see my other post...
https://f95zone.to/threads/suggestion-code-for-multi-game-persistent-character-names.55475/
Ah. Yeah... That's a much better option than my "Maybe" answer.Python:init python: def myNameChange(text): return renpy.re.sub( r'\b{}\b'.format( MODmcName ), MODwantedName, text ) config.say_menu_text_filter = myNameChange default MODmcName = "Steve" default MODwantedName = "Xander"
Honestly, I wrote the first reply... then re-read your first post and realized you probably were talking about other people's games. Rather than delete it, I figured I'd just do a quick edit and leave both there to cover all the bases.That was some lovely devotion to precise explanation.. ty.
The game clearly let name your MC, so yes there's a way to do this. But it all depend of the game, so ask in the game thread, it's where you'll be the more likely to have an answer.I'm midway through a game, and had to load another person's save. as a result my MC's name changed from "Vinnie" to "You".
Is there a way for me to change the name back to Vinnie? surely this could be done using console??
Most likely, yes.I'm midway through a game, and had to load another person's save. as a result my MC's name changed from "Vinnie" to "You".
Is there a way for me to change the name back to Vinnie? surely this could be done using console??
"You"
).{name of variable}="Vinnie"
and press <ENTER>. (Without the silly brackets, pc_name="Vinnie"
for example).Thanks !!Most likely, yes.
But it depends on the game.
You could use a tool like the savefile editor here.
Or a website likeYou must be registered to see the linksthat does similar things online. (edit: website didn't work for me - or at least didn't show string values).
Alternatively, as long as you have the developer mode/console mode enabled, you can use the console to do it...
Start the game with dev+console enabled.Load your saved game.Press [shift+D] to open the developer menu.- Select the Variable Viewer.Find the variable that you can recognize as the player's name (it's value will be"You"
).Make a note of the name of that variable.Return to the developer menu.Press [shift+O] to open the console.Type{name of variable}="Vinnie"
and press <ENTER>. (Without the silly brackets,pc_name="Vinnie"
for example).Press <ESC> to return to the game with your new name.Save.