Second splash screen? [Solved]

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
Lime-Kiwi
Newbie
Posts: 14
Joined: Fri Apr 12, 2013 10:09 pm
Completed: Acrimenthums, A Nutcracker Tale, Falling Star, The Pendant Guarden
Projects: TBD...
Organization: kipursuit
Deviantart: utemi
Github: ollie-jam
itch: kipursuit
Location: United States
Contact:

Second splash screen? [Solved]

#1 Post by Lime-Kiwi »

Is it possible to have a second splash screen image within the the game or would be better in my case?
I'm trying to add screens that say "Chapter # complete", but using images instead.
Last edited by Lime-Kiwi on Sun Apr 21, 2013 1:34 pm, edited 1 time in total.

User avatar
chewpower
Regular
Posts: 36
Joined: Mon Feb 11, 2013 11:08 pm
Contact:

Re: Second splash screen?

#2 Post by chewpower »

Lime-Kiwi wrote:I'm trying to add screens that say "Chapter # complete", but using images instead.
I don't know about splash screen but I'll show you my approach. I just read about keymap in this link and it says that you can modify list of keys that user can click in order to make something in Ren'Py works. For example: dismissing a Say statement.

Now the "Chapter# complete" can be done with images by declaring the image as bg and show them as scene.

Code: Select all

scene bg yourimage
with dissolve
And then we disable all say keymap in the list by these

Code: Select all

$ config.keymap['dismiss'].remove('mouseup_1')
$ config.keymap['dismiss'].remove('K_RETURN')
$ config.keymap['dismiss'].remove('K_SPACE')
$ config.keymap['dismiss'].remove('K_KP_ENTER')
$ config.keymap['dismiss'].remove('joy_dismiss')
(there should be easier way to putt all those 5 lines together but I still don't know how.)

We don't want to disable the keys forever, so we want to put them back the next 5 seconds or so. So here's what I do. I record the play time (in second) and then compute it all over again until it reach 5 seconds, all is done while the user can't type/mouse click the scene to advance further.

Code: Select all

    $ min_now, sec_now = divmod(int(renpy.get_game_runtime()), 60)
    $ flag = True
    while flag == True:
        $ min_ltr, sec_ltr = divmod(int(renpy.get_game_runtime()), 60)
        $ diff = sec_ltr - sec_now
        if diff >= 5:
            $ flag = False
The above code will compute how many seconds elapsed from when the bg show until current time, and unless the $ diff hit 5, we won't be able to get out from the while function. (note that I also count the minute as well, because I don't know how else to get the second without counting the minute... shame on me)

After that, we append the original keymap back.

Code: Select all

    $ config.keymap['dismiss'].append('mouseup_1')
    $ config.keymap['dismiss'].append('K_RETURN')
    $ config.keymap['dismiss'].append('K_SPACE')
    $ config.keymap['dismiss'].append('K_KP_ENTER')
    $ config.keymap['dismiss'].append('joy_dismiss')
User can click/move on to the next scene now...
I'm sorry if I'm too stupid, but I can't learn to walk on my own

User avatar
chewpower
Regular
Posts: 36
Joined: Mon Feb 11, 2013 11:08 pm
Contact:

Re: Second splash screen?

#3 Post by chewpower »

I'm really sorry. The only way for the above solution to work is if only there's a say statement inside the while function. Else, the game would freeze and "not responding". So here's a little fix

Code: Select all

    $ min_now, sec_now = divmod(int(renpy.get_game_runtime()), 60)
    $ flag = True
    while flag == True:
        "say something or anything here"
        $ min_ltr, sec_ltr = divmod(int(renpy.get_game_runtime()), 60)
        $ diff = sec_ltr - sec_now
        if diff >= 5:
            $ flag = False
I did have the say statement while testing this code before, but I didn't know if we exclude the say altogether it would mess up the program.
I'm sorry if I'm too stupid, but I can't learn to walk on my own

User avatar
Lime-Kiwi
Newbie
Posts: 14
Joined: Fri Apr 12, 2013 10:09 pm
Completed: Acrimenthums, A Nutcracker Tale, Falling Star, The Pendant Guarden
Projects: TBD...
Organization: kipursuit
Deviantart: utemi
Github: ollie-jam
itch: kipursuit
Location: United States
Contact:

Re: Second splash screen?

#4 Post by Lime-Kiwi »

I found another way that seemed a lot easier:

Code: Select all


    scene chpt1
    $ renpy.pause(5)
    with dissolve
    
    scene black
Thank you though!

User avatar
chewpower
Regular
Posts: 36
Joined: Mon Feb 11, 2013 11:08 pm
Contact:

Re: Second splash screen? [Solved]

#5 Post by chewpower »

Ah, I thought by splash screen you mean an image is shown without being able to be interrupted. So I went and overdid myself :D but yeah it actually is that simple
I'm sorry if I'm too stupid, but I can't learn to walk on my own

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: Second splash screen? [Solved]

#6 Post by pwisaguacate »

And if you wish, you may stop the user from clicking (other buttons will still work) during the image cutscene with a hard pause.

Code: Select all

    play music "transition.ogg" # optional sound effect
    scene chpt1 with fade
    $ renpy.pause(3, hard=True)

    scene bg uni with dissolve
    play music "illurock.ogg"

User avatar
chewpower
Regular
Posts: 36
Joined: Mon Feb 11, 2013 11:08 pm
Contact:

Re: Second splash screen? [Solved]

#7 Post by chewpower »

Oh My God it actually IS that simple lol now i feel like a total newb (which I already am) thank you pwisaguacate for sharing this information
I'm sorry if I'm too stupid, but I can't learn to walk on my own

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot]