Vehikle SE - kyonides - 11-25-2023
Vehikle SE
VX + ACE
by Kyonides
Introduction
Did you ever need to play a SE once while boarding any vehicle during gameplay?
Guess what? Now you can do that in the blink of an eye!
You just need to define a Filename, a Volume, and a Pitch for your SE's!
Take a look at the default options to find out how you can do it.
VX Script
Code: # * Vehikle SE VX * #
# Scripter : Kyonides Arkanthes
# 2023-11-24
# This scriptlet allows you to define a SE for each vehicle type.
# That SE will be played once whenever the player boards a given vehicle.
module Sound
BOARD_SE = {}
# BOARD_SE[Type] = ["Filename", Volume, Pitch]
BOARD_SE[:boat] = ["Chime2", 70, 100]
BOARD_SE[:ship] = ["Fog1", 70, 100]
BOARD_SE[:airship] = ["Fire1", 70, 100]
@vehicle_se = {} # Do Not Edit This Line!
@types = [:boat, :ship, :airship]
def self.find_vehicle_se(type)
type = @types[type]
RPG::SE.new(*BOARD_SE[type])
end
def self.play_vehicle_se(type)
se = @vehicle_se[type] ||= find_vehicle_se(type)
se.play
end
end
class Game_Vehicle
alias :kyon_vehikle_se_gm_veh_get_on :get_on
def get_on
kyon_vehikle_se_gm_veh_get_on
Sound.play_vehicle_se(@type)
end
end
VX ACE Script
Code: # * Vehikle SE ACE * #
# Scripter : Kyonides Arkanthes
# 2023-11-24
# This scriptlet allows you to define a SE for each vehicle type.
# That SE will be played once whenever the player boards a given vehicle.
module Sound
BOARD_SE = {}
# BOARD_SE[Type] = ["Filename", Volume, Pitch]
BOARD_SE[:boat] = ["Chime1", 70, 100]
BOARD_SE[:ship] = ["Fog1", 70, 100]
BOARD_SE[:airship] = ["Fire1", 70, 100]
@vehicle_se = {} # Do Not Edit This Line!
def self.find_vehicle_se(type)
RPG::SE.new(*BOARD_SE[type])
end
def self.play_vehicle_se(type)
se = @vehicle_se[type] ||= find_vehicle_se(type)
se.play
end
end
class Game_Vehicle
alias :kyon_vehikle_se_gm_veh_get_on :get_on
def get_on
kyon_vehikle_se_gm_veh_get_on
Sound.play_vehicle_se(@type)
end
end
Terms & Conditions
Free for use in ANY game.
Due credit is mandatory.
That's it!
|