Vehikle SE VX
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.
The Script
Ruby: - # * 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
复制代码
Terms & Conditions
Free for use in ANY game.
Due credit is mandatory.
That's it!
本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址: https://forums.rpgmakerweb.com/threads/vehikle-se-vx.163252/ |