About The "NEXT" Button

Greetings!

I want to change the name of the Next button.
How can I do this?

*Page_break This is the text that appears on the button

(after “*Page_Break”)

So for example:

*Page_Break Go

Would make the button say “Go”

2 Likes

Thank you.
So there is no other way to change this button?

Do I have to put a Page_break after every choice?
Because I use *finish to end every choices.

You can edit *finish in the same way as *page_break.

Type *finish Onto the next part of the story.
The button will say “Onto the next part of the story”.

@andymwhy Your right. But there is a problem.
My choice structure goes like this:

*choice
__#Choice 1
____Blah blah blah blah
____*choice
______#Choice 3
________Blah blah
________*finish Go
______#Choice 4
________Blah blah blah
________*finish Go
__#Choice 2
____Blah blah blah
____*finish Go

So, if I choose choice 1, and then Choice 3, the page between choice 1 and choice 3 ends with a “NEXT” button. But, at the end of choice 3, 4 and 2, the page ends with “GO”. I want all pages to end with something different than Next. I mean, I want all pages ends with “Turn The Page”

Any ideas?

It’s proving difficult to get the indentation right, because of how you’ve indented choices, you tend to end up ‘finishing’ a top level choice, before executing the ones further down.

You could just set your choices below labels, it might be less convenient but it’d work at least.

Scratch that, either I’m missing the obvious or this isn’t all that doable, not every single button, anyway. Unless you edit the Javascript interpreter, it is 12AM so I’m probably just overlooking something.

-> It seems to be impossible (through choicescript) to change the actual ‘next’ button on the choice screen, that will always be ‘next’ - you can only change it on non-choice pages.

You can do it but you need to edit scene.js in the folder above ‘mygame’
Scroll down to line 504 in that file and you’ll see:

if (!buttonName) buttonName = “Next Chapter”;

Change the bit inside the quotes to Turn the Page

Replacing ‘Next’ is a bit more complicated, but it’s all in the scene.js file, although there’s other references to it elsewhere so doing this could cause bugs, entirely up to you, but that’s how you’d probably have to go about it.

1 Like

Thank you CJW.

I’ve dug in, and found it’s the ui.js which need to be modified for changing the “Next” buttons.

Search for ’ printButton(“Next”, ', and change it as you wish. For my game, I only needed to change 2 places (in lines 926 and 2226 in commit 30b07ef999238e664ba9ed6585104e10d06f20f2, May 31). I didn’t test the others.

I defined a variable for the name at the top of the file, so I’ll only need to replace at one place, should I change my mind.

1 Like

A whole lot easier to just make them all one variable:

*create page_break_text "Whatever"
foo
*page_break ${page_break_text}

Still only one place to replace everything.

@RETowers It works most of the time, however, as the OP has mentioned,

there are times when it won’t. CJW wrote about it:

then

What I found was the location of these labels, as I posted above, in the ui.js file. I thought it might be helpful. But by creating a variable I meant, quite ambiguously, creating a JavaScript variable in the .js file, then changing it like this:

var nextButton = "Your button text goes here";
...
      if (!hideNextButton) printButton(nextButton, main, false, function() {
...
 printButton(nextButton, form, true);

I know that it’s not the most elegant solution, but it will work even when others won’t. You might need to change different instances of “Next” in different games.