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.

[Resolved] Random sound plays when/while/after title screen pops up

This is for VX.
I would like someone to create a script where:

A random SE plays during the title screen scene

And/or

A random se plays when you choose an option from the title screen menu.

What I mean is in the script itself, you have an array of SE that play randomly when the above conditions are met.

Thank you.
 
Code:
#==============================================================================
# ** VX Title Screen Sound Effects
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1.0
# 2008-09-19
#==============================================================================

module Sound
  Title_Screen_SE = {}
  Title_Screen_SE[Vocab::new_game] = [
    # [filename, volume, pitch]
  ]
  Title_Screen_SE[Vocab::continue] = [
    # [filename, volume, pitch]
  ]
  Title_Screen_SE[Vocab::shutdown] = [
    # [filename, volume, pitch]
  ]
  def self.play_title_scene_se(command)
    array = Title_Screen_SE[command]
    item = array[rand(array.size)]
    Audio.se_play(*item) 
  end
end

class Scene_Title
  alias_method :seph_scnttlse_scnttl_ccw, :create_command_window
  alias_method :seph_scnttlse_scnttl_update, :update
  def create_command_window
    seph_scnttlse_scnttl_ccw
    @last_index = @command_window.index
  end
  def update
    seph_scnttlse_scnttl_update
    if @last_index != @command_window.index
      @last_index = @command_window.index
      c = @command_window.commands[@command_window.index]
      Audio.play_title_scene_se(c)
    end
  end
end


Just insert in materials section. Just modify these arrays:
Code:
  Title_Screen_SE[Vocab::new_game] = [
    # [filename, volume, pitch]
  ]

Say you want to add the following sound effects to the new_game
~ Filename: 'New-Game1' Volume: 100, Pitch: 80
~ Filename: 'New-Game2' Volume: 80, Pitch: 90
~ Filename: 'New-Game3' Volume: 70, Pitch: 100

Your setup would look like:
Code:
  Title_Screen_SE[Vocab::new_game] = [
    ['New-Game1', 100, 80],
    ['New-Game2', 80, 90],
    ['New-Game3', 70, 100]
  ]
 

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