[Solved] end of session hook for Python code

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
teh
Newbie
Posts: 17
Joined: Fri Jan 11, 2019 6:48 am
Contact:

[Solved] end of session hook for Python code

#1 Post by teh »

Hey folks,

When the game session starts, you can use init python to load specific code into the game. I'm wondering if there is a similar hook to call python when the session ends?

The Python page of the Documentation is not very explicit in this regard.

Any help appreciated! :)
Last edited by teh on Fri Mar 15, 2019 5:10 am, edited 1 time in total.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: end of session hook for Python code

#2 Post by xavimat »

Probably you could use the "quit" special label. And put a "python" block in it (or normal label code, not necessarily python).
https://www.renpy.org/doc/html/label.ht ... ial-labels

But I'd ask what are you trying to achieve. Maybe there are other means (like persistent variables, maybe).
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
teh
Newbie
Posts: 17
Joined: Fri Jan 11, 2019 6:48 am
Contact:

Re: end of session hook for Python code

#3 Post by teh »

Quit works perfectly, thank you!

Post Reply

Who is online

Users browsing this forum: No registered users