In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Sehaf
Regular
Posts: 58 Joined: Thu Feb 25, 2010 9:22 pm
Projects: Demon Lord & Yuki Academy
Deviantart: Sehad
Location: Sweden
Contact:
#1
Post
by Sehaf » Thu Nov 30, 2017 5:52 pm
Hi simple question really, but found no answers in search.
When the player is alowed to enter any text, I can check the text for key words
Code: Select all
if "Lego" in yc:
p "LotR fan are you?"
Like so...
My question is, how do I have it check without bothering with if its capslock or not?
Tried:
Code: Select all
if "Lego" of "lego" in yc:
p "LotR fan are you?"
But then it trigered no mather what I wrote.
Errilhl
Regular
Posts: 164 Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:
#2
Post
by Errilhl » Fri Dec 01, 2017 7:38 am
Code: Select all
if "LEGO" in yc.upper():
#or
if "lego" in yc.lower():
Basically, what you do is not checking for either lower or upper, but matching the content of the word against a uniform string, regardless of capitalisation.
Currently working on:
Users browsing this forum: No registered users