Load file (with python/renpy variables) specifically inside label start:

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
Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Load file (with python/renpy variables) specifically inside label start:

#1 Post by Errilhl »

Okay. I have some variables that are initalised after label start: due to them being modifiable by the player (player's name, and a couple of other characters). Due to some rules, I would like to be able to overwrite what these variables use as a "default" (not the keyword) if the user hasn't input anything yet.

So... is this possible?

Current code:

Code: Select all

label start:

    python:
        fPinput = renpy.input("First, we'll need to know your name (default, Marten):")
        fPinput = fPinput.strip()
        if not fPinput:
            fPinput = "Marten" 
        fMinput = renpy.input("Second, we'll need to know the name of your landlady (default, Anne):")
        fMinput = fMinput.strip()
        if not fMinput:
            fMinput = "Anne"
        fSinput = renpy.input("Third, the name of your housemate (default, Juliette):")
        fSinput = fSinput.strip()
        if not fSinput:
            fSinput = "Juliette"
        if fMinput == "Mom":
            shortfM = "mom"
            yourfM = "your "+fMinput+""
            yourshortfM = "your "+shortfM+""
            fMrole = "mother"
        else:
            shortfM = fMinput
            yourfM = fMinput
            yourshortfM = shortfM
            fMrole = "landlady"            
        if fSinput == "Sister":
            shortfS = "sis"        
            yourfS = "your "+fSinput+""
            yourshortfS = "your "+shortfS+""
            fSrole = "sister"
        else:
            if fSinput == "Juliette":
                shortfS = "Jules"
            else:
                shortfS = fSinput        
            yourfS = fSinput
            yourshortfS = shortfS
            fSrole = "housemate"                        
What I want to be able to do is basically change the fSinput and fMinput values via an external file, thereby making it go to the fMinput == "Mother" and fSinput == "Sister" instead of the other choices.

Any way I can go about doing this? Via an import or something? Based on whether or not a patch-file exist in the game-directory, was my thought.
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: BBN_VN, Bing [Bot]