Page 1 of 1

How to know first letter of renpy.input?

Posted: Wed Sep 29, 2021 2:46 pm
by EternalVoid
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!

Re: How to know first letter of renpy.input?

Posted: Wed Sep 29, 2021 9:01 pm
by hell_oh_world
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.

Re: How to know first letter of renpy.input?

Posted: Thu Sep 30, 2021 10:09 am
by EternalVoid
Even though it's useful, i meant knowing what the first character is (for example "a" in "animal")

Re: How to know first letter of renpy.input?

Posted: Thu Sep 30, 2021 10:25 am
by EternalVoid