设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 6368|回复: 9
打印 上一主题 下一主题

[RMVA发布] 自己制作的VA脚本---任务+地图提示 新版发布~~

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2010-7-10
帖子
111
跳转到指定楼层
1
发表于 2012-3-4 20:06:53 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 zhangchi5 于 2012-3-18 19:35 编辑

新版发布啦!!!

神奇呀神奇~神奇呀神奇~神奇呀神奇~神奇呀神奇~……

任务系统 for VA
添加后 以前的存档都不能用。。。要新开存档
By SkyZH

使用方法:

新开任务:
事件中插入脚本--
  1. str="任务名称"
  2. $game_missions.mission(20).setTitle(str)
  3. str="介绍"
  4. $game_missions.mission(20).setText(str)
  5. str="重要信息以及奖励"
  6. $game_missions.mission(20).setImText(str)
  7. str="接任务NPC"
  8. str1="收任务NPC"
  9. $game_missions.mission(20).setNPC(str,str1)
  10. $game_missions.mission(20).setStatus(true)
复制代码

完成任务:
事件中插入脚本--
  1. @p=$game_missions.serMission("任务名称")
  2. $game_missions.mission(@p).clear
  3. $game_missions.mission(@p).setStatus(false)
复制代码
serMission(任务名称),返回此任务的编号!

查找是否接了这个任务:
事件中条件分歧-第4页-脚本
$game_missions.serMission("任务名")!=-1

地图提示:
事件中插入脚本--
  1. $game_maphint.clear
  2. stringa="世界真猥琐~"
  3. $game_maphint.setText(0,stringa)
  4. stringa="全家就是你家,欢迎回家~"
  5. $game_maphint.setText(1,stringa)
复制代码
$game_maphint.setText(行号,文字)


(老版)截图:











(新版)截图:






