[Solved]Calling a label/screen from 2 different files
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.
[Solved]Calling a label/screen from 2 different files
I have a question. Let's say there's a situation where I create all my labels and screens in one file. Can I affect/edit one of those in another file? Like if I share m game, can I just share one additional file that changes content from the 1st one, or do I have to repost the whole game once again. I wanna know it because I'm considering future changes that are way to small to reupload the whole project, so It'd be cool if there was an option to just throw another, smaller file.
Last edited by Doeny on Sat Nov 26, 2022 12:47 pm, edited 1 time in total.
- Ocelot
- Lemma-Class Veteran
- Posts: 2400
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Calling a label/screen from 2 different files
From the game point of view there are no individual files. Game behase as if all files were pasted together in one large script.
If you structure your game right to accept additional data and change its behavior based on that, you can do it.
For example, in this thread I posted an example of game you can update episodically. You can add new episodes, labels and unlock conditions in other files when nessesary.
viewtopic.php?f=8&t=61970
If you structure your game right to accept additional data and change its behavior based on that, you can do it.
For example, in this thread I posted an example of game you can update episodically. You can add new episodes, labels and unlock conditions in other files when nessesary.
viewtopic.php?f=8&t=61970
< < insert Rick Cook quote here > >
Re: Calling a label/screen from 2 different files
That's not exacly what I was looking for. For example, is there a way to "add" an imagebutton to already existing screen by adding another file to the game folder? Like is there a line of code that would allow me to change screen properties after the screen is once created? If I'm not saying things clear enought (which I'm probably not) I'll hand a lteral example.Ocelot wrote: ↑Sat Nov 26, 2022 10:54 am From the game point of view there are no individual files. Game behase as if all files were pasted together in one large script.
If you structure your game right to accept additional data and change its behavior based on that, you can do it.
For example, in this thread I posted an example of game you can update episodically. You can add new episodes, labels and unlock conditions in other files when nessesary.
viewtopic.php?f=8&t=61970
Here's an example code from original game file:
Code: Select all
screen home():
imagebutton:
focus_mask True
idle "door_1"
action Jump("room_1")
imagebutton:
focus_mask True
idle "door_2"
action Jump("room_2")
imagebutton:
focus_mask True
idle "door_3"
action Jump("room_3")
- Ocelot
- Lemma-Class Veteran
- Posts: 2400
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Calling a label/screen from 2 different files
If you originally make your screen in a way that allows further additions (by dynamically creating buttons following description in some list, for example, like in my by-chapter game), you can control that. If not, you cannot.
Alternatively, you can simply replace a single file containing that screen with updated version if you want, leaving rest of files alone.
From perfomance reasons there is no difference betwee one script file and hundred files, since they are loaded together as one single huge file, only organisation reasons.
Alternatively, you can simply replace a single file containing that screen with updated version if you want, leaving rest of files alone.
From perfomance reasons there is no difference betwee one script file and hundred files, since they are loaded together as one single huge file, only organisation reasons.
< < insert Rick Cook quote here > >
Re: Calling a label/screen from 2 different files
Alrighty, thankies.Ocelot wrote: ↑Sat Nov 26, 2022 12:39 pm If you originally make your screen in a way that allows further additions (by dynamically creating buttons following description in some list, for example, like in my by-chapter game), you can control that. If not, you cannot.
Alternatively, you can simply replace a single file containing that screen with updated version if you want, leaving rest of files alone.
From perfomance reasons there is no difference betwee one script file and hundred files, since they are loaded together as one single huge file, only organisation reasons.
Who is online
Users browsing this forum: Andredron