Make game over play BGM instead of ME?

Status
Not open for further replies.

Luigi-like

That guy you know
Veteran
Joined
Aug 4, 2013
Messages
64
Reaction score
1
First Language
English
Primarily Uses
Is it possible to make the game over to play looping BGM instead of a ME? Is it possible with common events or do i need yet another script to add to my list?

Thanks to all future responses.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------


# * Play Music on Game Over Screen


#--------------------------------------------------------------------------


def play_gameover_music


RPG::BGM.stop


RPG::BGS.stop


bgm = RPG::BGM.new(name, volume, pitch)


bgm.play


end


end

where name is the name of your audio file in the Audio\BGM folder (without the extension), and volume and pitch are the desired settings. Both default to 100, so if you don't want to change them, just leave them both out and only use the name.
 
Last edited by a moderator:

Luigi-like

That guy you know
Veteran
Joined
Aug 4, 2013
Messages
64
Reaction score
1
First Language
English
Primarily Uses
class Scene_Gameover < Scene_Base #-------------------------------------------------------------------------- # * Play Music on Game Over Screen #-------------------------------------------------------------------------- def play_gameover_music RPG::BGM.stop RPG::BGS.stop bgm = RPG::BGM.new(name, volume, pitch) bgm.play endendwhere name is the name of your audio file in the Audio\BGM folder (without the extension), and volume and pitch are the desired settings. Both default to 100, so if you don't want to change them, just leave them both out and only use the name.
Bad news, The music i have has this character in it:' - ' So instead of searching for Theo-Jingle04 searches just the first part 'Theo' and comes up with an error

This is the error

Problrm 2 Pt 1.png

This is my script screen

Problem 2 pt 2.png

 highlited what i think is wrong with red 

I have the name right but i think it's the character: ' - ' that breaks it

Important Edit: I renamed the file and it pops up with this

Problem 2 pt 3.png

BTW i use a test project before i use it in my actual project (for these reasons)
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You have drawn a box around the really important bit in that script call so I can't see what I need to see.


The file name has to be enclosed in quotation marks.


So

Code:
bgm = RPG::BGM.new("Theo-Jingle04", 100, 50)
And make sure you use RPG::BGM.new instead of RPG::AudioFile.new (I changed that but you'd obviously already copied it)
 

Luigi-like

That guy you know
Veteran
Joined
Aug 4, 2013
Messages
64
Reaction score
1
First Language
English
Primarily Uses
You have drawn a box around the really important bit in that script call so I can't see what I need to see.

The file name has to be enclosed in quotation marks.

So

bgm = RPG::BGM.new("Theo-Jingle04", 100, 50)And make sure you use RPG::BGM.new instead of RPG::AudioFile.new (I changed that but you'd obviously already copied it)
IT WORKS, Thanks shaz! I'd say my problems here are done. :guffaw:   three thumbs up for you  :thumbsup-right:   :thumbsup-right:   :thumbsup-right:

Edit: Lock the topic please.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top