改中文名字教程来了友友们。首先用记事本打开game文件夹下的script.rpy文件
将label namemc:
scene warning
with fade
pause 4.5
stop music fadeout 5
scene blackscreen
with dissolve
$ mc_name = renpy.input("Name your character! Max 10 characters", allow=" 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", length=10).strip() #the66
if mc_name == "":
"lease give your character a name that is between 2-10's characters long."
jump namemc
if mc_name is not None:
$ check_name = len(mc_name)
if check_name == 1:
"You must name your character a minimum of 2 letters."
jump namemc
$ mc_name = mc_name.title()
"Do you want to name you character [mc_name]?"
menu:
"Yes":
pass
"No":
jump namemc
window hide
with fade
替换成label namemc:
scene warning
with fade
pause 4.5
stop music fadeout 5
scene blackscreen
with dissolve
# 从 name.txt 读取中文名字(文件放在 game 文件夹里,编码 UTF-8)
python:
try:
with open(config.gamedir + "/name.txt", "r", encoding="utf-8") as f:
mc_name = f.read().strip()
except:
mc_name = "默认名"
if mc_name == "":
mc_name = "默认名"
"Do you want to name you character [mc_name]?"
menu:
"Yes":
pass
"No":
jump namemc
教大家一个怎么起中文名字的办法,记事本打开script.rpy文件后将label namemc:
scene warning
with fade
pause 4.5
stop music fadeout 5
scene blackscreen
with dissolve
$ mc_name = renpy.input("Name your character! Max 10 characters", allow=" 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", length=10).strip() #the66
if mc_name == "":
"lease give your character a name that is between 2-10's characters long."
jump namemc
if mc_name is not None:
$ check_name = len(mc_name)
if check_name == 1:
"You must name your character a minimum of 2 letters."
jump namemc
$ mc_name = mc_name.title()
"Do you want to name you character [mc_name]?"
menu:
"Yes":
pass
"No":
jump namemc
window hide
with fade这一段代码改为label namemc:
scene warning
with fade
pause 4.5
stop music fadeout 5
scene blackscreen
with dissolve
# 从 name.txt 读取中文名字(文件放在 game 文件夹里,编码 UTF-8)
python:
try:
with open(config.gamedir + "/name.txt", "r", encoding="utf-8") as f:
mc_name = f.read().strip()
except:
mc_name = "默认名"
if mc_name == "":
mc_name = "默认名"
"Do you want to name you character [mc_name]?"
menu:
"Yes":
pass
"No":
jump namemc