So, I found how to make special things happen when you choose sepcial names. This can be used when the player chooses the name of someone special to the MC(They could talk to you like they would to this person, considering you are them!), for easter eggs(Ex:. You write Poop and the game tells you you're immature and you go back to the name menu) or it could be used so the player can't use the name of an existing character.
I don't even know how to explain it, so I put some basic explanation in the code itself:
p "Hey, my name is Potato!"
$ player_name = renpy.input("And you, what's your name?") #Name insert is here
$ player_name = player_name.strip()
if player_name == "":
$ player_name= "Mashed boi" #This is the name you will have if you enter nothing
$ name="other"
if player_name == "Fries":
$ name="secret" #The access to the secret dialogue because of your name
if player_name == "fries":
$ name="secret" #Also avaible without the caplocks
else:
$ name="other" #When you enter anything else
if name == "secret": #You enter this anytime you want a secret dialogue
p "Oh, h-hey Fries senpai!"
if name == "other": #And this for the average ones
p "I didn't even know other things than potatoes were a thing!"
After some bug checking, I discovered that the blank space name only stays unbothered when you put it first. Or else your secret names won't work!
Last edited by Karunakku on Sat Oct 08, 2016 8:36 pm, edited 1 time in total.
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
define persistent.worthless = False
......
if player.name == "Poop" or player.name == "poop":
p "You're immature. I don't want to talk to you anymore!"
$ persistent.worthless = True
$ renpy.quit()
define persistent.worthless = False
......
if player.name == "Poop" or player.name == "poop":
p "You're immature. I don't want to talk to you anymore!"
$ persistent.worthless = True
$ renpy.quit()
So it doesn't matter if player name their character "Poopalicious" or "Poopmaster", it will always trigger.
would this also work if they tried a set of combinations of capital and lower case? (example would "PoOp, POOP, poop, etc." be treated the exact same? or would I have to code for all of those?)
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 89, in script
if name == "other":
File "game/script.rpy", line 89, in <module>
if name == "other":
NameError: name 'name' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 89, in script
if name == "other":
File "C:\Users\Katherine\Downloads\renpy-6.99.11-sdk\renpy\ast.py", line 1647, in execute
if renpy.python.py_eval(condition):
File "C:\Users\Katherine\Downloads\renpy-6.99.11-sdk\renpy\python.py", line 1670, in py_eval
return py_eval_bytecode(code, globals, locals)
File "C:\Users\Katherine\Downloads\renpy-6.99.11-sdk\renpy\python.py", line 1665, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/script.rpy", line 89, in <module>
if name == "other":
NameError: name 'name' is not defined
Windows-8-6.2.9200
Ren'Py 6.99.11.1749
Blood of Betrayal 1.0
here is my script for the section. maybe I typed something in wrong?
label start:
$ Damien_Points = 0
$ Matthew_Points = 0
$ Sam_Points = 0
$ Erik_Points = 0
$ James_Points = 0
$ Energy_Points = 75
$ Sanity_Points = 90
$ Family_Points = 0
$ Transform_Points = 0
$ player_name = renpy.input("What is your name?")
$ player_name = player_name.strip()
if player_name == "":
$ player_name= "Katherine"
$ name="other"
if player_name [:4].lower == "mika":
$ name="secret"
if name == "other":
jump story
if name == "secret":
if persistent.mika1== false:
P "Huh . . ?"
P "Who are you?"
P "It doesn't matter."
P "Just go away."
P "I don't want to relive what that monster did to me."
$ persistent.mika1 = true
return
elif persistent.mika2== false:
P "Wha-?"
P "Why are you back?"
P "Don't you understand that I don't want to talk?"
P "Just leave me alone."
$ persistent.mika2 = true
return
elif persistent.mika3 == false:
P ". . ."
return