Line of code that checks for script:

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
GROWLEX
Newbie
Posts: 4
Joined: Fri May 27, 2016 10:13 pm
Projects: Tale of Edwin Richbow
Organization: Growlex
Skype: TheCraizyGamer
Soundcloud: GROWLEX_Music
Contact:

Line of code that checks for script:

#1 Post by GROWLEX » Fri May 27, 2016 10:23 pm

Hello! I do say that signing up was a pain, but hopefully it was worth it. Our dev. team is writing an RPG style game. We want to use multiple scripts for convenience, but we are running into a problem with it. None of us can think of a way to have Ren 'Py check if a script is present. I thought we could use just a jump label, but if you don't have the script, it would give you an error, resulting in a bug we would need to fix. Then I thought we could assign a variable to the 2nd script, but that would also need to have a jump and label. Can anyone help me out?

By the way, it involves a chapter system, so that is why we want separate scripts, like DLC.

User avatar
saguaro
Miko-Class Veteran
Posts: 557
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Projects: ?
Organization: Lucky Special Games
Tumblr: saguarofoo
itch: saguarofoo
Location: USA
Contact:

Re: Line of code that checks for script:

#2 Post by saguaro » Fri May 27, 2016 10:46 pm


GROWLEX
Newbie
Posts: 4
Joined: Fri May 27, 2016 10:13 pm
Projects: Tale of Edwin Richbow
Organization: Growlex
Skype: TheCraizyGamer
Soundcloud: GROWLEX_Music
Contact:

Re: Line of code that checks for script:

#3 Post by GROWLEX » Fri May 27, 2016 10:51 pm

saguaro wrote:Try config.missing_label_callback
https://www.renpy.org/doc/html/config.h ... l_callback
Ok, I am completely new to this, so could you please explain this to me?

(I don't want an error to happen.)
Last edited by GROWLEX on Fri May 27, 2016 11:11 pm, edited 1 time in total.

User avatar
saguaro
Miko-Class Veteran
Posts: 557
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Projects: ?
Organization: Lucky Special Games
Tumblr: saguarofoo
itch: saguarofoo
Location: USA
Contact:

Re: Line of code that checks for script:

#4 Post by saguaro » Fri May 27, 2016 11:09 pm

God, I can't get it to work either. Hell if I know. It's an election year and I'm losing my mind.

Use renpy.has_label
https://www.renpy.org/doc/html/label.ht ... .has_label

Code: Select all

    if renpy.has_label("some_label"):
        jump some_label
    else:
        "Label doesn't exist."

GROWLEX
Newbie
Posts: 4
Joined: Fri May 27, 2016 10:13 pm
Projects: Tale of Edwin Richbow
Organization: Growlex
Skype: TheCraizyGamer
Soundcloud: GROWLEX_Music
Contact:

Re: Line of code that checks for script:

#5 Post by GROWLEX » Fri May 27, 2016 11:17 pm

Thank you!

Post Reply

Who is online

Users browsing this forum: drKlauz, Google [Bot], hell_oh_world