代码一堆堆。。。





  1. #==============================================================================
  2. # ■ Game_MapHint
  3. #------------------------------------------------------------------------------
  4. #  地图提示信息显示。
  5. #==============================================================================
  6. class Game_MapHint

  7. def initialize
  8. @texts = []
  9. end

  10. def visible_line
  11. @texts.size
  12. end

  13. def text(line)
  14. @texts[line]
  15. end

  16. def setText(line , text)
  17. @texts[line]=text
  18. end

  19. def clear
  20. for i in [email protected]
  21. @texts.delete_at(i)
  22. end
  23. end

  24. end
  25. #==============================================================================
  26. # ■ Game_Mission
  27. #------------------------------------------------------------------------------
  28. #  任务信息显示。
  29. #==============================================================================
  30. class Game_Mission

  31. def initialize
  32. @texts = ""
  33. @titletext = ""
  34. @imtext = ""
  35. @NPC1 = ""
  36. @NPC2 = ""
  37. @bool_mission = false
  38. end

  39. def setText(text)
  40. @texts=text
  41. end

  42. def setTitle(text)
  43. @tetlitext=text
  44. end

  45. def setImText(text)
  46. @imtext=text
  47. end

  48. def setNPC(t1, t2)
  49. @NPC1=t1
  50. @NPC2=t2
  51. end

  52. def setStatus(b)
  53. @bool_mission=b
  54. end

  55. def getText
  56. @texts
  57. end

  58. def getTitle
  59. @tetlitext
  60. end

  61. def getImText
  62. @imtext
  63. end

  64. def getNPC1
  65. @NPC1
  66. end

  67. def getNPC2
  68. @NPC2
  69. end

  70. def getStatus
  71. @bool_mission
  72. end



  73. def clear
  74. @texts = ""
  75. @titletext = ""
  76. @imtext = ""
  77. @NPC1 = ""
  78. @NPC2 = ""
  79. @bool_mission = false
  80. end

  81. end

  82. #==============================================================================
  83. # ■ Game_Missions
  84. #------------------------------------------------------------------------------
  85. #  任务信息显示。
  86. #==============================================================================
  87. class Game_Missions

  88. def initialize
  89. @mission_array=Array.new
  90. for i in 0...100
  91. @mission_array[i]=Game_Mission.new
  92. end
  93. end

  94. def mission(t)
  95. return @mission_array[t]
  96. end

  97. def getNoMission
  98. for i in 99..0
  99. if @mission_array[i].getStatus==false
  100. return i
  101. end
  102. end

  103. end

  104. def clear
  105. for i in 0...100
  106. @mission_array[i].clear
  107. end
  108. end

  109. def serMission(titletext)
  110. for i in 0...100
  111. if @mission_array[i].getTitle==titletext && @mission_array[i].getStatus==true then
  112. return i
  113. end
  114. end
  115. return -1

  116. end

  117. def getMissionNum
  118. @r=0
  119. for i in 99..0
  120. if @mission_array[i].getStatus==true
  121. @r=@r+1
  122. end
  123. end
  124. return @r
  125. end
  126. end

  127. #==============================================================================
  128. # ■ Window_MapHint
  129. #------------------------------------------------------------------------------
  130. #  显示地图信息。 By SkyZH
  131. #==============================================================================

  132. class Window_MapHint < Window_Base
  133. #--------------------------------------------------------------------------
  134. # ● 初始化对像
  135. #--------------------------------------------------------------------------
  136. def initialize(x, y)
  137. super(x, y, window_width, Graphics.height)
  138. self.openness = 0
  139. open
  140. refresh
  141. end
  142. #--------------------------------------------------------------------------
  143. # ● 获取窗口的宽度
  144. #--------------------------------------------------------------------------
  145. def window_width
  146. return Graphics.width - 256
  147. end

  148. def draw_title
  149. self.contents.font.color=system_color
  150. self.contents.font.size=48
  151. draw_text(4, 0, window_width-40, fitting_height(1),"提示 - " + $game_map.display_name,1)
  152. self.contents.font.color=normal_color
  153. self.contents.font.size=Font.default_size
  154. end
  155. #--------------------------------------------------------------------------
  156. # ● 刷新
  157. #--------------------------------------------------------------------------
  158. def refresh
  159. draw_title
  160. for i in 0..($game_maphint.visible_line-1)
  161. @tempn=$game_maphint.text(i)
  162. draw_text(4, fitting_height(i+1), window_width-40, fitting_height(1) ,@tempn,1)
  163. end
  164. end
  165. end

  166. #==============================================================================
  167. # ■ Window_MissionShow
  168. #------------------------------------------------------------------------------
  169. #  显示任务信息。 By SkyZH
  170. #==============================================================================

  171. class Window_MissionShow < Window_Selectable
  172. #--------------------------------------------------------------------------
  173. # ● 初始化对像
  174. #--------------------------------------------------------------------------
  175. def initialize(x, y)
  176. super(x, y, window_width, Graphics.height)
  177. self.openness = 0
  178. open
  179. end

  180. def setNumber(numbers)
  181. @Mnumber=numbers
  182. refresh
  183. end

  184. #--------------------------------------------------------------------------
  185. # ● 获取窗口的宽度
  186. #--------------------------------------------------------------------------
  187. def window_width
  188. return Graphics.width
  189. end

  190. def draw_title(text , line, size ,dwhere ,color)
  191. self.contents.font.color=color
  192. self.contents.font.size=size

  193. draw_text(4, 0 , window_width-40, fitting_height(line+1), text ,dwhere)
  194. self.contents.font.color=normal_color
  195. self.contents.font.size=Font.default_size
  196. end
  197. #--------------------------------------------------------------------------
  198. # ● 刷新
  199. #--------------------------------------------------------------------------
  200. def refresh
  201. contents.clear
  202. @texts= $game_missions.mission(@Mnumber).getTitle
  203. draw_title(@texts,0,48,1,Color.new(255,100,100))
  204. draw_title("任务介绍",4,22,0,Color.new(100,255,255))
  205. draw_title($game_missions.mission(@Mnumber).getText,6,18,0,Color.new(255,255,255))
  206. draw_title("任务奖励/重要信息",9,22,0,Color.new(100,255,255))
  207. draw_title($game_missions.mission(@Mnumber).getImText,11,18,0,Color.new(255,255,255))
  208. draw_title("领取任务NPC",14,22,0,Color.new(100,255,255))
  209. draw_title($game_missions.mission(@Mnumber).getNPC1,16,18,0,Color.new(255,255,255))
  210. draw_title("交接任务NPC",19,22,0,Color.new(100,255,255))
  211. draw_title($game_missions.mission(@Mnumber).getNPC2,21,18,0,Color.new(255,255,255))

  212. end

  213. end

  214. #==============================================================================
  215. # ■ Window_MenuCommand
  216. #------------------------------------------------------------------------------
  217. #  任务画面中显示指令的窗口 By SkyZH
  218. #==============================================================================

  219. class Window_MissionCommand < Window_Command
  220. #--------------------------------------------------------------------------
  221. # ● 初始化对象
  222. #--------------------------------------------------------------------------
  223. def initialize
  224. super(0, 0)
  225. end
  226. #--------------------------------------------------------------------------
  227. # ● 获取窗口的宽度
  228. #--------------------------------------------------------------------------
  229. def window_width
  230. return 256
  231. end
  232. #--------------------------------------------------------------------------
  233. # ● 获取显示行数
  234. #--------------------------------------------------------------------------
  235. def visible_line_number
  236. (Graphics.height-standard_padding*2)/line_height
  237. end
  238. #--------------------------------------------------------------------------
  239. # ● 生成指令列表
  240. #--------------------------------------------------------------------------
  241. def make_command_list
  242. add_original_commands
  243. add_return_command
  244. end
  245. #--------------------------------------------------------------------------
  246. # ● 独自添加指令用
  247. #--------------------------------------------------------------------------
  248. def add_original_commands
  249. for i in 0...100
  250. @r=i+1
  251. @t="mission" + i.to_s
  252. if $game_missions.mission(i).getStatus==true
  253. add_command($game_missions.mission(i).getTitle, @t.to_sym)
  254. end
  255. end
  256. end
  257. #--------------------------------------------------------------------------
  258. # ● 结束指令用
  259. #--------------------------------------------------------------------------
  260. def add_return_command
  261. add_command("返回", :returnsc)
  262. end
  263. #--------------------------------------------------------------------------
  264. # ● 按下确定键时的处理
  265. #--------------------------------------------------------------------------
  266. def process_ok
  267. super
  268. end

  269. def call_handler(symbol)
  270. @handler[symbol].call(symbol.id2name[7,symbol.id2name.size-7].to_i) if handle?(symbol)
  271. end
  272. end



  273. #encoding:utf-8
  274. #==============================================================================
  275. # ■ Scene_Mission
  276. #------------------------------------------------------------------------------
  277. #  任务
  278. #==============================================================================

  279. class Scene_Mission < Scene_MenuBase
  280. #--------------------------------------------------------------------------
  281. # ● 开始处理
  282. #--------------------------------------------------------------------------
  283. def start
  284. super
  285. create_command_window
  286. end
  287. #--------------------------------------------------------------------------
  288. # ● 生成指令窗口
  289. #--------------------------------------------------------------------------
  290. def create_command_window
  291. @maphint_window= Window_MapHint.new(256,0)
  292. @command_window = Window_MissionCommand.new
  293. @window_missionShow=Window_MissionShow.new(0,0)
  294. @window_missionShow.hide
  295. @command_window.set_handler(:returnsc, method(:scenereturns))
  296. @command_window.set_handler(:cancel, method(:scenereturns))
  297. @window_missionShow.set_handler(:cancel, method(:missionHide))
  298. @window_missionShow.set_handler(:ok, method(:missionHide))
  299. for i in 0...100
  300. @r=i
  301. @t="mission" + i.to_s
  302. @command_window.set_handler(@t.to_sym, method(:missionShow))
  303. end

  304. end

  305. def scenereturns( t)
  306. SceneManager.return
  307. end

  308. def missionShow( t)
  309. @window_missionShow.setNumber(t)
  310. @command_window.deactivate
  311. @window_missionShow.activate
  312. @window_missionShow.openness=0
  313. @window_missionShow.show
  314. @window_missionShow.open
  315. @window_missionShow.refresh
  316. end

  317. def missionHide
  318. @command_window.activate
  319. @window_missionShow.deactivate
  320. @window_missionShow.close
  321. update until @window_missionShow.close?
  322. @window_missionShow.hide
  323. end

  324. end


  325. #==============================================================================
  326. # ■ Window_MenuCommand
  327. #------------------------------------------------------------------------------
  328. #  菜单画面中显示指令的窗口
  329. #==============================================================================

  330. class Window_MenuCommand < Window_Command
  331. #--------------------------------------------------------------------------
  332. # ● 独自添加指令用
  333. #--------------------------------------------------------------------------
  334. def add_original_commands
  335. add_command("地图提示", :maphint)
  336. end
  337. end

  338. #==============================================================================
  339. # ■ Scene_Menu
  340. #------------------------------------------------------------------------------
  341. #  菜单画面
  342. #==============================================================================

  343. class Scene_Menu < Scene_MenuBase
  344. #--------------------------------------------------------------------------
  345. # ● 生成指令窗口
  346. #--------------------------------------------------------------------------
  347. def create_command_window
  348. @command_window = Window_MenuCommand.new
  349. @command_window.set_handler(:item, method(:command_item))
  350. @command_window.set_handler(:skill, method(:command_personal))
  351. @command_window.set_handler(:equip, method(:command_personal))
  352. @command_window.set_handler(:status, method(:command_personal))
  353. @command_window.set_handler(:formation, method(:command_formation))
  354. @command_window.set_handler(:save, method(:command_save))
  355. @command_window.set_handler(:game_end, method(:command_game_end))
  356. @command_window.set_handler(:cancel, method(:return_scene))

  357. @command_window.set_handler(:maphint, method(:command_maphint))
  358. end

  359. def command_maphint
  360. SceneManager.call(Scene_Mission)
  361. end
  362. end



  363. #==============================================================================
  364. # ■ DataManager
  365. #------------------------------------------------------------------------------
  366. #  数据库和游戏实例的管理器。所有在游戏中使用的全局变量都在这里初始化。
  367. #==============================================================================

  368. module DataManager
  369. #--------------------------------------------------------------------------
  370. # ● 生成各种游戏对象
  371. #--------------------------------------------------------------------------
  372. def self.create_game_objects
  373. $game_temp = Game_Temp.new
  374. $game_system = Game_System.new
  375. $game_timer = Game_Timer.new
  376. $game_message = Game_Message.new
  377. $game_switches = Game_Switches.new
  378. $game_variables = Game_Variables.new
  379. $game_self_switches = Game_SelfSwitches.new
  380. $game_actors = Game_Actors.new
  381. $game_party = Game_Party.new
  382. $game_troop = Game_Troop.new
  383. $game_map = Game_Map.new
  384. $game_player = Game_Player.new
  385. $game_maphint = Game_MapHint.new
  386. $game_missions = Game_Missions.new
  387. end
  388. #--------------------------------------------------------------------------
  389. # ● 生成存档内容
  390. #--------------------------------------------------------------------------
  391. def self.make_save_contents
  392. contents = {}
  393. contents[:system] = $game_system
  394. contents[:timer] = $game_timer
  395. contents[:message] = $game_message
  396. contents[:switches] = $game_switches
  397. contents[:variables] = $game_variables
  398. contents[:self_switches] = $game_self_switches
  399. contents[:actors] = $game_actors
  400. contents[:party] = $game_party
  401. contents[:troop] = $game_troop
  402. contents[:map] = $game_map
  403. contents[:player] = $game_player
  404. contents[:maphint] = $game_maphint
  405. contents[:missions] = $game_missions
  406. contents
  407. end
  408. #--------------------------------------------------------------------------
  409. # ● 展开存档内容
  410. #--------------------------------------------------------------------------
  411. def self.extract_save_contents(contents)
  412. $game_system = contents[:system]
  413. $game_timer = contents[:timer]
  414. $game_message = contents[:message]
  415. $game_switches = contents[:switches]
  416. $game_variables = contents[:variables]
  417. $game_self_switches = contents[:self_switches]
  418. $game_actors = contents[:actors]
  419. $game_party = contents[:party]
  420. $game_troop = contents[:troop]
  421. $game_map = contents[:map]
  422. $game_player = contents[:player]
  423. $game_maphint = contents[:maphint]
  424. $game_missions = contents[:missions]
  425. end
  426. end
