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.
-
Georgine
- Regular
- Posts: 55
- Joined: Fri Jan 24, 2014 7:47 am
-
Contact:
#1
Post
by Georgine » Thu Mar 13, 2014 3:32 am
I'm almost certain this has to do with
return not working the way I think it does, but here's the setup: I'm allowing the player to select three things to do during the day-their choices are stored in string variables that point to the label associated with each activity, and whenever the player hits "Start" I want the game to jump to the label for their first choice, then repeat the process for their second and third choice. I initialized all three activity choices to point to the test screen and ran it, but instead of running the error message three times, pressing the button plays the message once and then returns me to the 'pick your activities' menu.
Code: Select all
$ Activity_1 = 'ActivityError'
$ Activity_2 = 'ActivityError'
$ Activity_3 = 'ActivityError'
textbutton "Start" action ui.callsinnewcontext ("activity_label")
label activity_label:
jump Activity
return
label Activity:
jump expression Activity_1
jump expression Activity_2
jump expression Activity_3
return
label ActivityError:
"Error: no activity set"
return
Is the problem that you can't nest returns the way I'm trying to?
-
AxemRed
- Veteran
- Posts: 482
- Joined: Sun Jan 09, 2011 7:10 am
-
Contact:
#2
Post
by AxemRed » Thu Mar 13, 2014 3:49 am
jump != call
-
Georgine
- Regular
- Posts: 55
- Joined: Fri Jan 24, 2014 7:47 am
-
Contact:
#3
Post
by Georgine » Thu Mar 13, 2014 3:53 am
And just like that the problem is fixed, and you are quite awesome- thank you!
Users browsing this forum: Google [Bot]