Project1

标题: 地图任务(目标)提示要怎么弄? [打印本页]

作者: 無名小子    时间: 2013-1-24 20:52
标题: 地图任务(目标)提示要怎么弄?
本帖最后由 無名小子 于 2013-1-26 18:11 编辑

因为要让玩家知道下一步要做甚么
想在地图上弄个主任务目标提示
如和NPC对话完后
地图左下角显示下一步要做甚么

请问把显示地图名称的脚本修改一下就可以了吗?
作者: j433463    时间: 2013-1-25 09:47
本帖最后由 j433463 于 2013-1-25 10:15 编辑

您是想要怎么做?一直显示还是显示一段时间?改显示地图名的脚本是可以,但那改了就没有显示地图名的功能了,
或是像这样一个脚本:
  1. class Window_MapHelp < Window_Base
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化物件
  4.   #--------------------------------------------------------------------------
  5.   def initialize   
  6.     super(0, 0, window_width, fitting_height(1))
  7.     self.visible = false
  8.    @show_wait = 255 #显示提示驻留时间
  9.     refresh
  10.   end  
  11.   #--------------------------------------------------------------------------
  12.   # ● 取得视窗的宽度
  13.   #--------------------------------------------------------------------------
  14.   def window_width
  15.     300
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 计算视窗内容的宽度
  19.   #--------------------------------------------------------------------------
  20.   def contents_width
  21.     width - standard_padding * 2
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 更新画面
  25.   #--------------------------------------------------------------------------
  26.   def update
  27.     super
  28.     self.visible = true if $game_party.mhstr != "" && !self.visible
  29.     refresh
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 重新整理
  33.   #--------------------------------------------------------------------------
  34.   def refresh
  35.     contents.clear
  36.     if (@show_wait != 0 and $game_party.mhstr != "")
  37.       @show_wait -= 1
  38.     else
  39.       $game_party.task_helpstr("")
  40.       self.visible = false
  41.      @show_wait = 255
  42.     end
  43.     draw_text(0, 0, contents_width, line_height, $game_party.mhstr, 1)
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 开启视窗
  47.   #--------------------------------------------------------------------------
  48.   def open
  49.     refresh
  50.     self
  51.   end
  52. end

  53. class Game_Party < Game_Unit
  54.   attr_reader :mhstr
  55.   alias my_init initialize
  56.   def initialize
  57.     my_init
  58.     @mhstr = ""
  59.   end

  60.   def task_helpstr(string = "")
  61.     @mhstr = string
  62.   end
  63.   
  64. end

  65. class Scene_Map < Scene_Base
  66.   alias this_init initialize
  67.   def initialize
  68.     this_init
  69.     create_maphelp_window
  70.   end
  71.   def create_maphelp_window
  72.     @map_help_window = Window_MapHelp.new
  73.     @map_help_window.x = Graphics.width - @map_help_window.width
  74.     @map_help_window.y = Graphics.height - @map_help_window.height
  75.   end
  76. end
复制代码
在任务 NPC 事件中加一行脚本:
  1. $game_party.task_helpstr("要显示的文字")
复制代码
填上您要显示的提示文字,会显示一段时间后隐藏,这样可以吗?





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