复制代码

评分

参与人数 1星屑 +200 收起 理由
忧雪の伤 + 200 奖赏条例

查看全部评分

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
2
发表于 2012-3-4 20:51:59 | 只看该作者
本帖最后由 杂兵天下 于 2012-3-5 01:08 编辑

看了之后,收回刚才说的话,LZ是一个连alias法冲突避免都不知道的可爱的天朝人
RUBY 代码复制
  1. class Game_Mission  
  2.   def initialize
  3.     @texts = ""
  4.     @titletext = ""
  5.     @imtext = ""
  6.     @NPC1 = ""
  7.     @NPC2 = ""
  8.     @bool_mission = false
  9.   end
  10.   def setText(text);@texts=text;end
  11.   def setTitle(text);@titletext=text;end
  12.   def setImText(text);@imtext=text;end
  13.   def setNPC(t1, t2);@NPC1=t1;@NPC2=t2;end
  14.   def setStatus(b);@bool_mission=b;end
  15.   def getText;@texts;end
  16.   def getTitle;@titletext;end
  17.   def getImText;@imtext;end
  18.   def getNPC1;@NPC1;end
  19.   def getNPC2;@NPC2;end
  20.   def getStatus;@bool_mission;end
  21.   def clear
  22.     @texts = ""
  23.     @titletext = ""
  24.     @imtext = ""
  25.     @NPC1 = ""
  26.     @NPC2 = ""
  27.     @bool_mission = false
  28.   end
  29. end
  30. class Game_Missions
  31.   def initialize
  32.     @mission_array=Array.new
  33.     for i in 0...100
  34.       @mission_array[i]=Game_Mission.new
  35.     end
  36.   end
  37.   def mission(t);@mission_array[t];end
  38.   def getNoMission
  39.     for i in 99..0
  40.       if @mission_array[i].getStatus==false
  41.         return i
  42.       end
  43.     end
  44.   end
  45.   def clear
  46.     for i in 0...100
  47.       @mission_array[i].clear
  48.     end   
  49.   end
  50.   def serMission(titletext)
  51.     for i in 0...100
  52.       if @mission_array[i].getTitle==titletext && @mission_array[i].getStatus==true then
  53.         return i
  54.       end
  55.     end
  56.     return -1
  57.   end
  58. end
  59. class Window_MissionShow < Window_Selectable
  60.   #--------------------------------------------------------------------------
  61.   # ● 初始化对像
  62.   #--------------------------------------------------------------------------
  63.   def initialize(x, y)
  64.     super(x, y, window_width, Graphics.height)
  65.     self.openness = 0
  66.     open
  67.   end
  68.   def setNumber(numbers)
  69.     @Mnumber=numbers
  70.     refresh
  71.   end
  72.  
  73.   #--------------------------------------------------------------------------
  74.   # ● 获取窗口的宽度
  75.   #--------------------------------------------------------------------------
  76.   def window_width
  77.     return Graphics.width - 256
  78.   end
  79.  
  80.   def draw_title(text , line, size ,dwhere ,color)
  81.     self.contents.font.color=color
  82.     self.contents.font.size=size
  83.  
  84.     draw_text(4, 0 , window_width-40, fitting_height(line+1), text ,dwhere)
  85.     self.contents.font.color=normal_color
  86.     self.contents.font.size=Font.default_size
  87.   end  
  88.   #--------------------------------------------------------------------------
  89.   # ● 刷新
  90.   #--------------------------------------------------------------------------
  91.   def refresh
  92.     @texts= $game_missions.mission(@Mnumber).getTitle
  93.     draw_title(@texts,0,48,1,Color.new(255,100,100))
  94.     draw_title("任务介绍",4,22,0,Color.new(100,255,255))
  95.     draw_title($game_missions.mission(@Mnumber).getText,6,18,0,Color.new(255,255,255))
  96.     draw_title("任务奖励/重要信息",9,22,0,Color.new(100,255,255))
  97.     draw_title($game_missions.mission(@Mnumber).getImText,11,18,0,Color.new(255,255,255))
  98.     draw_title("领取任务NPC",14,22,0,Color.new(100,255,255))
  99.     draw_title($game_missions.mission(@Mnumber).getNPC1,16,18,0,Color.new(255,255,255))
  100.     draw_title("交接任务NPC",19,22,0,Color.new(100,255,255))
  101.     draw_title($game_missions.mission(@Mnumber).getNPC2,21,18,0,Color.new(255,255,255))
  102.  
  103.   end
  104.  
  105. end
  106. #encoding:utf-8
  107. class Window_MissionCommand < Window_Command
  108.   #--------------------------------------------------------------------------
  109.   # ● 初始化对象
  110.   #--------------------------------------------------------------------------
  111.   def initialize
  112.     super(0, 0)
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 获取窗口的宽度
  116.   #--------------------------------------------------------------------------
  117.   def window_width
  118.     return 256
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ● 获取显示行数
  122.   #--------------------------------------------------------------------------
  123.   def visible_line_number
  124.     10
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 生成指令列表
  128.   #--------------------------------------------------------------------------
  129.   def make_command_list
  130.     add_original_commands
  131.     add_return_command
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 独自添加指令用
  135.   #--------------------------------------------------------------------------
  136.   def add_original_commands
  137.     for i in 0...100
  138.       @r=i+1
  139.       @t="mission" + i.to_s
  140.       if $game_missions.mission(i).getStatus==true
  141.         add_command($game_missions.mission(i).getTitle, @t.to_sym)
  142.       end
  143.     end
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 结束指令用
  147.   #--------------------------------------------------------------------------
  148.   def add_return_command
  149.     add_command("返回", :returnsc)
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 按下确定键时的处理
  153.   #--------------------------------------------------------------------------
  154.   def process_ok
  155.     super
  156.   end
  157.   def call_handler(symbol)
  158.     @handler[symbol].call(symbol.id2name[7,symbol.id2name.size-7].to_i) if handle?(symbol)
  159.   end
  160. end
  161. #encoding:utf-8
  162. class Scene_Mission < Scene_MenuBase
  163.   def start
  164.     super
  165.     create_command_window
  166.   end
  167.   def create_command_window
  168.     @command_window = Window_MissionCommand.new
  169.     @window_missionShow=Window_MissionShow.new(256,0)
  170.     @window_missionShow.hide
  171.     @command_window.set_handler(:returnsc,    method(:scenereturns))
  172.     @command_window.set_handler(:cancel,      method(:scenereturns))
  173.     @window_missionShow.set_handler(:cancel,  method(:missionHide))
  174.     @window_missionShow.set_handler(:ok,      method(:missionHide))
  175.     for i in 0...100
  176.       @r=i
  177.       @t="mission" + i.to_s
  178.       @command_window.set_handler(@t.to_sym, method(:missionShow))
  179.     end
  180.   end
  181.   def scenereturns( t)
  182.     SceneManager.return
  183.   end
  184.   def missionShow( t)
  185.     @window_missionShow.setNumber(t)
  186.     @command_window.deactivate
  187.     @window_missionShow.activate
  188.     @window_missionShow.openness=0
  189.     @window_missionShow.show
  190.     @window_missionShow.open
  191.   end
  192.   def missionHide
  193.     @command_window.activate
  194.     @window_missionShow.deactivate
  195.     @window_missionShow.close
  196.     update until @window_missionShow.close?
  197.     @window_missionShow.hide
  198.   end
  199. end
  200. #encoding:utf-8
  201. module DataManager
  202.   class <<self
  203.     alias make_save_contents_task_zabing make_save_contents
  204.     alias create_game_objects_task_zabing create_game_objects
  205.     alias extract_save_contents_task_zabing extract_save_contents
  206.   end
  207.   def self.create_game_objects
  208.     create_game_objects_task_zabing
  209.     $game_missions = Game_Missions.new
  210.   end
  211.   def make_save_contents
  212.     contents = make_save_contents_task_zabing
  213.     contents[:missions] = $game_missions
  214.     contents
  215.   end
  216.   def self.extract_save_contents(contents)
  217.     extract_save_contents_task_zabing(contents)
  218.     $game_missions = contents[:missions]
  219.   end
  220. end
  221. class Window_MenuCommand < Window_Command
  222.   alias add_original_commands_task_zabing add_original_commands
  223.   def add_original_commands
  224.     add_original_commands_task_zabing
  225.     add_command("任务", :maphint)
  226.   end
  227. end
  228. class Scene_Menu < Scene_MenuBase
  229.   alias create_command_window_task_zabing create_command_window
  230.   def create_command_window
  231.     create_command_window_task_zabing
  232.     @command_window.set_handler(:maphint,   method(:command_maphint))
  233.   end
  234.   def command_maphint
  235.     SceneManager.call(Scene_Mission)
  236.   end
  237. end

