| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 0 |  
| 经验 | 0 |  
| 最后登录 | 2012-9-6 |  
| 在线时间 | 15 小时 |  
 Lv1.梦旅人 
	梦石0 星屑345 在线时间15 小时注册时间2012-7-7帖子2 | 
| 在做一个游戏,开始是多角色选定的,但是后面加载对话框显示角色头像和角色名称时很纠结,在网上找了一个vx脚本,哪位大神能帮忙移植到va啊。 
 找到的vx脚本基本思路是如下:
 
 首先,不再使用角色在角色表中的索引,即不使用id,而使用角色在当前队伍中的编号,即你需要知道当前主角应该在队伍中排第几
 
 所以要替换一些东西,将$game_actors[x]变成$game_party.members[x]
 
 然后,至于角色的头像显示,提供的方法中,需要加入一个素材,即在Face文件夹中加入一张图(内容没有任何要求),文件名命为“MAIN”(当然,这个也无所谓),称这张图为索引图片
 下面是脚本:
 
 复制代码于是设置事件时,选择头像时,选择索引文件,然后主角在队伍中第X位,就选择第X个(8个框框嘛)
 然后这样的话,对话时会显示队伍中第X位的头像。
 
 最后,是名称,加入\M转义,即在对话中\M[X]就是指队伍中第X位的名称(类似于\N转义)
 (M是我设置的,可以任意改)
 
 原vx脚本
 class Game_Interpreter
 
 
 def command_101
 
 unless $game_message.busy
 
 if @params[0] == "MAIN"    #索引图片的名称
 
 actor = $game_party.members[@params[1]]
 
 face_name = actor.character_name
 face_index = actor.character_index
 
 else
 
 face_name = @params[0]
 
 face_index = @params[1]
 
 end
 
 $game_message.face_name = face_name
 
 $game_message.face_index = face_index
 
 $game_message.background = @params[2]
 
 $game_message.position = @params[3]
 
 @index += 1
 
 while @list[@index].code == 401       # 文章数据
 
 $game_message.texts.push(@list[@index].parameters[0])
 
 @index += 1
 
 end
 
 if @list[@index].code == 102          # 显示选择项
 
 setup_choices(@list[@index].parameters)
 
 elsif @list[@index].code == 103       # 数值输入处理
 
 setup_num_input(@list[@index].parameters)
 
 end
 
 set_message_waiting                   # 设置等待信息结束
 
 end
 
 return false
 
 end
 
 
 
 end
 
 
 class Window_Message
 
 
 
 alias :iisnow_convert_special_characters :convert_special_characters
 
 def convert_special_characters
 
 @text.gsub!(/\\M\[([0-9]+)\]/i) { $game_party.members[$1.to_i].name }
 
 iisnow_convert_special_characters
 
 end
 
 
 
 end
 
 真的很急,游戏要求时间很紧,这个弄不好后续的对话都不知道应该怎么做,谢谢各位了!~
 | 
 |