Project1

标题: VX显示地图名称脚本問題 [打印本页]

作者: rain9420622    时间: 2013-5-12 11:24
标题: VX显示地图名称脚本問題
本帖最后由 rain9420622 于 2013-5-12 11:28 编辑

RUBY 代码复制
  1. #===============================================================================
  2. # MOG_Location_Name_VX V1.0
  3. #===============================================================================
  4. # By Moghunter 汉化:火鸡三毛老大
  5. #===============================================================================
  6. module MOG
  7. #地图名字体.
  8. MPFONT = "Georgia"
  9. #------------------------------------------------
  10. #消失 ON/OFF(True - False).
  11. MPNMFD = true
  12. #------------------------------------------------
  13. #窗口消失时间.
  14. MPNMTM = 13
  15. #------------------------------------------------
  16. #窗口提示位置.
  17. # 0 = 左上角.
  18. # 1 = 左下角.
  19. # 2 = 右上角.
  20. # 3 = 右下角.
  21. MPNMPS = 0
  22. #------------------------------------------------
  23. # 关闭开启显示提示(ID).
  24. WM_SWITCH_VIS_DISABLE = 1
  25. end
  26. #------------------------------------------------
  27. ###############
  28. # Game_System #
  29. ###############
  30. class Game_System
  31. attr_accessor :fdtm
  32. attr_accessor :mpnm_x
  33. attr_accessor :mpnm_y
  34. alias mog_vx06_initialize initialize
  35. def initialize
  36. mog_vx06_initialize
  37. @fdtm = 255 + 40 * MOG::MPNMTM
  38. if MOG::MPNMPS == 0
  39. @mpnm_x = -340
  40. @mpnm_y = 0
  41. elsif MOG::MPNMPS == 1
  42. @mpnm_x = -300
  43. @mpnm_y = 320
  44. elsif MOG::MPNMPS == 2
  45. @mpnm_x = 640
  46. @mpnm_y = 0
  47. else
  48. @mpnm_x = 640
  49. @mpnm_y = 320
  50. end
  51. end
  52. def mpnm_x
  53. return @mpnm_x
  54. end
  55. def mpnm_y
  56. return @mpnm_y
  57. end
  58. def fdtm
  59. if @fdtm <= 0
  60. @fdtm = 0
  61. end
  62. return @fdtm
  63. end
  64. end
  65. ############
  66. # Game_Map #
  67. ############
  68. class Game_Map
  69. attr_reader :map_id
  70. def mpname
  71. $mpname = load_data("Data/MapInfos.rvdata")
  72. $mpname[@map_id].name
  73. end
  74. end
  75. ###############
  76. # Window Base #
  77. ###############
  78. class Window_Base < Window
  79. def nd_mapic
  80. mapic = Cache.system("")
  81. end
  82. def draw_mpname(x,y)
  83. mapic = Cache.system("Mpname") rescue nd_mapic
  84. cw = mapic.width
  85. ch = mapic.height
  86. src_rect = Rect.new(0, 0, cw, ch)
  87. self.contents.blt(x , y - ch + 65, mapic, src_rect)
  88. self.contents.font.name = MOG::MPFONT
  89. self.contents.font.size = 22
  90. self.contents.font.bold = true
  91. self.contents.font.shadow = true
  92. self.contents.font.color = Color.new(0,0,0,255)
  93. self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)
  94. self.contents.font.color = Color.new(255,255,255,255)
  95. self.contents.draw_text(x + 75, y + 26, 110, 32, $game_map.mpname.to_s,1)
  96. end
  97. end
  98. ##########
  99. # Mpname #
  100. ##########
  101. class Mpname < Window_Base
  102. def initialize(x , y)
  103. super($game_system.mpnm_x, $game_system.mpnm_y, 250, WLH + 70)
  104. self.opacity = 0
  105. refresh
  106. end
  107. def refresh
  108. self.contents.clear
  109. draw_mpname(10,0)
  110. end
  111. end
  112. #############
  113. # Scene_Map #
  114. #############
  115. class Scene_Map
  116. alias mog_vx06_start start
  117. def start
  118. @mpnm = Mpname.new($game_system.mpnm_x, $game_system.mpnm_y)
  119. @mpnm.contents_opacity = $game_system.fdtm
  120. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
  121. @mpnm.visible = true
  122. else
  123. @mpnm.visible = false
  124. end
  125. mog_vx06_start
  126. end
  127. alias mog_vx06_terminate terminate
  128. def terminate
  129. mog_vx06_terminate
  130. @mpnm.dispose
  131. end
  132. alias mog_vx06_update update
  133. def update
  134. mog_vx06_update
  135. location_name_update
  136. end
  137. def location_name_update
  138. $game_system.mpnm_x = @mpnm.x
  139. $game_system.mpnm_y = @mpnm.y
  140. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == true or $game_system.fdtm <= 0
  141. @mpnm.visible = false
  142. else
  143. @mpnm.visible = true
  144. end
  145. if MOG::MPNMPS == 0 or MOG::MPNMPS == 1
  146. #改动在这里,数值越大越靠近屏幕的右侧
  147. if @mpnm.x < 300
  148. @mpnm.x += 5 #这个数值越大移动速度越快
  149. #elsif @mpnm.x >= 0 #这两句是原来脚本的,现在可以去掉了
  150. #@mpnm.x = 0
  151. end
  152. else
  153. if @mpnm.x > 300
  154. @mpnm.x -= 5
  155. elsif @mpnm.x <= 300
  156. @mpnm.x = 300
  157. end
  158. end
  159. @mpnm.contents_opacity = $game_system.fdtm
  160. if MOG::MPNMFD == true
  161. $game_system.fdtm -= 3
  162. end
  163. end
  164. alias mog_vx06_update_transfer_player update_transfer_player
  165. def update_transfer_player
  166. return unless $game_player.transfer?
  167. @mpnm.contents_opacity = 0
  168. mog_vx06_update_transfer_player
  169. if MOG::MPNMPS == 0
  170. $game_system.mpnm_x = -340
  171. $game_system.mpnm_y = 0
  172. elsif MOG::MPNMPS == 1
  173. $game_system.mpnm_x = -340
  174. $game_system.mpnm_y = 320
  175. elsif MOG::MPNMPS == 2
  176. $game_system.mpnm_x = 640
  177. $game_system.mpnm_y = 0
  178. else
  179. $game_system.mpnm_x = 640
  180. $game_system.mpnm_y = 320
  181. end
  182. @mpnm.y = $game_system.mpnm_y
  183. @mpnm.x = $game_system.mpnm_x
  184. $game_system.fdtm = 255 + 60 * MOG::MPNMTM
  185. @mpnm.refresh
  186. end
  187. end
  188. $mogscript = {} if $mogscript == nil
  189. $mogscript["location_name_vx"] = true


这个是显示地图名称的脚本,
就是从画面左方移动到右方后淡出,
但我现在的问题是,他前两个地图有很成功的出现了,
可是第三个跟第四个地图却没出现,

但用在另一个我拿来测试脚本用的游戏时,
却成功的都有出现,
不懂啊!

原帖:http://rpg.blue/forum.php?mod=viewthread&tid=122754
作者: 351323331    时间: 2013-5-12 13:14
那就应该附上你的工程,这样才能有效的帮你解决问题吧。。
作者: 芙蕾娅    时间: 2013-5-12 15:44
注意第24行的WM_SWITCH_VIS_DISABLE = 1
是否打开了1号开关?
作者: rain9420622    时间: 2013-5-12 16:19
芙蕾娅 发表于 2013-5-12 15:44
注意第24行的WM_SWITCH_VIS_DISABLE = 1
是否打开了1号开关?

1号开关?是指什麼?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1