减少冲突,优化程序外观,去除奇怪的地图提示功能后的程序。
签名是什么?可以吃么?
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39882
在线时间
7495 小时
注册时间
2009-7-6
帖子
13485

开拓者贵宾

3
发表于 2012-3-8 02:12:45 | 只看该作者
杂兵天下 发表于 2012-3-4 20:51
看了之后,收回刚才说的话,LZ是一个连alias法冲突避免都不知道的可爱的天朝人
class Game_Mission  
  def ...

你也别笑话lz了,alias不考虑reset异常之后的堆栈溢出么?
不然你按几遍f12试试?

点评

F12直接屏蔽掉管它的  发表于 2012-3-8 08:46
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2010-7-10
帖子
111
4
 楼主| 发表于 2012-3-11 19:50:30 | 只看该作者

回复。。。

本帖最后由 zhangchi5 于 2012-3-11 19:52 编辑

你也明白,我只是C++的那个忠实者。。。。。。。。。
作为一个初中生,只能……做啊做,20~30分钟搞定卷子。。。。。。。。。。。。
不过……经过无数调试以及把RMVX的帮助文档和日文RMVA的帮助文档做对比,好不容易搞定了。。。。
很不习惯在一页里写那么多个类。。。

RP大冒险里有一大堆自己干的脚本。。。
这只是其中一个。。。。。。。。。。。


