Customization of the Next Button

What I would like to ideally have whenever there was a page-break, would be variable controlled text instead of simple block text … does anyone know if this is possible?

Currently (according to the wiki) I can customize the text in a Next button but not have variable text in its place.

So currently:

Example
*page_break [i] this text can be italized or bolded [/i]
 ...

Ideally, I would like:

Example
*page_break
    *if (superhero)
        The Justice Leage is calling out for your help!
    *elseif (villain)
        Joker's Assylum is reaching out to you for neferious planning.
    *else
        The Police Commissioner is pleading with you to stay off the streets.

My goal here is to keep the reader engaged with my story by being an active choice maker instead of a passive passenger floating from one page to the next…

Anyone have know-how that can help me?

4 Likes

This should do the trick.

*temp next_button ""
*if (superhero)
      *set next_button "The Justice Leage is calling out for your help!"
*elseif (villain)
      *set next_button "Joker's Assylum is reaching out to you for neferious planning."
*else
      *set next_button "The Police Commissioner is pleading with you to stay off the streets."

*page_break ${next_button}
1 Like

Sincerely I don’t understand what do you want. Do you want to make the text of the page_ game variAble in the base of choices?
Edited I am blunter
*if x
*page_break text

1 Like

I can only think of this:

*if (superhero)
    *page_break The Justice Leage is calling out for your help!
*elseif (villain)
    *page_break Joker's Assylum is reaching out to you for neferious planning.
*else
    *page_break The Police Commissioner is pleading with you to stay off the streets.
6 Likes

Does each page go a different place in the same scene or a different scene?

    *if (superhero)
        *page_break The Justice League is calling out for your help!
    *elseif (villain)
        *page_break Joker's Asylum is reaching out to you for neferious planning.
    *else
        *page_break The Police Commissioner is pleading with you to stay off the streets.

Ignore the extra tabs. On my phone and doing the code is a pain so just copied your text mostly and added the *page_break bits.

1 Like

@Kotosinica – thank you. I was down a rabbit hole and not seeing the solutions available. This should work for the majority of page-breaks I script.

@poison_mara and @cup_half_empty – thank you for your posts…

@Nocturnal_Stillness – Ideally both, but for now, only the former. I’m still a sub-par scripter who gets lost easily.

Edit: All of you gave me solutions… thank you.

1 Like

Just found out you can actually use variables for labels now.

Just tried the code below and it worked.

*title template for code
*author Sam Kabell
*comment your code goes here
*create superhero false
*create villain false
*create text "Hello"
*label test_scene
Hello?
*fake_choice
  #"Hello."
    *set text "Hello"
  #"Hola."
    *set text "Hola"
  #"Hello there."
    *set text "Hello there"
Could you repeat that?
*page_break ${text}
Hello
*finish
5 Likes

FYI, for manual italic tag on print, try ${"[i]" & var}

1 Like

Alternatively, you can also use multireplace. Sometimes I use a number variable alongside a boolean solely for the ease of multireplace.

If you need to do this a lot, I’d suggest:

*if (superhero)
	*set var 1
*elseif (villain)
	*set var 2
*else
	*set var 3

*page_break @{var I am a superhero.| I am a villain.|I am neither a superhero or a villain.}

And then you still have superhero and villain as booleans. You just need to remember the order.

3 Likes

Don’t forget the closing tag. This might work in most cases, but you run the risk of italics extending past the expected point if you don’t explicity close it.

1 Like

To close the tag, it’d be ${( "[i]" & var ) & "[/i]"}. I didn’t really bothered before, but now I know that the logic inside the brackets is practically the same as for the *if command.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.