Implementing 'Boss Key' type functionality...

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
Flakmunky
Newbie
Posts: 6
Joined: Sun Oct 23, 2016 10:07 am
Contact:

Implementing 'Boss Key' type functionality...

#1 Post by Flakmunky » Sun Oct 23, 2016 10:13 am

Hi,

I'm very new to Ren'Py and want to be able to implement 'boss key' type functionality. Basically, I want the player to be able to hit a key (preferably the space bar) at any time during the novel which takes them to a new branch of the story... Is this possible? If not, is it possible to have a button on every page that does the same?

Thanks in advance,

Flak the Confused

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Implementing 'Boss Key' type functionality...

#2 Post by Ocelot » Sun Oct 23, 2016 1:36 pm

Create a screen with a Key: https://www.renpy.org/doc/html/screens.html#key
And then either use show screen at the beginning of your game: https://www.renpy.org/doc/html/screens.html#show-screen
or add it to config.overlay_screens: https://www.renpy.org/doc/html/config.htm
< < insert Rick Cook quote here > >

Flakmunky
Newbie
Posts: 6
Joined: Sun Oct 23, 2016 10:07 am
Contact:

Re: Implementing 'Boss Key' type functionality...

#3 Post by Flakmunky » Tue Oct 25, 2016 2:15 am

Thanks, Ocelot, that was a great help. I've got this working now...

I had only been through the getting started tutorials, so didn't understand the concept of screens fully... I still don't, but I'm getting there!

Next problem... Sliders to set variables! I'll post in another thread if I need help!

For info, this is what I came up with:

Code: Select all

Screen boss:
    key "b" action Jump('presskey')

label start:
    show screen boss

    "Game goes here as normal."

    Return

label presskey:
    "Boss!"

Post Reply

Who is online

Users browsing this forum: No registered users