另外,
“减少冲突,优化程序外观,去除奇怪的地图提示功能后的程序。”
地图提示就是说明这个场景啦!!!
比如说,在游戏初始场景里说明游戏操作方式。
游戏场景里说明游戏操作方式。。。
比如说,在旅馆里可以写计价方式,NPC说明等等。

其实我写C++程序时也是乱七八糟的。。。。。。。。。。


‘‘──zhangchi5于2012-3-11 19:53补充以下内容

真的不习惯RUBY那个重写类啊!!!
竟然可以重复定义!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
’’

点评

初中吗?比我强大这么多……初三啊?  发表于 2012-3-17 20:36
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
60 小时
注册时间
2012-2-8
帖子
10
5
发表于 2012-3-14 17:27:04 | 只看该作者
杂兵天下 发表于 2012-3-4 20:51
看了之后,收回刚才说的话,LZ是一个连alias法冲突避免都不知道的可爱的天朝人
class Game_Mission  
  def ...

话说,我用了一下这个脚本,貌似有问题。比如,当我接到的任务有超过1个(至少2个)时,进入任务界面,第一次选择一个任务,说明很正常。但按下ESC关闭任务说明窗口后,不退出任务界面,而是继续选择下一个任务时,之前的文字似乎没有被清除掉,而是重复显示,叠加在一起了。请教一下,是哪个部分的问题?


