How to make a textbox jump to or call a screen

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
Hudacious
Regular
Posts: 27
Joined: Sun Aug 28, 2016 3:20 pm
Contact:

How to make a textbox jump to or call a screen

#1 Post by Hudacious »

I know for a fact that this is probably a silly issue with an easy fix but I can't seem to get it working.

I found an open source email messaging system on this site and have been experimenting with it.
I'd like to be able to have the user press the "EXIT" textbutton then return to a screen.

This is the code initially:

Code: Select all

textbutton "Exit" action Hide("mailbox")
This is what I have tried to do:

Code: Select all

textbutton "Exit" action call screen ("PC")
I have tried that with different variations but I always recieve an error saying:

"File "game/messages.rpy", line 174: u'call' is not a keyword argument or valid child for the textbutton statement.
textbutton "Exit" action call screen ("PC")"

I've then tried various other attempts such as trying to jump to a label each with no effect.

If it helps; my exact intention is to take the player to the PC screen once they click the Exit button.

Any help would be greatly appreciated!

Thank you!

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How to make a textbox jump to or call a screen

#2 Post by Per K Grok »

Hudacious wrote: Tue Feb 19, 2019 10:51 am I know for a fact that this is probably a silly issue with an easy fix but I can't seem to get it working.

I found an open source email messaging system on this site and have been experimenting with it.
I'd like to be able to have the user press the "EXIT" textbutton then return to a screen.

This is the code initially:

Code: Select all

textbutton "Exit" action Hide("mailbox")
This is what I have tried to do:

Code: Select all

textbutton "Exit" action call screen ("PC")
I have tried that with different variations but I always recieve an error saying:

"File "game/messages.rpy", line 174: u'call' is not a keyword argument or valid child for the textbutton statement.
textbutton "Exit" action call screen ("PC")"

I've then tried various other attempts such as trying to jump to a label each with no effect.

If it helps; my exact intention is to take the player to the PC screen once they click the Exit button.

Any help would be greatly appreciated!

Thank you!
Try

Code: Select all

textbutton "Exit" action Show("PC")

If you want to jump to a label it would be Jump("PC")

So you need to start with an uppcase-letter in screens for these commands. You can use Call as well, but I've had some strange results with that from screens, though that might just be me doing stuff wrong. :)

Hudacious
Regular
Posts: 27
Joined: Sun Aug 28, 2016 3:20 pm
Contact:

Re: How to make a textbox jump to or call a screen

#3 Post by Hudacious »

Per K Grok wrote: Tue Feb 19, 2019 12:50 pm
Hudacious wrote: Tue Feb 19, 2019 10:51 am I know for a fact that this is probably a silly issue with an easy fix but I can't seem to get it working.

I found an open source email messaging system on this site and have been experimenting with it.
I'd like to be able to have the user press the "EXIT" textbutton then return to a screen.

This is the code initially:

Code: Select all

textbutton "Exit" action Hide("mailbox")
This is what I have tried to do:

Code: Select all

textbutton "Exit" action call screen ("PC")
I have tried that with different variations but I always recieve an error saying:

"File "game/messages.rpy", line 174: u'call' is not a keyword argument or valid child for the textbutton statement.
textbutton "Exit" action call screen ("PC")"

I've then tried various other attempts such as trying to jump to a label each with no effect.

If it helps; my exact intention is to take the player to the PC screen once they click the Exit button.

Any help would be greatly appreciated!

Thank you!
Try

Code: Select all

textbutton "Exit" action Show("PC")

If you want to jump to a label it would be Jump("PC")

So you need to start with an uppcase-letter in screens for these commands. You can use Call as well, but I've had some strange results with that from screens, though that might just be me doing stuff wrong. :)
Thanks a ton for your reply!

Unfortunately I keep coming across a specific issue.

If I use these codes

Code: Select all

textbutton "Exit" action Show("PC")

Code: Select all

textbutton "Exit" action Call("PC")

Code: Select all

textbutton "Exit" action Jump("PC_Label")
All that happens is that the screen goes to an empty screen and just freezes, as in, I can't click, press or do anything.

Any idea on what the issue could be?

Cheers.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How to make a textbox jump to or call a screen

#4 Post by Per K Grok »

Hudacious wrote: Tue Feb 19, 2019 12:56 pm
----

All that happens is that the screen goes to an empty screen and just freezes, as in, I can't click, press or do anything.

Any idea on what the issue could be?

Cheers.
The problem is probably somewhere else in the code, not with that specific line.

If you show more of the code we have a better change of seeing what might be the problem.

Hudacious
Regular
Posts: 27
Joined: Sun Aug 28, 2016 3:20 pm
Contact:

Re: How to make a textbox jump to or call a screen

#5 Post by Hudacious »

Per K Grok wrote: Tue Feb 19, 2019 1:31 pm
Hudacious wrote: Tue Feb 19, 2019 12:56 pm
----

All that happens is that the screen goes to an empty screen and just freezes, as in, I can't click, press or do anything.

Any idea on what the issue could be?

Cheers.
The problem is probably somewhere else in the code, not with that specific line.

If you show more of the code we have a better change of seeing what might be the problem.
Alright! PM sent!

Post Reply

Who is online

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