Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VX]Music in Script

Started by pacdiggity, April 13, 2011, 06:27:00 AM

0 Members and 1 Guest are viewing this topic.

pacdiggity

This isn't a request for a script, more of a request for knowledge on how to script.
As a lot of you know, I'm new to scripting, but I'd like to think I'm getting the hang of it. But there are always those things that get you when your guard is down, and this is one of them. How do I script a command to play music?
I've studied Scene_Title for the command, and it runs as
class Scene_Title < Scene_Base
  def play_title_music
    $data_system.title_bgm.play
    RPG::BGS.stop
    RPG::ME.stop
  end

So, if I run my custom scene's music processing as
CUSTOM_BGM = "Theme4", 100, 100 #Music, Pitch and Volume
class Scene_Custom < Scene_Base #The scene's class
def play_custom_music #The music method
CUSTOM_BGM.play #Play BMG
RPG::BGS.stop #No BGS
RPG::ME.stop #No ME
it doesn't work.
How do you properly call music in RGSS2?
it's like a metaphor or something i don't know

modern algebra

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

The Help file is your best friend.

You would then use the play method once to play it.

pacdiggity

Our friendship has been remade!
Thank you for pointing out something I clearly should've seen.
*Finishes script*
it's like a metaphor or something i don't know