‘‘──huianda于2012-3-14 21:10补充以下内容

好吧,我不太懂脚本(只有少许VB.net的基础)。在所能理解的语法基础上做了小小调整。
把:
  1. def create_command_window
  2.     @command_window = Window_MissionCommand.new
  3.     @window_missionShow=Window_MissionShow.new(256,0)
  4.     @window_missionShow.hide
  5.     @command_window.set_handler(:returnsc,    method(:scenereturns))
  6.     @command_window.set_handler(:cancel,      method(:scenereturns))
  7.     @window_missionShow.set_handler(:cancel,  method(:missionHide))
  8.     @window_missionShow.set_handler(:ok,      method(:missionHide))
  9.     for i in 0...100
  10.       @r=i
  11.       @t="mission" + i.to_s
  12.       @command_window.set_handler(@t.to_sym, method(:missionShow))
  13.     end
  14.   end
复制代码
里与@window_missionShow有关的生成和句柄的获取,放到后面,变成:
  1. def missionShow(t)
  2.     @window_missionShow=Window_MissionShow.new(256,0)
  3.     @window_missionShow.set_handler(:cancel,  method(:missionHide))
  4.     @window_missionShow.set_handler(:ok,      method(:missionHide))
  5.     @window_missionShow.setNumber(t)
  6.     @command_window.deactivate
  7.     @window_missionShow.activate
  8.     @window_missionShow.openness=0
  9.     @window_missionShow.show
  10.     @window_missionShow.open
  11.   end
