Ok, so I want to check the first letter of an input. So if for example I write ",commandhere" then it does something, but if it starts with "," but has something else behind I want to put an error message like "Unknown command" or something.
If I haven't explained myself good enough please tell me so I can explain it the best I can.
Please help!
How to know first letter of renpy.input?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
EternalVoid
- Newbie
- Posts: 10
- Joined: Thu Oct 15, 2020 9:59 am
- Soundcloud: DivinePlane
- Contact:
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Projects: The Button Man
- Organization: NILA
- Github: hell-oh-world
- Location: Philippines
- Contact:
Re: How to know first letter of renpy.input?
If you're familiar with lists, strings are pretty much like a list (a list of characters), and just like any other list, you can access its elements by indices.
-
EternalVoid
- Newbie
- Posts: 10
- Joined: Thu Oct 15, 2020 9:59 am
- Soundcloud: DivinePlane
- Contact:
Re: How to know first letter of renpy.input?
Even though it's useful, i meant knowing what the first character is (for example "a" in "animal")
-
EternalVoid
- Newbie
- Posts: 10
- Joined: Thu Oct 15, 2020 9:59 am
- Soundcloud: DivinePlane
- Contact:
Re: How to know first letter of renpy.input?
Nvm I found something here
https://stackoverflow.com/questions/710 ... -in-a-list
https://stackoverflow.com/questions/710 ... -in-a-list
Who is online
Users browsing this forum: No registered users