4 hours ago
(This post was last modified: 4 hours ago by DerVVulfman.)
I have you one that might be a little more... fun.
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
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:
or
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:
I broke it down in a more plebian style to make it more digestible. Do note in the center area how I added:
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.
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
Each time it runs, it checks what type of $scene is running, ergo: when (THIS) ; SE_play this

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
Code:
class Scene_Equip
#--------------------------------------------------------------------------
# * Get the Right Window data
#--------------------------------------------------------------------------
def right_window
@right_window
end
end
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
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]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp_qcXyRg1lqj8IEGhhN1zuRio5AFNIfzdElYcazTxIFqIpfHArS9-l8A5-OVGHfV1rgUfJKK9JSmmqouQ7Nt0S3b6wUwmVrKbL1L6zgHxMbaU8HsbAkH3GrKokjXxP-fHd6Z1nCovhYbznr563ZSKx4OkpFz4qchf6PaH8QvmXHd7iNn4TLn4TY5rAg/s2125/Screen%20Shot%202023-04-09%20at%207.24.27%20PM.jpeg)