Call and Return Screens (SOLVED)

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
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Call and Return Screens (SOLVED)

#1 Post by AsHLeX »

Hi! I have a simple question regarding calling screens. How do I call the same screen twice but have it return to the right place?

Code: Select all

label english_dialogue:
	call screen tic_tac_toe(difficulty = [1, 2, 2, 3, 3], rounds = 5, is_player_move_first = None)
	"Congratulations, you finished the game!"
	
label japanese_dialogue:
	call screen tic_tac_toe(difficulty = [1, 2, 2, 3, 3], rounds = 5, is_player_move_first = None)
	"おめでとうございます。ゲームは終了しました。"
I vaguely remember in old ren'py having to use something like call x from y to differentiate between returning to english_dialogue or japanese_dialogue, but it seems this doesn't work anymore...? (Or maybe it wasn't a thing to begin with and I'm just dreaming). Please help! I feel like there's a simple solution here that I'm somehow missing. Thank you very much.
Last edited by AsHLeX on Thu Dec 21, 2023 7:12 pm, edited 1 time in total.
Image
New demo out 24/12/23!!

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

Re: Call and Return Screens

#2 Post by Ocelot »

First of all: calling things and returning back should just work, unless you intentionally mess things up.
Second: call screen does not actually calls anything and there is no real return. You shuld deliberately jump to another label to not end up in the same place from where you callded screen.

Third: unless you want two languages to coexist together at the same time, you should just use translation framework to handle translations.
< < insert Rick Cook quote here > >

User avatar
AsHLeX
Miko-Class Veteran
Posts: 556
Joined: Wed Dec 25, 2013 1:09 pm
Completed: Starlight Dreamers, Mysterious Melody, Town of Memories, Marked, To Fly, The Change, Him From The Past, A Forgotten Memory
Projects: Cafe Mysteria
Location: Malaysia
Contact:

Re: Call and Return Screens (SOLVED)

#3 Post by AsHLeX »

Thanks for the response!
Image
New demo out 24/12/23!!

Post Reply

Who is online

Users browsing this forum: No registered users