| 赞 | 5 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2017-3-27 |
| 在线时间 | 248 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 248 小时
- 注册时间
- 2010-8-22
- 回帖
- 105
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 YamazakiRyusa 于 2014-11-7 13:03 编辑
简述
本脚本还原了角色行走时的脚步声。
版本 1.00 Alpha
特性
实现了不同的地图标识响应不同的脚步声
同类脚步声的随机化
计划改进
不同护甲类型(轻、重、魔法)反馈不同脚步声
层叠元件的脚步声区分(通过判断方向)
若干 BUG 修复
需求
若干脚步声文件(范例中已经提供,故建议下载范例以获得声音素材)
使用方法
Step 1:下载 RSP-FSE_RequiredSE 音效文件包,解压到您的工程 Audio\SE 文件夹内
Step 2:复制脚本粘贴到“插件脚本”之后
Step 3:游戏中开启一号开关,以启用脚步声
Step 4:Have Fun!
注释
——地形标识对应的声音类型
0 - 无声
1 - 草地
2 - 沙地
3 - 雪地
4 - 木头
5 - 水·浅滩
6 - 石头
7 - 金属
——我想换个启用的开关
脚本的 84 行 $game_switches[1] 更改为 $game_switches[#你想要的开关编号]
——我想更换声音素材
两个方法,其一是文件名不变替换掉音频文件;其二也可以更改 Play SE 里面的判断部分
比如草地的脚步声素材按这个文件名替换掉就可以:
fst_grass_light_walk_00x.wav
——其他废话
@amount_of_xxx 是拿给随机数计算的某一类声音(比如草地脚步声)的数量,如果能直接通过文件数量判断更好,未来我也打算把脚步声素材按类型分到不同文件夹,然后 SE\Grass 下面是 001.wav 002.wav…,这样的话直接用代码算出文件数量更方便了。
BUGs
跑动时脚步声过于频繁
脚步声仍然有问题——仔细听了老滚里面的脚步声,其实是按顺序播放音频文件而不是随机的,如果连续三次都随到 1 不死板才怪,以后改进……
脚本
[pre lang="ruby" line="1"]#==============================================================================
# ■ Ryusa FootstepSE
#------------------------------------------------------------------------------
# 脚步声系统 v1.00 by Ryusa - Responced Footstep Sound Playback System
# ·实现了不同的地图标识响应不同的脚步声 - Multi-terrain ID with different sounds
# ·同类脚步声随机化 - Randomized sounds in every terrain type to make it more immersive!
# 未来计划改进: - Future update plant
# ·不同护甲类型(轻、重、魔法)反馈不同脚步声 - Playing back with different armor type: Light, Heavy and Magic
# ·层叠元件的脚步声区分(通过判断方向)
#------------------------------------------------------------------------------
# 素材来源申明 - WAV Resources Announcement
# 整合自《上古卷轴Ⅴ:天际》的 "IMMERSIVE SOUNDS - COMPENDIUM" MOD 资源包 by lazygecko
# 原素材(脚步声部分)来自 freesound.org 的如下贡献者:
# ABouch, Halleck, DasDeer, Corsica-S, ddunkley, nickb1608, mallement,
# Vosvoy, RutgerMuller, jwb4, cheeseheadburger, martinimeniscus
#==============================================================================
# Requirements
module RYUSA
FootstepSE_Version = "1.00 Alpha"
end
# Functions
class FootstepSE
include RYUSA
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
@enable_debug = true
@volum = 65 # Footstep Volum
@amount_of_grass = 6 # 1 - Sounds Amount of Grass
@amount_of_sand = 6 # 2 - Sounds Amount of Sand
@amount_of_snow = 6 # 3 - Sounds Amount of Snow
@amount_of_wood = 6 # 4 - Sounds Amount of Wood
@amount_of_water = 3 # 5 - Sounds Amount of Water
@amount_of_stone = 3 # 6 - Sounds Amount of Stone
@amount_of_metal = 6 # 7 - Sounds Amount of Metal
@sets = [1, @amount_of_grass, @amount_of_sand, @amount_of_snow, @amount_of_wood, @amount_of_water, @amount_of_stone, @amount_of_metal]
@terrain_mark = 0
end
#--------------------------------------------------------------------------
# ● Pre-process
#--------------------------------------------------------------------------
def play
process if enable? && $game_player.moving?
debug if @enable_debug
end
#--------------------------------------------------------------------------
# ● Process
#--------------------------------------------------------------------------
def process
play_se
end
#--------------------------------------------------------------------------
# ● Play SE
#--------------------------------------------------------------------------
def play_se
@terrain_mark = get_terrain_mark
@dice = get_dice
case @terrain_mark
when 0 # No Sound
when 1 # Glass
Audio.se_play("Audio/SE/fst_grass_light_walk_00" + @dice.to_s,@volum)
when 2 # Sand
Audio.se_play("Audio/SE/fst_sand_light_walk_00" + @dice.to_s,@volum)
when 3 # snow
Audio.se_play("Audio/SE/fst_snow_light_walk_00" + @dice.to_s,@volum)
when 4 # wood
Audio.se_play("Audio/SE/fst_wood_light_walk_00" + @dice.to_s,@volum)
when 5 # water
Audio.se_play("Audio/SE/fst_water_heavy_run_00" + @dice.to_s,@volum)
when 6 # stone
Audio.se_play("Audio/SE/fst_stone_light_walk_00" + @dice.to_s,@volum)
when 7 # metal
Audio.se_play("Audio/SE/fst_metal_light_walk_00" + @dice.to_s,@volum)
else return 0
end
end
#--------------------------------------------------------------------------
# ● Get Flag
#--------------------------------------------------------------------------
def enable?
return $game_switches[1]
end
#--------------------------------------------------------------------------
# ● Get Terrain Mark
#--------------------------------------------------------------------------
def get_terrain_mark
return $game_map.terrain_tag($game_player.x, $game_player.y)
end
#--------------------------------------------------------------------------
# ● Get Dice
#--------------------------------------------------------------------------
def get_dice
if enable?
return rand(@sets[@terrain_mark] - 1) + 1 # Not include zero!
else
return 0
end
end
#--------------------------------------------------------------------------
# ● Debug
#--------------------------------------------------------------------------
def debug
puts "-----------------------"
puts "Footstep SE " + (enable? ? "Enable" : "Suspended")
puts ($game_player.moving? ? "Moving..." : "Standby")
puts "Player are " + ($game_player.dash? ? "dashing" : ($game_player.moving? ? "walking" : "standing"))
puts "terrain Mark: " + @terrain_mark.to_s
puts "Random Sound Index: " + get_dice.to_s
end
end
#==============================================================================
# ■ Game_Player
#------------------------------------------------------------------------------
# Overwrite
#==============================================================================
class Game_Player
alias FSSE_move_by_input move_by_input
def move_by_input
return if !movable? || $game_map.interpreter.running?
move_straight(Input.dir4) if Input.dir4 > 0
footstepse = FootstepSE.new
footstepse.play
end
end
[/pre]
下载
范例工程|音频文件包 |
|