[SOLVED] I can't figure out what "from" does after a call command

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
User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

[SOLVED] I can't figure out what "from" does after a call command

#1 Post by Chekhov » Thu Nov 22, 2018 5:39 am

So I'm going through some old code I've written and at some point I changed a simple call into a call that includes a from.

I have no idea what this does or why I did that.

The page about "call" seems to have no documentation about it: https://www.renpy.org/doc/html/label.html

Code: Select all

        call happyday from _happyday
Anyone know what this does, or what problem it solves?
Last edited by Chekhov on Thu Nov 22, 2018 9:45 am, edited 2 times in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: I can't figure out what "from" does after a call command

#2 Post by Imperf3kt » Thu Nov 22, 2018 6:26 am

Its not something you did, that is something Ren'Py does automatically.
I'm not entirely sure what its purpose is, but I think it has something to do with the call stack.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

Re: [SOLVED] I can't figure out what "from" does after a call command

#3 Post by Chekhov » Thu Nov 22, 2018 9:46 am

Thank you Imperf3kt, you just saved me days of worrying about it.

rames44
Veteran
Posts: 232
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: [SOLVED] I can't figure out what "from" does after a call command

#4 Post by rames44 » Fri Nov 23, 2018 1:47 pm

As I understand it, Ren’py makes use of labels as part of its save/load logic in order to help handle situations when a save is made with one script and then loaded using an edited script. Essentially, depending on the nature of the changes, Ren’py will roll back until it’s happy it’s back in sync. The “call from” essentially provides Ren’py with a label associated with the “call” statement to help that process, so that it can “back itself out” of the call if required and know where it is. Bad description, perhaps, but that’s more or less what those are in there for.

When you create a distribution, by default Ren’py will add the “from” clauses to your code automatically. (There’s an option for this on the build screen, if you look for it.) You can disable this option if you want, but it’s not a good idea...

User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

Re: [SOLVED] I can't figure out what "from" does after a call command

#5 Post by Chekhov » Sat Nov 24, 2018 1:23 pm

That is a pretty good explanation Rames, thanks.

Post Reply

Who is online

Users browsing this forum: Google [Bot], span4ev