复制代码
貌似没有再出现。但不知道这样做是否可行?会不会浪费很多系统资源,或者,造成别的程序逻辑上的问题?
’’


‘‘──huianda于2012-3-15 16:02补充以下内容

多谢哈,找到了。正在研究当中,貌似很不错的。
’’

Miss.jpg (67.22 KB, 下载次数: 4)

文字显示重叠

文字显示重叠

点评

分辨率问题啊  发表于 2012-7-25 09:05
我没仔细研究过此脚本,感觉有更好的脚本。可以去咕狗搜索一下Quest Journal  发表于 2012-3-15 14:26
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2010-7-10
帖子
111
6
 楼主| 发表于 2012-3-17 20:21:08 | 只看该作者
本帖最后由 zhangchi5 于 2012-3-17 20:23 编辑

‘‘──zhangchi5于2012-3-17 20:21补充以下内容

问题已解决~~
请在Window_MissionShow做修改
修改在本帖6楼~~
’’
  1. #==============================================================================
  2. # ■ Window_MissionShow
  3. #------------------------------------------------------------------------------
  4. #  显示任务信息。 By SkyZH
  5. #==============================================================================

  6. class Window_MissionShow < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize(x, y)
  11.     super(x, y, window_width, Graphics.height)
  12.     self.openness = 0
  13.     open
  14.   end
  15.   
  16.   def setNumber(numbers)
  17.     @Mnumber=numbers
  18.     refresh
  19.   end
  20.   
  21.   #--------------------------------------------------------------------------
  22.   # ● 获取窗口的宽度
  23.   #--------------------------------------------------------------------------
  24.   def window_width
  25.     return Graphics.width
  26.   end
  27.   
  28.   def draw_title(text , line, size ,dwhere ,color)
  29.     self.contents.font.color=color
  30.     self.contents.font.size=size
  31.    
  32.     draw_text(4, 0 , window_width-40, fitting_height(line+1), text ,dwhere)
  33.     self.contents.font.color=normal_color
  34.     self.contents.font.size=Font.default_size
  35.   end  
  36.   #--------------------------------------------------------------------------
  37.   # ● 刷新
  38.   #--------------------------------------------------------------------------
  39.   def refresh
  40.     contents.clear
  41.     @texts= $game_missions.mission(@Mnumber).getTitle
  42.     draw_title(@texts,0,48,1,Color.new(255,100,100))
  43.     draw_title("任务介绍",4,22,0,Color.new(100,255,255))
  44.     draw_title($game_missions.mission(@Mnumber).getText,6,18,0,Color.new(255,255,255))
  45.     draw_title("任务奖励/重要信息",9,22,0,Color.new(100,255,255))
  46.     draw_title($game_missions.mission(@Mnumber).getImText,11,18,0,Color.new(255,255,255))
  47.     draw_title("领取任务NPC",14,22,0,Color.new(100,255,255))
  48.     draw_title($game_missions.mission(@Mnumber).getNPC1,16,18,0,Color.new(255,255,255))
  49.     draw_title("交接任务NPC",19,22,0,Color.new(100,255,255))
  50.     draw_title($game_missions.mission(@Mnumber).getNPC2,21,18,0,Color.new(255,255,255))
  51.    
  52.   end
  53.   
  54. end
