Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Change music in battle system?

TheOrc

Member

Yeah, I decided not to put this in the script request section, because I'm looking for help, not an entire script.

What I'm having trouble with, is editing the default battle system.
I'm looking forward to being able to doing something like this:

if Input.trigger?(Input::1)
Audio.bgm_play("Audio/BGM/065-Other01", 85, 100)
end
if Input.trigger?(Input::2)
Audio.bgm_play("Audio/BGM/066-Other02", 85, 100)
end

-Note that I'm planning on going from 1-0 on the keyboard, meaning 10 different songs.

That goes in Scene_Battle 1 where it says something like:
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Or something like that.

Only problem is, I get this error when I put in numbers on the (Input::) section.

Are numbers not allowed there?

That's not the only problem either; I'm not sure whether or not I need to put the "Music Changer" part under the "loop do".

Help would be appreciated.
 
Looks like you'll need a keyboard recognition script. The input commands work for game controls, A, B, C, L, R, X, Up, Down, Left, Right. It's like playing a nintendo game on your PC, in a small sense. Hope this helps.
 

TheOrc

Member

Gotcha, I'll search for one.
Edit: No luck; You sure that's what it's called?
Edit 2: I tried it with the keys you mentioned, and it worked flawlessly, just gotta get it to work with those numbers.
Edit 3: Woohoo. I got it to work with the Aleworks Keyboard Module.
But... uh... it kinda lags. Oh well, I've found my answer at least.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top