[SOLVED]Call a label when a variable changes

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.
Post Reply
Message
Author
User avatar
Bruni Multimedia
Regular
Posts: 114
Joined: Mon May 15, 2017 12:23 pm
Projects: Yomi Alliance
Organization: Bruni Multimedia
itch: brunimultimedia
Contact:

[SOLVED]Call a label when a variable changes

#1 Post by Bruni Multimedia »

Hello fellow devs.

Today's question is: is it possible to instruct ren'py to call a specific label whenever a variable changes?

For example I have variable a = 0
Whenever I increase or decrease the number I would like to call label a_check to perform some actions based on the number.
Last edited by Bruni Multimedia on Fri Apr 19, 2019 8:41 am, edited 1 time in total.

rames44
Veteran
Posts: 233
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Call a label when a variable changes

#2 Post by rames44 »

Rather than directly updating the value, why not call a function to update it and do the checks at the same time?

User avatar
Bruni Multimedia
Regular
Posts: 114
Joined: Mon May 15, 2017 12:23 pm
Projects: Yomi Alliance
Organization: Bruni Multimedia
itch: brunimultimedia
Contact:

[SOLVED]Re: Call a label when a variable changes

#3 Post by Bruni Multimedia »

Oh, I see what you're suggesting. That would be quite a nice idea in fact! I hadn't thought about it, thanks!

Post Reply

Who is online

Users browsing this forum: Google [Bot]