Why isn't my scene working?

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
amaturemanga
Regular
Posts: 94
Joined: Sun Mar 08, 2015 6:55 pm
Deviantart: amaturemanga
Skype: amature.manga
Contact:

Why isn't my scene working?

#1 Post by amaturemanga » Mon Jul 06, 2015 6:59 pm

Hey everyone i'm trying to add this scene but everytime i launch the game it plays through the game no problem but then once it gets to the last scene it skips it and just goes back to the main menu, i've tried show, and scene same exact thing. I'm not even getting any errors so i don't understand what's going on. Here is my code:

Code: Select all

# You can place the script of your game in this file.
init:
    $ g = Character("???", show_two_window=True)
# Declare images below this line, using the image statement.
image mainmenu = "hypnotic_student.png"
image ctc_animation = Animation("ctcarrow01.png", 0.2, "ctcarrow02.png", 0.2, xalign=0.9, yalign=0.9)
image ctc_animation2 = Animation("ctcarrow03.png", 0.2, "ctcarrow04.png", 0.2, xalign=0.9, yalign=0.9)
image ccbackground = "cc_background.png"
image firstscene = "hallway.jpg"
image secondscene = "path.jpg"
image thirdscene = "slapbackground.jpg"

# Declare characters used by this game.
define story = Character(None, kind = nvl, ctc = None)
define g = Character("???", show_two_window=True, ctc="ctc_animation2", ctc_position="nestled")
define player = Character("[playername]",)

# The game starts here.
label splashscreen:
    scene black 
    $ renpy.pause(1)
    
    show text "The following story is a work of fiction and contain fantasy situations and does not reflect hypnosis in real life" with dissolve
    $ renpy.pause(2)
    
    hide text with dissolve
    $renpy.pause(1)
    
    $ renpy.pause(1)
    
    show text "AmatureManga Productions Presents\na story by: AmatureManga   and   Art by: SilverKazeNinja" with dissolve ## fix
    $ renpy.pause(2)
    play music "Metaphysik.mp3"
    hide text with dissolve
    $renpy.pause(2)
    return ## fix
    
label start:
    stop music
    play music "Necropolis.mp3"
    with dissolve
    scene ccbackground
    call screen character_customization_screen
    $ story = Character(None, ctc="ctc_animation", ctc_position="fixed", kind=nvl)
    with dissolve
    
    window show dissolve
    $ playername = renpy.input("Please enter your character's name below.")
    $ playername = playername.strip()
    window hide dissolve  
    stop music
    
$renpy.pause(1)    
show firstscene with dissolve
play music "Fallen Angels.mp3"
story "I am walking down a dark corridor. It is a corridor I am intimately familiar with."
story "This is a dream I have almost every night."
story "I can feel the darkness. A cold chill runs up my spine; hair standing on end, skin engulfed in goosebumps."
story "I know what lies ahead. I have seen it more times than I dare to remember."
story "Every fiber in my being is screaming for me to stop, to turn back and flee."
story "But I know..."
story "I know I cannot because this is a dream."
story "So, I have to press forward, anticipation building within me as I reach that oh so familiar corner..."
nvl clear 
window hide fade

show secondscene with dissolve 
story "I turn the corner and find myself in a familiar dark abandoned room."
story "I walk onto to the familiar stone colored carpet."  
story "I feel nausea as i see the familiar blood stains on the carpet."
story "But it doesn't end there, i can feel the familiar wooziness as i see the blood stains on the wall."
story "I can even see the blood oozing into every crack of the wooden walls."
story "But i know what i must do, as i have seen this dream many times before in the past."
story "I look over to the two badly painted doors in the center of the room."
nvl clear
window hide fade(2)

story "I read the familiar signs on each of the doors one says Hero, the other says Villain."
story "Even though i've never been past either of these doors."
story "I know, even without even knowing how. Something bad lies beyond those doors."
story "However, something amazing lies beyond those doors as well."
story "But i can only go through one door, so i gulp and make my decision."
story "Hestantly i slowly make my way over to the door i have chosen, and just before i turn the knob..."
stop music
nvl clear
window hide fade

$renpy.pause(1)
g "WAKE UP YOU STUPID IDIOT!!" 

scene wake up 
show thirdscene
play music "SLAP.mp3"

return
    

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
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: Why isn't my scene working?

#2 Post by Donmai » Mon Jul 06, 2015 8:24 pm

Try adding a pause with no arguments to the end of your script

Code: Select all

scene wake up 
show thirdscene
play music "SLAP.mp3"
$ renpy.pause()

return
to make Ren'Py display the scene, play the music and wait for a user action before returning to the Main Menu.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
amaturemanga
Regular
Posts: 94
Joined: Sun Mar 08, 2015 6:55 pm
Deviantart: amaturemanga
Skype: amature.manga
Contact:

Re: Why isn't my scene working?

#3 Post by amaturemanga » Mon Jul 06, 2015 8:35 pm

Donmai wrote:Try adding a pause with no arguments to the end of your script

Code: Select all

scene wake up 
show thirdscene
play music "SLAP.mp3"
$ renpy.pause()

return
to make Ren'Py display the scene, play the music and wait for a user action before returning to the Main Menu.
Ok that worked but now the music plays on an infinite loop until the user action returns it to the main menu, how can i set it up so it only plays the music once.

User avatar
78909087
Veteran
Posts: 277
Joined: Sat Aug 16, 2014 2:33 pm
Completed: Dungeons and Don't Do It, Wake Up
Projects: Lethe
IRC Nick: Pacermist
Contact:

Re: Why isn't my scene working?

#4 Post by 78909087 » Mon Jul 06, 2015 9:23 pm

To play it once, add it as a sound, rather than a music.
play sound "SLAP.mp3"
I am not friends with the sun.
Image

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
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: Why isn't my scene working?

#5 Post by Donmai » Tue Jul 07, 2015 9:35 am

amaturemanga wrote:Ok that worked but now the music plays on an infinite loop until the user action returns it to the main menu, how can i set it up so it only plays the music once.
Change the line to

Code: Select all

play music "SLAP.mp3" noloop
That's the simple way to prevent a song from looping.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]