Separate Sounds for Menu Scene
#2
I have you one that might be a little more... fun.

Code:
          # Move cursor down

          # We branch on each type of 'Scene'
          case $scene
          when Scene_Menu ; $game_system.se_play($data_system.shop_se)
          when Scene_Equip ; $game_system.se_play($data_system.escape_se)
          else ; $game_system.se_play($data_system.cursor_se)
          end
         
          @index = (@index + @column_max) % @item_max
Here, I put use the CASE...END block

Each time it runs, it checks what type of $scene is running, ergo:  when (THIS) ; SE_play this  Laughing

But the last part of the case block is the 'else' ... in here basically saying "I got nothing else, do the default fx"

Do know that your option to change SFX based on the SCENE is interesting, but... 

You do get the same audio cues in both  windows within Scene_Equip, the window where you can see what you have equipped and can remove, and the window at the bottom where you can choose replacements.  So let's expand that, shall we????

First, add either:
Code:
class Scene_Equip
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :right_window             # Currently equipped gear window
end
or
Code:
class Scene_Equip
  #--------------------------------------------------------------------------
  # * Get the Right Window data
  #--------------------------------------------------------------------------
  def right_window
    @right_window
  end
end
I would prefer a separate outside script rather than direct inserts.  That way, you can find such changes with more ease. Direct edits to the default scripts are usually the last straw in the opinion of seasoned scripters.

The 'Right Window' instance variable in Scene_Equip is essentially the selectable display window of what you have equipped.  And  it is essentially NOT designed to give any information outside of Scene_Equip.  For that, you need to have SOME means to read this thing outside of the Scene_Equip class.

But with THAT out of the way (and inserted), consider THIS tidbit:
Code:
          # Move cursor down

          # We branch on each type of 'Scene'
          case $scene
         
            # If we branch on the main menu
            when Scene_Menu
              $game_system.se_play($data_system.shop_se)
             
            # If we branch on the Equip Menu
            when Scene_Equip
              # We decide if its the gear menu or not
              if $scene.right_window.active == true
                $game_system.se_play($data_system.escape_se)
              else
                $game_system.se_play($data_system.load_se)
              end
           
            # If we branch on any OTHER menu...
            else
            $game_system.se_play($data_system.cursor_se)
            #
          end
         
          @index = (@index + @column_max) % @item_max

I broke it down in a more plebian style to make it more digestible.  Do note in the center area how I added:
Code:
              # We decide if its the gear menu or not
              if $scene.right_window.active == true
                $game_system.se_play($data_system.escape_se)
              else
                $game_system.se_play($data_system.load_se)
              end
It allows for different audio depending on WHICH window you are in within Scene_Equip.  And it would not be possible to test that window without the prior inclusions I noted above.

This covers the use of SFX that are defined by the $game_system.se_play($data_system.AUDIO HERE) command.  You could go more advanced by setting up other SFX outside whats covered in the System class.  

[Image: Screen%20Shot%202023-04-09%20at%207.24.27%20PM.jpeg]
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply


Messages In This Thread
RE: Separate Sounds for Menu Scene - by DerVVulfman - 4 hours ago

Possibly Related Threads…
Thread Author Replies Views Last Post
   Parts of the Equip, Spells, and Status menus persist even after exiting the menu Ace_V 5 4,195 12-29-2024, 06:09 AM
Last Post: Ace_V
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 3 3,356 11-22-2024, 07:02 PM
Last Post: JayRay
   Need help with my menu - Current issue is item grid layout LilyFrog 41 54,532 09-24-2018, 02:03 AM
Last Post: LilyFrog
   Special Items Separate Menu Diorm 41 59,039 02-10-2018, 06:06 PM
Last Post: Diorm
   using $scene during battles Keeroh 5 12,250 01-17-2018, 04:31 PM
Last Post: Keeroh
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 13,126 05-31-2017, 05:10 AM
Last Post: Zachariad
Sad  Equip bug (1-scene CMS) Whisper 2 7,640 01-23-2017, 09:20 AM
Last Post: Whisper
   A fourth column in MOG Scene Item Laura V1.2 Noctis 13 27,125 11-27-2016, 05:12 PM
Last Post: DerVVulfman
   XAIL MENU from RPG VX ACE to RPG XP RASHIDA12 46 72,148 05-02-2016, 08:08 PM
Last Post: RASHIDA12
Tongue  Healing Spell doesn't work right in Menu? Bounty Hunter Lani 8 16,533 01-15-2015, 07:45 PM
Last Post: Bounty Hunter Lani



Users browsing this thread: 2 Guest(s)