Adding Titlescreen Music

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
Muffle
Newbie
Posts: 10
Joined: Mon Jan 01, 2018 7:39 pm
Skype: hyliakitty
Contact:

Adding Titlescreen Music

#1 Post by Muffle »

Umm, hi. I'm new and this is probably very easy, but I need help nonetheless. I looked up on a couple other threads about this but I couldn't really understand it. What they were telling those people who were having issues to do and what fixed it aren't working for me. I don't know if my coding is different, I don't know if I did something wrong. I have made an entire game, and I am updating the titlescreen, music and fonts. Here is the code below which has been used in my game:

Code: Select all

## This file contains options that can be changed to customize your game.
##
## Lines beginning with two '#' marks are comments, and you shouldn't uncomment
## them. Lines beginning with a single '#' mark are commented-out code, and you
## may want to uncomment them when appropriate.


## Basics ######################################################################

## A human-readable name of the game. This is used to set the default window
## title, and shows up in the interface and error reports.
##
## The _() surrounding the string marks it as eligible for translation.

define config.name = _("Under the Bed")


## Determines if the title given above is shown on the main menu screen. Set
## this to False to hide the title.

define gui.show_name = True


## The version of the game.

define config.version = "1.0"


## Text that is placed on the game's about screen. To insert a blank line
## between paragraphs, write \n\n.

define gui.about = _("")


## A short name for the game used for executables and directories in the built
## distribution. This must be ASCII-only, and must not contain spaces, colons,
## or semicolons.

define build.name = "UndertheBed"


## Sounds and music ############################################################

## These three variables control which mixers are shown to the player by
## default. Setting one of these to False will hide the appropriate mixer.

define config.has_sound = True
define config.has_music = True
define config.has_voice = True


## To allow the user to play a test sound on the sound or voice channel,
## uncomment a line below and use it to set a sample sound to play.

# define config.sample_sound = "sample-sound.ogg"
# define config.sample_voice = "sample-voice.ogg"


## Uncomment the following line to set an audio file that will be played while
## the player is at the main menu. This file will continue playing into the
## game, until it is stopped or another file is played.

    config.main_menu_music = "Anguish.ogg"

## Transitions #################################################################
##
## These variables set transitions that are used when certain events occur.
## Each variable should be set to a transition, or None to indicate that no
## transition should be used.

## Entering or exiting the game menu.

define config.enter_transition = dissolve
define config.exit_transition = dissolve


## Between screens of the game menu.

define config.intra_transition = dissolve


## A transition that is used after a game has been loaded.

define config.after_load_transition = None


## Used when entering the main menu after the game has ended.

define config.end_game_transition = None


## A variable to set the transition used when the game starts does not exist.
## Instead, use a with statement after showing the initial scene.


## Window management ###########################################################
##
## This controls when the dialogue window is displayed. If "show", it is always
## displayed. If "hide", it is only displayed when dialogue is present. If
## "auto", the window is hidden before scene statements and shown again once
## dialogue is displayed.
##
## After the game has started, this can be changed with the "window show",
## "window hide", and "window auto" statements.

define config.window = "auto"


## Transitions used to show and hide the dialogue window

define config.window_show_transition = Dissolve(.2)
define config.window_hide_transition = Dissolve(.2)


## Preference defaults #########################################################

## Controls the default text speed. The default, 0, is infinite, while any other
## number is the number of characters per second to type out.

default preferences.text_cps = 0


## The default auto-forward delay. Larger numbers lead to longer waits, with 0
## to 30 being the valid range.

default preferences.afm_time = 15


## Save directory ##############################################################
##
## Controls the platform-specific place Ren'Py will place the save files for
## this game. The save files will be placed in:
##
## Windows: %APPDATA\RenPy\<config.save_directory>
##
## Macintosh: $HOME/Library/RenPy/<config.save_directory>
##
## Linux: $HOME/.renpy/<config.save_directory>
##
## This generally should not be changed, and if it is, should always be a
## literal string, not an expression.

define config.save_directory = "UndertheBed-1513354195"


## Icon ########################################################################
##
## The icon displayed on the taskbar or dock.

define config.window_icon = "gui/window_icon.png"


## Build configuration #########################################################
##
## This section controls how Ren'Py turns your project into distribution files.

