[Solved] Ending credits skipable after seen once

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
User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

[Solved] Ending credits skipable after seen once

#1 Post by kostek00 »

I made ending credits that are shown after game has been beated. I don't want to force users to watch them everytime they beat game but I want them to see them once. After that I want to allow users to skip them.

Code: Select all

if ???:
    $ renpy.pause(delay=60, hard=False)
else:
    $ renpy.pause(delay=60, hard=True)
I just don't know what can I use in place "???" to achieve this.

I found in documentation renpy.is_seen and renpy.seen_label but didn't found examples how to use them.

Does this would work as I would like?

Code: Select all

if renpy.is_seen(ever=True):
    $ renpy.pause(delay=60, hard=False)
else:
    $ renpy.pause(delay=60, hard=True)

label ending:
scene black with None
show credits
play music "bgm/M08.ogg" fadein 1.0
$ renpy.pause(delay=60, hard=True)
stop music fadeout 1.0
pause 1.0
I'm also using label to show ending credits but I'm thinking about jumping/calling screen here that will show ending credits. The reason for that is to remove any shortcuts while ending credits are shown.
Last edited by kostek00 on Sun Jun 03, 2018 1:26 pm, edited 1 time in total.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Ending credits skipable after seen once

#2 Post by Donmai »

Personally, I believe credits should be always skippable. Forcing players to do things is the best way to make them look for a more friendly game to play. Anyway, that's your game and your audience :) . You will find some ideas in this thread (discussion on this topic start around post #13: viewtopic.php?f=51&t=22481
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Ending credits skipable after seen once

#3 Post by kivik »

Why not just use a persistent variable?

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Ending credits skipable after seen once

#4 Post by kostek00 »

I don't know how to use them.

@Donmai I also consider making them not skipable for only the 1-2 seconds just to be sure that they aren't accidently skipped and after that allow.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Ending credits skipable after seen once

#5 Post by Imperf3kt »

As an example, you could do it like this:

Code: Select all

default persistent.creds_seen = "False"
label start:
    "this game is really short."
    call my_credits
    return

label my_credits:
    scene black with None
    show credits
    play music "bgm/M08.ogg" fadein 1.0
    if persistent.creds_seen:
        $ renpy.pause(delay=3, hard=True)
        $ renpy.pause(delay=57, hard=False)
    else:
        $ renpy.pause(delay=60, hard=True)

    stop music fadeout 1.0
    pause 1.0
    return

Personally, I would not do this, I'd make the hard pause more like 15 seconds at the most.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ending credits skipable after seen once

#6 Post by Remix »

Imperf3kt wrote: Fri Jun 01, 2018 5:29 pm As an example, you could do it like this:
... adjustments

Code: Select all

default persistent.creds_seen = False # boolean not string
label start:
    "this game is really short."
    call my_credits
    return

label my_credits:
    scene black with None
    show credits
    play music "bgm/M08.ogg" fadein 1.0
    
    # 5 secs hard pause on first viewing
    $ renpy.pause(delay=5, hard=not persistent.creds_seen)
    
    # remainder skippable even on first view
    $ renpy.pause(delay=55, hard=False)
    
    $ persistent.creds_seen = True # <-- set the persistent

    stop music fadeout 1.0
    pause 1.0
    return

Frameworks & Scriptlets:

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Ending credits skipable after seen once

#7 Post by Imperf3kt »

...
Thanks for fixing it up. I was half asleep when I wrote it out xD
I knew something wasn't right, but half-asleep me didn't see anything.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Ending credits skipable after seen once

#8 Post by kostek00 »

Thank you all for help.

If I'm not lying myself I think I'm starting to understand persistent variables. I readed in documentation they can be used for gallery unlocking. And if for gallery then for replays as well. I didn't tested when exacly replays are unlocked whether right after hitting replay label or replay end but based on what it says in documentation I assume it's right after hitting label and that's not correct because user shouldn't see replay is he didn't seen whole scene in that replay. It doesn't make sense. To make sure it's unlocking when it should changing this code:

Code: Select all

            imagebutton:
                insensitive "images/thumbnails/thumbnail_insensitive.png"
                idle "images/thumbnails/thumbnail01.png"
                idle_foreground Solid((0,0,0, 100))
                hover "images/thumbnails/thumbnail01.png"
                action Replay("replay1", locked=None)
                pos(220,170)
                
label replay1:
    #dialogs
    $ renpy.end_replay()
To this should do the trick, right?

Code: Select all

            imagebutton:
                insensitive "images/thumbnails/thumbnail_insensitive.png"
                idle "images/thumbnails/thumbnail01.png"
                idle_foreground Solid((0,0,0, 100))
                hover "images/thumbnails/thumbnail01.png"
                action Replay("replay1", locked=not persistent.replay1)
                pos(220,170)

label replay1:
    #dialogs
    $ renpy.end_replay()
    $ persistent.replay1
Or does "$ persistent.replay1" needs to be "$ persistent.replay1 = True"?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Ending credits skipable after seen once

#9 Post by Remix »

Not really dabbled with replays as yet, though for the variables, if you are assigning a value to the variable you always use " variable = value "
If you are conditionally testing them you *can* use " if variable: " for cases such as (True, non zero integers or floats, non empty list, dict or string)
Frameworks & Scriptlets:

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Ending credits skipable after seen once

#10 Post by kostek00 »

Code: Select all

            imagebutton:
                insensitive "images/thumbnails/thumbnail_insensitive.png"
                idle "images/thumbnails/thumbnail01.png"
                idle_foreground Solid((0,0,0, 100))
                hover "images/thumbnails/thumbnail01.png"
                action Replay("replay1", locked=not persistent.replay1)
                pos(220,170)

label replay1:
    #dialogs
    $ renpy.end_replay()
    $ persistent.replay1 = True
This worked as I wanted. Thanks for help.

Post Reply

Who is online

Users browsing this forum: Google [Bot]