Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
until such that on the last part using an if statement to determine if the player will get a good or bad ending...
I' tried practicing that very idea but I'm a bit unfamiliar with Ren'Py.
Would be great if someone can tell me on how to do it .
The Ren'Py language doesn't support setting variables (except in special cases), but Python does. You can turn a Ren'Py statement into a Python statement by prefixing it with "$" or putting it in a "python:" block.
"Greetings, user!"
menu:
"Where do you want to go?"
"Here":
$ count = 1
"There":
$ count = 2
"Your count is currently %(count)d."
python:
count += 1
"Your count is now %(count)d."
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
On line 182 of C:\renpy-6.11.2\Games\--\---/game/script.rpy: reached end of line when expecting ':'.
if Sneak = True
On line 129 of C:\renpy-6.11.2\--\---/game/script.rpy: invalid syntax
$ Sneak = True
What do I do? I tried what I can but I never fixed this one
Er hem. Like it says, you're missing a colon; for checking things with if, you need to end in a colon and indent the next line. You also need to use double equals sign for checking things. So,