Hello,
Is there a way to get renpy to keep an eye on a variable all the time?
I am using a very simple time cycle just reducing a stamina variable every time the character moves between rooms and today i have to have a conditional statement in every room looking for the value of the stamina variable, and i am afraid i wil forget to paste this at some point, and bugger up the whole thing...
Is there a way for renpy to do this automatically?
sleepy time...
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.
-
- Newbie
- Posts: 14
- Joined: Wed Nov 29, 2017 10:49 am
- Contact:
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: sleepy time...
Is between rooms also between labels? If so:
https://www.renpy.org/dev-doc/html/conf ... l_callback
... sort of thing
https://www.renpy.org/dev-doc/html/conf ... l_callback
Code: Select all
default stamina = 100
init python:
def cb( lbl, context=False ):
if "stamina" in globals() and stamina < 25 and lbl not in [ "bedtime", "_quit" ]:
renpy.jump( "bedtime" )
pass
config.label_callback = cb
label start:
jump cycle
return
label cycle:
"[stamina]"
$ stamina -= 25
jump cycle
label bedtime:
"bedtime"
return
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
-
- Newbie
- Posts: 14
- Joined: Wed Nov 29, 2017 10:49 am
- Contact:
Re: sleepy time...
Solved by REMIX! Thanks for the support!
Who is online
Users browsing this forum: Ahrefs [Bot], voluorem