My code is now officially a jungle and is now very, very hard to look at (not to mention very hard to understand and I now scroll up and down quite often... very, very long scrolls).
Until I tried to look at the demo and saw a line like this...
Code: Select all
e "Hi, and welcome to the Ren'Py demo game."
show eileen happy
e "My name is Eileen, and I'm here to demonstrate some of the features of the Ren'Py visual novel engine."
# Show the editor button, which is defined in editor.rpy.
$ show_editor_button = True
e "See that button in the upper-right corner of the screen?"
e "It shows where we are in the script. You can click it, and we'll try to open the file in a text editor."
e "It's an easy way to see how you can use the features I'm showing off."
e "We'll only show it for code that's intended to be easy to understand."
call demos from _call_demos_1
And carefully examined each one and noticed they all have one thing in common...demo_animation.rpy
demo_transitions.rpy
and the list goes on...
at the bottom of the code is a very, very familiar line that says...
OK... This is how I understand it (Correct me if I'm wrong)return
Ren'py will run as usual and when it reaches a section that looks like this...
Code: Select all
e "We'll only show it for code that's intended to be easy to understand."
call demos from _call_demos_1
Code: Select all
return
(Again... correct me if I'm wrong)
Now here's my question
In my code I will have a thing like this...
Then a label (Choice) will pop up and you will choose from...Mr. K
Let's see...
Mr. K
First, Mika invited me to eat lunch with her in the gym...
Mr. K
Second, Elena said she'll bring me lunch.
Mr. K
But I've heard rumors that the library is now being flocked by students.
Mr. K
Male students to be more precise.
What I wanted to happen is if you choose...Choice 1
Leave faculty room and go see Mika
Choice 2
Wait for Elena
Choice 3
Feed curiosity and go to library
But, what I wanted is a bit more precision...Choice 1
You will be magically teleported to a file named mika.rpy
Choice 2
You will be magically teleported to a file named elena.rpy
Choice 3
You will be magically teleported to a file named lucy.rpy
Let's say that I am now inside the file mika.rpy
and inside is a line that looked like this...
What I wanted here is for us to be teleported back to the original script (script.rpy) but this time I wanted to be teleported precisely to a label named "class_b_1" inside the original script (script.rpy).Mika
Uh... aren't you supposed to be going back to your class now.
Mr. K
Nah... let me lie here for 5 more minutes.
Mika
I'm dissapointed in you... I can't believe those words are coming from a teacher.
Mr. K
OK... I'll go now.
In short...
What I'm asking here is if possible, could someone tell me how to jump from one file to another like for example I am inside a file named script.rpy and wanted to jump to a very precise label inside mika.rpy (example - label eatlunch_a)
The reason why I wanted to do this is I wanted to divide my code into tiny easily readable, managable bits.
Thanks in advance.
(goes back to work...)