init python:

    ## The following functions take file patterns. File patterns are case-
    ## insensitive, and matched against the path relative to the base directory,
    ## with and without a leading /. If multiple patterns match, the first is
    ## used.
    ##
    ## In a pattern:
    ##
    ## / is the directory separator.
    ##
    ## * matches all characters, except the directory separator.
    ##
    ## ** matches all characters, including the directory separator.
    ##
    ## For example, "*.txt" matches txt files in the base directory, "game/
    ## **.ogg" matches ogg files in the game directory or any of its
    ## subdirectories, and "**.psd" matches psd files anywhere in the project.

    ## Classify files as None to exclude them from the built distributions.

    build.classify('**~', None)
    build.classify('**.bak', None)
    build.classify('**/.**', None)
    build.classify('**/#**', None)
    build.classify('**/thumbs.db', None)

    ## To archive files, classify them as 'archive'.

    # build.classify('game/**.png', 'archive')
    # build.classify('game/**.jpg', 'archive')

    ## Files matching documentation patterns are duplicated in a mac app build,
    ## so they appear in both the app and the zip file.

    build.documentation('*.html')
    build.documentation('*.txt')

## Set this to a string containing your Apple Developer ID Application to enable
## codesigning on the Mac. Be sure to change it to your own Apple-issued ID.

# define build.mac_identity = "Developer ID Application: Guy Shy (XHTE5H7Z42)"


## A Google Play license key is required to download expansion files and perform
## in-app purchases. It can be found on the "Services & APIs" page of the Google
## Play developer console.

# define build.google_play_key = "..."


## The username and project name associated with an itch.io project, separated
## by a slash.

# define build.itch_project = "renpytom/test-project"
Below is what I am trying to edit, as was told in other threads.

Code: Select all

## Uncomment the following line to set an audio file that will be played while
## the player is at the main menu. This file will continue playing into the
## game, until it is stopped or another file is played.

    config.main_menu_music = "Anguish.ogg"
Yes, the music is in the game folder and the file type is correct (.ogg). There is no indention, it is a single tab, and there is no # so it is not a comment. I have been able to figure pretty much everything else out, but I can no understand what I am doing wrong here. I get an error when trying to launch that says:
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/options.rpy", line 63: Line is indented, but the preceding define statement statement does not expect a block. Please check this line's indentation.
config.main_menu_music = "Anguish.ogg"
^

Ren'Py Version: Ren'Py 6.99.13.2919
I appreciate the help I will be receiving, and um.. I have trouble understanding a lot of things, so I am really sorry if you tell me to do something and I don't understand.

User avatar
Empish
Veteran
Posts: 221
Joined: Thu Jan 14, 2016 9:52 pm
Projects: Efemural Hearts, It Ends With Graduation
itch: empish
Contact:

Re: Adding Titlescreen Music

#2 Post by Empish »

Try unindenting the config.main_menu_music line until it's at the very left of the file. That seems to be what it's upset about.

Muffle
Newbie
Posts: 10
Joined: Mon Jan 01, 2018 7:39 pm
Skype: hyliakitty
Contact:

Re: Adding Titlescreen Music

#3 Post by Muffle »

Hi! Thanks for the quick reply. I've tried this a couple times and tried once again, there's an error still but it's different. Hopefully it can help lead to the problem that it's upset about. ^^
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/options.rpy", line 63: expected statement.
config.main_menu_music = "Anguish.ogg"
^

Ren'Py Version: Ren'Py 6.99.13.2919
Edit: it's not showing it, and this might be important, the ^ part of that line is pointing the the "=" part of that statement. Not sure if that means anything.

User avatar
Aoi14
Newbie
Posts: 23
Joined: Sun Dec 24, 2017 3:24 pm
Projects: GuardianS X
Location: Somewhere over the Rainbow
Contact:

Re: Adding Titlescreen Music

#4 Post by Aoi14 »

Hi! I can't exactly figure out the problem with your script- try pasting this code over the corresponding part in options.rpy, and it'll hopefully remove any faulty indentation.

Code: Select all

## Uncomment the following line to set an audio file that will be played while
## the player is at the main menu. This file will continue playing into the
## game, until it is stopped or another file is played.

define config.main_menu_music = "Anguish.ogg"
Working on VNs. As usual :P

User avatar
Empish
Veteran
Posts: 221
Joined: Thu Jan 14, 2016 9:52 pm
Projects: Efemural Hearts, It Ends With Graduation
itch: empish
Contact:

Re: Adding Titlescreen Music

#5 Post by Empish »

Oh. Try putting the word "define" in front of it. Looks like that got deleted somehow.

Muffle
Newbie
Posts: 10
Joined: Mon Jan 01, 2018 7:39 pm
Skype: hyliakitty
Contact:

Re: Adding Titlescreen Music

#6 Post by Muffle »

Oh! It worked! I had put define in there before but I probably forgot to try putting it without a tabbed space (or whatever it's called) Thank you for your time, Empish! You just helped me a lot ^_^

Post Reply

Who is online

Users browsing this forum: Ocelot