Is it possible to create a way for the label to skip seen parts of a label?
I'm doing a chat system and you can exit anytime you want and open it the same way.
My problem is that everytime I open the chat label it starts from the beginning. I'm thinking on adding some id's to each of the lines or something, but I'm not sure how to skip to that part.
Anyone has some ideas on how to do that?
Label starts in the middle
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.
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.
-
- Regular
- Posts: 56
- Joined: Tue Nov 13, 2018 6:00 am
- Contact:
- 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: Label starts in the middle
You could have a variable that starts of at 0. For each segment under the label you add + 1 to the variable. Each segment starts with an if segment.hapciupalit wrote: ↑Wed Feb 19, 2020 11:23 am Is it possible to create a way for the label to skip seen parts of a label?
I'm doing a chat system and you can exit anytime you want and open it the same way.
My problem is that everytime I open the chat label it starts from the beginning. I'm thinking on adding some id's to each of the lines or something, but I'm not sure how to skip to that part.
Anyone has some ideas on how to do that?
if var_Id<1:
[do segment 1]
$ var_Id +=1
if var_Id<2:
[do segment 2]
$ var_Id +=1
if var_Id<3:
[do segment 3]
$ var_Id +=1
Next time you go to the label it will not play segments that already has been done.
-
- Regular
- Posts: 56
- Joined: Tue Nov 13, 2018 6:00 am
- Contact:
Re: Label starts in the middle
Perfect. Thank you. I got one more question. Won't many ifs screw the performance? If for example I have a chat of 100 lines.Per K Grok wrote: ↑Wed Feb 19, 2020 1:25 pmYou could have a variable that starts of at 0. For each segment under the label you add + 1 to the variable. Each segment starts with an if segment.hapciupalit wrote: ↑Wed Feb 19, 2020 11:23 am Is it possible to create a way for the label to skip seen parts of a label?
I'm doing a chat system and you can exit anytime you want and open it the same way.
My problem is that everytime I open the chat label it starts from the beginning. I'm thinking on adding some id's to each of the lines or something, but I'm not sure how to skip to that part.
Anyone has some ideas on how to do that?
if var_Id<1:
[do segment 1]
$ var_Id +=1
if var_Id<2:
[do segment 2]
$ var_Id +=1
if var_Id<3:
[do segment 3]
$ var_Id +=1
Next time you go to the label it will not play segments that already has been done.
Re: Label starts in the middle
Also, you could try to do it like
Code: Select all
default lbl_name = None
label chat:
if lbl_name:
jump expression lbl_name # or $ renpy.jump(lbl_name)
chat chat chat
$ lbl_name = "chat_1"
label chat_1:
chat chat chat
$ lbl_name = "chat_2"
label chat_2:
chat chat chat
$ lbl_name = "chat_end"
label chat_end:
"...nothing to say anymore..."
- 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: Label starts in the middle
Writing those lines will probable be boring and tiring for you, but no problem for the computer to handle.hapciupalit wrote: ↑Wed Feb 19, 2020 3:17 pm ---
I got one more question. Won't many ifs screw the performance? If for example I have a chat of 100 lines.
-
- Regular
- Posts: 56
- Joined: Tue Nov 13, 2018 6:00 am
- Contact:
Re: Label starts in the middle
Thank you both. I'll see which is the simplest solution for me to write the text with.
Who is online
Users browsing this forum: Ahrefs [Bot]