Help with condition 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
darckshame
Newbie
Posts: 19
Joined: Sun Feb 25, 2018 11:39 pm
Contact:

Help with condition changes

#1 Post by darckshame » Sun Jun 17, 2018 9:56 am

Hello, I have a question for you regarding condition changing in labels for a patch. I hope that I'll make it clear what I mean.

Lets say we have the same conditions set in different labels, but I don't want to go change them manually or with retyping every label and then use config.label_overrides, but with a single file that contains a label or a command like for config.label_overrides but only for the conditions and not the text or anything else, I also know about the hardChanged option for text, and I'm looking for something similar, for example:

Code: Select all

label exemple:
	if var == var1:
		do something...
		
label exemple1:
	if var == var1:
		do something...
how I want to do things:

Code: Select all

init 200 python:
    config.label_content_overrides = {
   	 "if var == var1:" : "if var == var2:"
   	 }
or:

Code: Select all

init 200 python:
    hardChanged = {
     	"if var == var1:" : "if var == var2:"
    	}
or:

Code: Select all

label change:
	if in labels find "if var == var1:":
		set {"if var == var1:" : "if var == var2:"}  
 

and having a result for the previous labels as:

Code: Select all

label exemple:
	if var == var2:
		do something...
		
label exemple1:
	if var == var2:
		do something...
I hope that I made it clear. So how do you recommend doing this, is it possible?

Thanks in advance for your help with this mater.

Post Reply

Who is online

Users browsing this forum: No registered users