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.
Line of code that checks for script:
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.
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Line of code that checks for script:
Try config.missing_label_callback
https://www.renpy.org/doc/html/config.h ... l_callback
https://www.renpy.org/doc/html/config.h ... l_callback
-
- 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:
Ok, I am completely new to this, so could you please explain this to me?saguaro wrote:Try config.missing_label_callback
https://www.renpy.org/doc/html/config.h ... l_callback
(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.
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Line of code that checks for script:
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
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."
-
- 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:
Thank you!
Who is online
Users browsing this forum: No registered users