Side story menu code

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Side story menu code

#1 Post by isobellesophia »

Hi! This is my first time on sharing my code.
Btw sorry for bad english.

I have a screen called Character Sub stories.
This is where you see their own stories. (And it cannot be seen in the main game.)

Well, since i cannot share ONE code but i got this from gas which this helped me.
Along with image gallery, achivements, musics, and etc.

viewtopic.php?t=50040
There is a download content below.

Once you opened the code or downloaded, you need to find the scene gallery, (sorry i couldnt share it in original.)

If you seen it, as you can see it is written with replay action.
Instead, you can change it into a persistent data.

Here is my code.

Code: Select all

### SCENE GALLERY! ##########################################
screen scenegallery():
    tag menu
    use exgame_menu(scroll="viewport"):
        grid 1 12:
            style_prefix "gslot"
            xalign 0.5
            yalign 0.5
            spacing gui.slot_spacing
            ## scene 1
            if persistent.flowersbloom:
                textbutton "Flowers do bloom" action Jump("flowersbloom")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.energy:
                textbutton "A hypered energy" action Jump("energy")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.yellow:
                textbutton "Yellow like a sun" action Jump("yellow")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.animalistic:
                textbutton "Ani-malistic" action Jump("animalistic")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.parttime:
                textbutton "Part-time" action Jump("parttime")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.eyes:
                textbutton "Different eyes, different vision" action Jump("eyes")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.principal:
                textbutton "Life of a principal" action Jump("principal")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.garden:
                textbutton "The Garden" action Jump("garden")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.routine:
                textbutton "Daily Routine" action Jump("routine")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.traveller:
                textbutton "Time-Traveller" action Jump("traveller")
            else:
                text "The sub story is not unlocked yet."
                
            if persistent.unknown:
                textbutton "Roses are red, Violets are blue, You didn't see it yet, So do i." action Jump("unknown")
            else:
                text "The sub story is not unlocked yet."
            null
You can just copy this and change the name of the story or the label name.
Dont worry, there is no error unless you'll add something that doesn't supposed to be added.

And add this one.

Code: Select all

textbutton _("Untold Stories") action ShowMenu("scenegallery")
The scenegallery its just a screen, just dont change its name or else some error will appear.
You can change the textbutton name if you want to. (I know i made this on my own without any errors.)



So in the script.rpy

For example,

Code: Select all

label ending1:
    g "This is a test on unlocking the sub story."
    
    $ persistent.flowersbloom = True   #《----- This is the unlocked sub story.
This will unlock the sub story. You need to add a label for it.

Code: Select all

label flowersbloom:
    if persistent.flowersbloom:
        g "Now you jumped in the sub story label on unlocking!!"
        
        return
Since it looked like a replay scene. You can add a image on it. (You cannot save or load.)
So.. i think thats all i can share now. With sub story looks more cool because with the main story of the characters.



Hope i helped!!! :wink: :shock:
Last edited by isobellesophia on Mon Jan 20, 2020 11:49 am, edited 1 time in total.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Side Story or Sub story are unlocked when ONE or TWO MORE endings are completed.

#2 Post by isobellesophia »

Update:

Whoever may used this code, change the Jump() into Replay() instead.

And for every end of the scene, type this one.

Code: Select all

$ renpy.end_replay()
Reference here.

viewtopic.php?f=8&t=57738
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: No registered users