I'm trying to make individual sound effects stop after being played, and i attempted to use RPG::SEs to do that, but i'm not sure how i would load an RPG::SE with a filename.
Is there some sort of workaround to stopping a stored/individual sound effect? Or do i just stop all sound effects when doing this?
Current code without the sfx stopping, if it helps:
Is there some sort of workaround to stopping a stored/individual sound effect? Or do i just stop all sound effects when doing this?
Current code without the sfx stopping, if it helps:
Ruby:
class Window_ItemList < Window_Selectable
def process_cursor_move
# unchanged code from Window_Selectable
return unless cursor_movable?
last_index = @index
cursor_down (Input.trigger?(:DOWN)) if Input.repeat?(:DOWN)
cursor_up (Input.trigger?(:UP)) if Input.repeat?(:UP)
cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
cursor_left (Input.trigger?(:LEFT)) if Input.repeat?(:LEFT)
cursor_pagedown if !handle?(:pagedown) && Input.trigger?(:R)
cursor_pageup if !handle?(:pageup) && Input.trigger?(:L)
# sound effect, which was changed
if @index != last_index
sound = @data[@index].itemsfx
if sound && sound != ""
Audio.se_play("Audio/SE/" + sound)
else
Sound.play_cursor
end
end
end
end