if flag:
$ renpy.run(...
How to let function execute only once each time when if flag is true?
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.
- Li yuanlin
- Regular
- Posts: 93
- Joined: Sat Aug 04, 2018 8:42 pm
- Location: Hong Kong
- Contact:
How to let function execute only once each time when if flag is true?
stay hungry,stay foolish.
Re: How to let function execute only once each time when if flag is true?
Code: Select all
if flag:
$ renpy.run(...)
$ flag = False
Code: Select all
default execute = True
label start:
if flag and execute:
$ renpy.run(...)
$ execute = False
- Li yuanlin
- Regular
- Posts: 93
- Joined: Sat Aug 04, 2018 8:42 pm
- Location: Hong Kong
- Contact:
Re: How to let function execute only once each time when if flag is true?
find a way:
in screen:
in game label:
Code: Select all
label set_qte1_word_name(formal_test=False):
if formal_test:
$ word = renpy.random.choice(list(formal_test_words_dict.keys()))
else:
$ word = renpy.random.choice(list(temp_test_words_dict.keys()))
$ word_color = renpy.random.choice([blue,green,yellow,red])
jump qte_begin
return
Code: Select all
timer .1 action Call("set_qte1_word_name",formal_test=persistent.qte1_formal_test)
Code: Select all
label start:
show screen qte1()
label qte_begin:
$ ui = ui.interact()
stay hungry,stay foolish.
Who is online
Users browsing this forum: Google [Bot], Li yuanlin