Call screen and the return variable

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
Pascalsage
Newbie
Posts: 6
Joined: Tue Sep 09, 2014 2:31 pm
Contact:

Call screen and the return variable

#1 Post by Pascalsage »

Hi, so I'm currently working on a visual novel for fun.and one of the problems I have been having atm the moment is the _return variable to my screen. In my code, I would call the screen in a label and it will return one of the following strings : move, search, or use. But when I call the screen In a different label. It would only return move no matter what I do.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Call screen and the return variable

#2 Post by xela »

Magical screens? Carefully go through both labels/screen calls, there should be some cause for this.
Like what we're doing? Support us at:
Image

Pascalsage
Newbie
Posts: 6
Joined: Tue Sep 09, 2014 2:31 pm
Contact:

Re: Call screen and the return variable

#3 Post by Pascalsage »

here's my screen code

screen Action_menu():
window:
has vbox

text "What is your action?"
textbutton "move" action Return("move")
textbutton "search" action Return("search")
textbutton "use" action Return("use")

and here's the working piece of code

label nirvana:
show bg hallway
with dissolve
play music "Mazes.mp3"
"you find yourself in a dark blue hallway, almost voided from any light at all."
"the walls and floor are forged with blue marble that paves the only two ways. forwards and backwards."
"there is a strange tint in the air. and it makes you uneasy. quickly you search your mind for your own personally being. but a questions arises from you thought that you ask yourself."
$ Name = renpy.input(_("What is your name?")) or _("unknown")

if Name == "unknown":
"you can't seem to recall your name at all. the feeling vexes you."
else:
"your name is [Name!t]. you are certain of this fact"

"you start to get up, and search your surrounding. so far you seem to be the only living being alive. but staying here seems like bad decision."
jump Nirtwo

label Nirtwo:
if y == 1:
"you find yourself in a small corridor, leading only back and forth"
if y == 2:
show bg Blackout
with dissolve
show bg near
with dissolve
"at a far you start to notice a dim light shining at the distance. it's faint. but recognizable"
if y == 3:
show bg Blackout
with dissolve
show bg Intersect
with dissolve
"you find your self in a small intersection. to your left is an open passage. to your right is a door."
if y == 4:
show bg Blackout
with dissolve
show bg DeadEnd
with dissolve
"further down the hallway, you find yourself venturing further into darkness. the closer you move to this, the more an eery chill runs down your spine."
"you believe it's best not to continue your journey with this pass."
jump A

label A:
call screen Action_menu
act = _return

if act == "move":
jump Move
if act == "search":
"you search your surrounds as well as your self."
"you notice you're dressed in tattered white clothing. but other than that, there's nothing that interests you"
jump A
if act == "use":
"there's nothing to use in this area."
jump A

label Move:
menu:
"North" if y < 5:
$ y = y + 1
jump Nirtwo
"South" if y > 0:
$ y = y - 1
jump Nirtwo
"Enter the passage way" if y == 3:
show bg Blackout
with dissolve
show bg Float
with dissolve
"you enter inside the passage"
"through the entrance you small platforms that are suspended over a pitch black void. you also see a small path over to the right."
jump Passage

"check the door" if y == 3:
show bg Blackout
with dissolve
show bg MysteryDoor
with dissolve
"you see a door."
jump Door


now here's the piece of code that i'm having issue with

label Door:
call screen Action_menu
$ act == _return

if act == "use":
menu:
"Door":
"it's locked"
jump Door
"Apple":
"you eat the apple."
"suddenly you hear a click from the door."
$ lock0 = "false"
jump door
if act == "search":
"you inspect the door for a brief moment."
"after several moments, you find strange markings under the window of the door."
"round, red, and solid yet liquid."
"Consume it's flesh to unveil the path"
jump Door
if act == "move":
menu:
"return":
jump Nirtwo
"enter" if lock0 == "false":
"you enter through the door"

for some reason _return always turns out to be "move" no matter what the user chooses

I'm still searching my code for the problem

Pascalsage
Newbie
Posts: 6
Joined: Tue Sep 09, 2014 2:31 pm
Contact:

Re: Call screen and the return variable

#4 Post by Pascalsage »

-table flip- never mind! I found the problem. Thank you for your help though

Post Reply

Who is online

Users browsing this forum: AdsBot [Google], henne, Ocelot, snotwurm