Hello all,
I have an issue I'm trying to resolve, but don't really know where to start on this one.
In my game, there is a button permanently displayed which displays an inventory screen. On the inventory screen, there is another button which calls (not jumps) to code which displays a virtual computer system (think DDLC). When the user logs off from this virtual computer, a RETURN is issued which takes them back to the line following the original call, so that they once again see the inventory.
The problem is this. The inventory can be activated at any time, which means that the virtual computer system writes all over whatever was on the screen. When the user closes the inventory and returns to the game, they are still looking at the graphics from the virtual computer instead of what was there before - so I need to be able to somehow save the screen state including all displayed graphics and layers before the call and restore them afterwards. How do I do this?
It's too late to implement the virtual computer as a screen, because I'd have to rewrite thousands of lines of code.
TIA,
Simon
Saving and restoring screen state
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.
-
- Regular
- Posts: 80
- Joined: Thu Dec 31, 2020 3:37 pm
- Contact:
- Ocelot
- Lemma-Class Veteran
- Posts: 2437
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Saving and restoring screen state
Welcome to the reality of software development.RewindTheGame wrote: ↑Sat Jan 13, 2024 7:57 am It's too late to implement the virtual computer as a screen, because I'd have to rewrite thousands of lines of code.
But if you want a qick fix, you can call you label in new context which should create a basically a new game state:
https://www.renpy.org/doc/html/label.html#contexts
< < insert Rick Cook quote here > >
-
- Regular
- Posts: 80
- Joined: Thu Dec 31, 2020 3:37 pm
- Contact:
Re: Saving and restoring screen state
Thank you, this works perfectly .Ocelot wrote: ↑Sat Jan 13, 2024 8:30 amWelcome to the reality of software development.RewindTheGame wrote: ↑Sat Jan 13, 2024 7:57 am It's too late to implement the virtual computer as a screen, because I'd have to rewrite thousands of lines of code.
But if you want a qick fix, you can call you label in new context which should create a basically a new game state:
https://www.renpy.org/doc/html/label.html#contexts
Who is online
Users browsing this forum: Ahrefs [Bot]