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.
KHTRE
Newbie
Posts: 3 Joined: Fri Dec 08, 2017 12:18 pm
Contact:
#1
Post
by KHTRE » Fri Dec 08, 2017 12:28 pm
Let's say, I have huge amount of labels (label ab, label ac, label ad etc.), sort of matrix.
I want person to enter "coordinates" and jump to specefic label.
Somethig like:
Code: Select all
$ coord_x = "a"
$ coord_y = "b"
jump [coord_x][coord_y]
label ab:
"ab"
label ac:
"ac"
label ad:
"ad"
But Renpy doesn't want to work like this. Is there some way to do it?
I have found a solution!
Code: Select all
$ coord_x = "a"
$ coord_y = "b"
$ coord_sum = coord_x+coord_y
jump expression coord_sum
label ab:
"ab"
Last edited by
KHTRE on Sat Dec 09, 2017 9:45 am, edited 3 times in total.
mitoky
Veteran
Posts: 316 Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:
#2
Post
by mitoky » Fri Dec 08, 2017 12:51 pm
Maybe something like:
Code: Select all
if coord_xa and coord_yb:
jump label ab
would work too?
Sorry if its not what you are looking for ><
Otherwise maybe someone more experienced maybe has a solution.
KHTRE
Newbie
Posts: 3 Joined: Fri Dec 08, 2017 12:18 pm
Contact:
#3
Post
by KHTRE » Fri Dec 08, 2017 1:12 pm
No, that won't help me. I will have to check every label. So this construction will be huge.
KHTRE
Newbie
Posts: 3 Joined: Fri Dec 08, 2017 12:18 pm
Contact:
#4
Post
by KHTRE » Fri Dec 08, 2017 3:58 pm
I have found a solution!
Scribbles
Miko-Class Veteran
Posts: 636 Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:
#5
Post
by Scribbles » Fri Dec 08, 2017 4:08 pm
you could try:
Code: Select all
jump expression str(coord_x) + str(coord_y)
though I see you said you found a solution, but just in case
Users browsing this forum: Google [Bot] , Majestic-12 [Bot]