Button that performs next action in a list? (for making tutorial 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
MarcusMcEgg
Newbie
Posts: 2
Joined: Tue Feb 06, 2018 2:12 am
Contact:

Button that performs next action in a list? (for making tutorial screen)

#1 Post by MarcusMcEgg »

Hello!
I apologize if there's something similar already explained somewhere, I've been googling things for 2-3 hours now but still can't seem to find anything. Which may be a result of what I'm searching (when I google the word "tutorial" alongside anything, even if it's "how to make tutorial screen" a million random results come up since the word 'tutorial' just shows every tutorial that exists, instead of how to make one ITSELF), but I've also tried searching what I'm looking for with many other terms, looked through that cookbook thing, etc.. I'm also extremely new at this to the point that I sometimes can't even understand the words people say in their tutorials, so I hope I didn't overlook something obvious by not fully comprehending it.. but, anyway...

DETAILS: Basically, at the beginning of the game, I want there to be some sort of short tutorial/informational bit that pops up, but I don't want to use the bottom text dialogue box thing to show that information. I'd like to instead have a custom box that comes up in the middle of the screen, with text (the tutorial text) shown in the middle, and a button down at the bottom that clicks to display the next line of the instructions.
(kind of like as shown here in a sloppy ms paint image --- https://imgur.com/a/4hjxaqR )

I think I could do this by just showing some plain colored image of a box for the background of it, make a button off to the side overlaid on top of it to click 'next', and then just have some tutorial text or something displayed over top all of that. (Maybe as a custom screen or something? I already have an HP bar display thing but that's more simple, so idk if this would work similarly. If there'd be a more efficient way, let me know)

MAIN QUESTION : Really my MAIN issue is just that I'm unsure how to go about using the button to show the next line of tutorial instruction??
(Like in the bottom dialogue box thing, all you have to do is click and it goes to the next line of what the character says, but how do you do a similar thing when NOT using the pre-established dialogue box?)

IS there a way to put lines of text in a list, display that text on the screen, and then when a button is pressed, it jumps to the next item in that list (thus displaying the next line of text)? And then somehow on the final press of the "next" button, it triggers the entire thing to close (hiding all the tutorial elements) and moves on with the game?

Like for example, if you could have a list that was just:
  • - something telling the game to display tutorial text line 1
    - then display tutorial text line 2
    - then display tutorial text line 3
    - lastly something telling the game to no longer show the tutorial box & etc.
And then implement a button where every time you press the one button, it basically just does "do the next action in the list", until all text lines have been displayed and the tutorial box is closed as the final action?

I wanted to avoid doing some weird thing like having every single line of text be it's own image and having a new button with a new function replace the old one in the same spot every time that displays the next image or using variables or whatever nonsense I would think of on my own because I don't have enough experience to know the best way to do things lol.. Maybe I'm just thinking about it the wrong way so, that's why I wanted to ask with other people.
I'm having trouble conceptualizing the most efficient way to do this, I don't want to over-complicate it or anything. Is there a simple method that allows you to do something like described above that I just don't know about?

Thank you so much to anyone who helps! I tried to provide enough information, but let me know if you need me to clarify anything!

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Button that performs next action in a list? (for making tutorial screen)

#2 Post by philat »

Code: Select all

screen tutorial_message(msg):
    vbox:
        text msg
        textbutton "Next" action Return()

label start:
    call screen tutorial_message("Message 1")
    call screen tutorial_message("Message 2")

MarcusMcEgg
Newbie
Posts: 2
Joined: Tue Feb 06, 2018 2:12 am
Contact:

Re: Button that performs next action in a list? (for making tutorial screen)

#3 Post by MarcusMcEgg »

(Sorry it took so long to make a response, I had to try everything out first to see if it'd work).. Thank you so much for the help! Since I'm a fool at this, it still took me good a while to figure where everything goes and position the button exactly where I wanted it and such, but the main function works perfectly for what I was looking to do! Hope you have a great day ~

Post Reply

Who is online

Users browsing this forum: Andredron