RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX]Music in Script

0 Members and 1 Guest are viewing this topic.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
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
Code: [Select]
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
Code: [Select]
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Code: [Select]
RPG::BGM.new (name, volume, pitch)

The Help file is your best friend.

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

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
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