复制代码
‘‘──zhangchi5于2012-3-17 20:23补充以下内容

因为我设定的两个任务长度一样,木有发现问题。。。

求整合!!!!!!!!!!!!!!!!’’
回复 支持 反对

使用道具 举报

Lv1.梦旅人

苍弩霸主

梦石
0
星屑
159
在线时间
423 小时
注册时间
2012-7-9
帖子
364
7
发表于 2012-7-19 04:57:32 | 只看该作者
zhangchi5 发表于 2012-3-17 20:21
‘‘──zhangchi5于2012-3-17 20:21补充以下内容

问题已解决~~

为什么我接两个任务却只显示一个?


‘‘──千城落水千城梦于2012-7-19 04:57补充以下内容:

[@]zhangchi5[/@]为什么我接两个任务却只显示一个?
’’
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2010-7-10
帖子
111
8
 楼主| 发表于 2012-7-21 17:24:33 | 只看该作者
千城落水千城梦 发表于 2012-7-19 04:57
为什么我接两个任务却只显示一个?

有Sample么。。。我很久不在线的说。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

苍弩霸主

梦石
0
星屑
159
在线时间
423 小时
注册时间
2012-7-9
帖子
364
9
发表于 2012-7-21 18:12:45 | 只看该作者
@zhangchi5你不介意把你QQ给我吧!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
41 小时
注册时间
2010-7-10
帖子
111
10
 楼主| 发表于 2012-10-5 11:53:48 | 只看该作者
千城落水千城梦 发表于 2012-7-21 18:12
@zhangchi5你不介意把你QQ给我吧!

高压力学生族。。。不解释~


‘‘──zhangchi5于2012-10-5 11:54补充以下内容:

有可能你的任务编号一样。。。
’’
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-14 12:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表