[Solved] Can _return return values from multiple screens or only one screen? (only one)

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved] Can _return return values from multiple screens or only one screen? (only one)

#1 Post by henvu50 »

Can _return return values from multiple screens or only one screen?

If only one screen, does this mean screens were designed to only use one in most cases? Imagine you have a quest button, inventory button, stats button, interactable elements in the form of imagebuttons, directional arrows to move around(imagebuttons).... Should all of these things ideally be on one single screen, then if you need to change it around, you redraw that one screen with different elements based on game state?
Last edited by henvu50 on Mon Jun 21, 2021 7:43 pm, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Can _return return values from multiple screens or only one screen?

#2 Post by Ocelot »

_return is just a variable where result of call screen interaction is stored. It is not dissimilar to use of _ variable in Python console. It will store result of interactio with any called screen, so, if you want to keep that value, you need to copy it before next call screen statement.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]