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.
-
ReAnimator
- Regular
- Posts: 64
- Joined: Mon Dec 16, 2013 1:00 pm
-
Contact:
#1
Post
by ReAnimator » Wed Aug 24, 2022 9:02 am
Code: Select all
timer 0.1 action If(x, Function(a), None) repeat True
and
Code: Select all
if x:
timer 0.1 action Function(a) repeat True
These two are the same thing? If so which one is preferable?
The latter one saves the resource more?
-
m_from_space
- Veteran
- Posts: 302
- Joined: Sun Feb 21, 2021 3:36 am
-
Contact:
#2
Post
by m_from_space » Thu Aug 25, 2022 4:48 am
First method:
- timer is called every 0.1 seconds, even if x is not True
Second method:
- timer is called every 0.1 seconds, only after x is True
Second method is preferable.
By the way, you don't have to include "None" inside the If() function, the False statement is None by default.
-
ReAnimator
- Regular
- Posts: 64
- Joined: Mon Dec 16, 2013 1:00 pm
-
Contact:
#3
Post
by ReAnimator » Thu Aug 25, 2022 7:28 am
Thanks for clarification! Much appreciated!
Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]