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.
default oxygen = 10
init python:
def monitor_oxygen():
if hasattr(store, 'oxygen'):
if getattr(store, 'oxygen') <= 0.0:
renpy.jump("asphyxiate")
# this tells Ren'Py to run the named function whenever a python line is processed
config.python_callbacks.append( monitor_oxygen )
label start:
"... gasp"
$ oxygen -= 5
"... gasp"
$ oxygen -= 5
"... we never get here"
label asphyxiate:
"dead"