Project1

标题: 要一个小地图和坐标同时显示的脚本 [打印本页]

作者: heronba    时间: 2008-12-18 08:13
主题:《小地图和坐标显示两个脚本怎么同时使用啊》 原帖[LINE]1,#dddddd[/LINE]http://rpg.blue/htm/Topic_3892.htm
用了 显示坐标点的脚本 小地图的脚本就不显示了{/gg}{/gg}{/gg} [LINE]1,#dddddd[/LINE]此贴于 2008-12-20 12:00:01 被版主darkten提醒,请楼主看到后对本贴做出回应。
作者: 诅咒者之魂    时间: 2008-12-19 02:59
re:主题:《小地图和坐标显示两个脚本怎么同时使用啊》 [LINE]1,#dddddd[/LINE]#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================

XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。

#==============================================================================
# ■ Window_XY
#------------------------------------------------------------------------------
#  显示坐标的窗口。
#==============================================================================
class Window_xy < Window_Base#注意前面那个window_xy是文件名
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
   super(0, 0, 160, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
   self.contents = Bitmap.new(width - 32, height - 32)
   self.back_opacity = 255  # 这个是背景透明
   self.opacity = 255       # 这个是边框和背景都透明
   self.contents_opacity = 255       # 这个是内容透明
   self.visible = false
   refresh
   @x = $game_player.x
   @y = $game_player.y
   @id = $game_map.map_id
end

#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
   if $game_switches[XY_SWITCH] #确定开关是否打开,可以自己改变开关
     @x = $game_player.x #获取角色X坐标
     @y = $game_player.y #获取角色Y坐标
     @id = $game_map.map_id  #获取地图编号
    self.contents.clear #清除以前的东西
    $mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
    map_name = $mapnames[@id].name #获得地图名
    self.contents.font.color = normal_color#颜色,这里是白色~
    self.contents.draw_text(0, 0, 116, 32, map_name,2)
    self.contents.font.color = system_color#颜色,暗蓝色
    self.contents.draw_text(0, 32, 120, 32, "X:")#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
    self.contents.font.color = normal_color#颜色,这里是白色~
    self.contents.draw_text(0, 32, 52, 32, @x.to_s,2)
    self.contents.font.color = system_color#上面那个是X坐标的变量,可以自己更改变量名~
    self.contents.draw_text(64, 32, 128, 32, "Y:")#显示Y这个字~
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 32, 116, 32, @y.to_s,2)
   end
end
#--------------------------------------------------------------------------
# ● 判断文字刷新。节约内存用
#--------------------------------------------------------------------------
def judge
   return true if @x != $game_player.x
   return true if @y != $game_player.y
   return true if @id != $game_map.map_id
   return false
end
end
###########################################################################
#                           下面的东西不需要掌握~                         #
###########################################################################

class Scene_Map
alias xy_66rpg_main main
def main
   @xy_window = Window_xy.new
   @xy_window.x = 640 - 160
   @xy_window.y = 480 - 96
   @xy_window.opacity = 0
   xy_66rpg_main
   @xy_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias xy_66rpg_update update
def update
   xy_66rpg_update
   if $game_switches[XY_SWITCH]
     @xy_window.visible = true      
     @xy_window.refresh if @xy_window.judge
   else
     @xy_window.visible = false
   end
end
end
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================
这是我的脚本,有坐标点和地图
作者: heronba    时间: 2008-12-19 08:50
re:主题:《小地图和坐标显示两个脚本怎么同时使用啊》 [LINE]1,#dddddd[/LINE]这个只显示坐标  显示不了小地图啊 {/gg}{/gg}{/gg}
作者: heronba    时间: 2008-12-19 08:52
主题:《用了 显示坐标点的脚本 小地图的脚本就不显示了》 原帖[LINE]1,#dddddd[/LINE]用了 显示坐标点的脚本 小地图的脚本就不显示了


{/se}{/se}{/se}
要一个小地图和坐标同时显示的脚本
作者: heronba    时间: 2008-12-20 03:39
标题: 要一个小地图和坐标同时显示的脚本
要一个小地图和坐标同时显示的脚本
{/se}{/se}{/se}
作者: 纯白的幻想    时间: 2008-12-20 03:42
提示: 作者被禁止或删除 内容自动屏蔽
作者: heronba    时间: 2008-12-20 03:49
{/jy} 这么难啊···没有一个合成的脚本吗??{/dk}{/dk}{/dk}
作者: 诅咒者之魂    时间: 2008-12-20 04:30
re:主题:《小地图和坐标显示两个脚本怎么同时使用啊》 [LINE]1,#dddddd[/LINE]我的可以显示,再不行就可能是你的脚本冲突
作者: zphyp120    时间: 2008-12-20 07:18
re:主题:《小地图和坐标显示两个脚本怎么同时使用啊》 [LINE]1,#dddddd[/LINE]狠掐LZ
XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。
作者: 纯白的幻想    时间: 2008-12-20 16:22
提示: 作者被禁止或删除 内容自动屏蔽
作者: heronba    时间: 2008-12-20 23:23
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #==============================================================================
  5. # ■ 縮小地图的表示(ver 0.999)
  6. # by ピニョン clum-sea
  7. #==============================================================================
  8. #==============================================================================
  9. # □ 前期定义
  10. #==============================================================================
  11. module PLAN_Map_Window
  12.   WIN_X       = 8         # 地图的 X 座標
  13.   WIN_Y       = 8         # 地图的 Y 座標
  14.   WIN_WIDTH   = 8*25      # 地图的宽度
  15.   WIN_HEIGHT  = 6*25      # 地图的高度
  16.   ZOOM        = 6.0       # 地图的放缩比例
  17.   WINDOWSKIN  = ""        # 自定义地图窗口素材,如果留空则是默认的

  18.   ON_OFF_KEY  = Input::A  # 打开地图的按钮,A就是键盘的Z键

  19.   SWITCH      = 100       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
  20.                           # 使用地图功能,关闭则可以使用地图功能

  21.   WINDOW_MOVE = true      # 窗口中的地图跟随移动,(true:跟随, false:固定)
  22.   
  23.   OVER_X      = 632 - WIN_WIDTH   # 移動后的 X 座標(初期位置と往復します)
  24.   OVER_Y      = 8         # 移動后的 Y 座標(初期位置と往復します)

  25.   OPACITY     = 192       # 窗口的透明度
  26.   C_OPACITY   = 192       # 地图的透明度
  27.   VISIBLE     = true      # 最初是否可见
  28. end
  29. #==============================================================================
  30. # ■ Game_Temp
  31. #==============================================================================
  32. class Game_Temp
  33.   attr_accessor  :map_visible     # 地图的表示状態
  34.   alias plan_map_window_initialize initialize
  35.   def initialize
  36.     plan_map_window_initialize
  37.     @map_visible = false
  38.   end
  39. end
  40. #==============================================================================
  41. # ■ Scene_Map
  42. #==============================================================================
  43. class Scene_Map
  44.   #--------------------------------------------------------------------------
  45.   # ● 主处理
  46.   #--------------------------------------------------------------------------
  47.   alias plan_map_window_main main
  48.   def main
  49.     @map_window         = Window_Map.new
  50.     @map_window.visible = $game_temp.map_visible
  51.     plan_map_window_main
  52.     @map_window.dispose
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 更新
  56.   #--------------------------------------------------------------------------
  57.   alias plan_map_window_update update
  58.   def update
  59.     $game_temp.map_visible = @map_window.visible
  60.     plan_map_window_update
  61.     unless $game_switches[PLAN_Map_Window::SWITCH]      
  62.       if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY)
  63.         if @map_window.visible
  64.           @map_window.visible = false
  65.         else
  66.           @map_window.visible = true
  67.         end
  68.       end
  69.     else
  70.       if @map_window.visible
  71.         @map_window.visible = false
  72.       end
  73.     end
  74.     if @map_window.visible
  75.       @map_window.update
  76.     end
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 场所移动的变化
  80.   #--------------------------------------------------------------------------
  81.   alias plan_map_window_transfer_player transfer_player
  82.   def transfer_player
  83.     visible = @map_window.visible
  84.     @map_window.visible = false
  85.     plan_map_window_transfer_player
  86.     @map_window.dispose
  87.     @map_window = Window_Map.new
  88.     @map_window.visible = visible
  89.   end
  90. end
  91. #==============================================================================
  92. # ■ Window_Map
  93. #==============================================================================
  94. class Window_Map < Window_Base
  95.   #--------------------------------------------------------------------------
  96.   # ● 初始化
  97.   #--------------------------------------------------------------------------
  98.   def initialize
  99.     x = PLAN_Map_Window::WIN_X
  100.     y = PLAN_Map_Window::WIN_Y
  101.     w = PLAN_Map_Window::WIN_WIDTH
  102.     h = PLAN_Map_Window::WIN_HEIGHT
  103.     super(x, y, w, h)
  104.     unless PLAN_Map_Window::WINDOWSKIN.empty?
  105.       self.windowskin = RPG::Cache.windowskin(PLAN_Map_Window::WINDOWSKIN)
  106.     end
  107.     self.contents = Bitmap.new(width - 32, height - 32)
  108.     self.opacity = PLAN_Map_Window::OPACITY
  109.     self.contents_opacity = PLAN_Map_Window::C_OPACITY
  110.     @map_data = $game_map.data
  111.     @tileset = RPG::Cache.tileset($game_map.tileset_name)
  112.     @autotiles = []
  113.     for i in 0..6
  114.       autotile_name = $game_map.autotile_names[i]
  115.       @autotiles[i] = RPG::Cache.autotile(autotile_name)
  116.     end
  117.     @old_real_x = $game_player.real_x
  118.     @old_real_y = $game_player.real_y
  119.     @all_map = make_all_map
  120.     self.visible = PLAN_Map_Window::VISIBLE
  121.     refresh
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 缩小图做成
  125.   #--------------------------------------------------------------------------
  126.   def make_all_map
  127.     all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32)
  128.     for y in 0...$game_map.height
  129.       for x in 0...$game_map.width
  130.         for z in 0...3
  131.           tile_num = @map_data[x, y, z]
  132.           next if tile_num == nil
  133.           if tile_num < 384
  134.             if tile_num >= 48
  135.               tile_num -= 48
  136.               src_rect = Rect.new(32, 2 * 32, 32, 32)
  137.               all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect)
  138.             end
  139.           else
  140.             tile_num -= 384
  141.             src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32)
  142.             all_map.blt(x * 32, y * 32, @tileset, src_rect)
  143.           end
  144.         end
  145.       end
  146.     end
  147.     w = ($game_map.width / PLAN_Map_Window::ZOOM) * 32
  148.     h = ($game_map.height / PLAN_Map_Window::ZOOM) * 32
  149.     ret_bitmap = Bitmap.new(w, h)
  150.     src_rect = Rect.new(0, 0, all_map.width, all_map.height)
  151.     dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height)
  152.     ret_bitmap.stretch_blt(dest_rect, all_map, src_rect)
  153.     all_map.dispose
  154.     return ret_bitmap
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ● 刷新
  158.   #--------------------------------------------------------------------------
  159.   def refresh
  160.     self.contents.clear
  161.     one_tile_size = 32 / PLAN_Map_Window::ZOOM
  162.     x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2
  163.     y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2
  164.     x = x * one_tile_size / 128
  165.     y = y * one_tile_size / 128
  166.     half_width = self.contents.width * 128 / 2
  167.     rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size
  168.     rev_x = 0
  169.     if @all_map.width < self.contents.width
  170.       rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
  171.       rev_x -= (self.contents.width - @all_map.width) / 2
  172.       x += rev_x
  173.     elsif half_width > $game_player.real_x * one_tile_size
  174.       rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
  175.       x += rev_x
  176.     elsif half_width > rest_width
  177.       rev_x = -((half_width - rest_width) / 128)
  178.       x += rev_x
  179.     end
  180.     half_height = self.contents.height * 128 / 2
  181.     rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size
  182.     rev_y = 0
  183.     if @all_map.height < self.contents.height
  184.       rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
  185.       rev_y -= (self.contents.height - @all_map.height) / 2
  186.       y += rev_y
  187.     elsif half_height > $game_player.real_y * one_tile_size
  188.       rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
  189.       y += rev_y
  190.     elsif half_height > rest_height
  191.       rev_y = -((half_height - rest_height) / 128)
  192.       y += rev_y
  193.     end
  194.     src_rect = Rect.new(x, y, self.contents.width, self.contents.height)
  195.     self.contents.blt(0, 0, @all_map, src_rect)
  196.     if PLAN_Map_Window::WINDOW_MOVE == true
  197.       w = self.x..self.x + self.width
  198.       h = self.y..self.y + self.height
  199.       if w === $game_player.screen_x and h === $game_player.screen_y
  200.         if self.x == PLAN_Map_Window::WIN_X and self.y == PLAN_Map_Window::WIN_Y
  201.           self.x = PLAN_Map_Window::OVER_X
  202.           self.y = PLAN_Map_Window::OVER_Y
  203.         else
  204.           self.x = PLAN_Map_Window::WIN_X
  205.           self.y = PLAN_Map_Window::WIN_Y
  206.         end
  207.       end
  208.     end
  209.     if $game_party.actors.size > 0
  210.       for i in [2, 1, 0]
  211.         tile = @map_data[$game_player.x, $game_player.y, i]
  212.         next if tile == 0
  213.         return if $game_map.priorities[tile] > 0
  214.       end
  215.       actor = $game_party.actors[0]
  216.       bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  217.       width = bitmap.width / 4
  218.       height = bitmap.height / 4
  219.       src_rect = Rect.new(0, 0, width, height)
  220.       w = width / PLAN_Map_Window::ZOOM
  221.       h = height / PLAN_Map_Window::ZOOM
  222.       x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x
  223.       y = self.contents.height / 2 - h / 2 - rev_y
  224.       dest_rect = Rect.new(x, y, w, h)
  225.       self.contents.stretch_blt(dest_rect, bitmap, src_rect)
  226.     end
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 更新
  230.   #--------------------------------------------------------------------------
  231.   def update
  232.     super
  233.     if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y
  234.       @old_real_x = $game_player.real_x
  235.       @old_real_y = $game_player.real_y
  236.       refresh
  237.     end
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 解放
  241.   #--------------------------------------------------------------------------
  242.   def dispose
  243.     super
  244.     @all_map.dispose
  245.   end
  246. end


  247. #==============================================================================
  248. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  249. #==============================================================================
复制代码
  1. #==========================================================================
  2. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  3. #==========================================================================

  4. XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。

  5. #==============================================================================
  6. # ■ Window_XY
  7. #------------------------------------------------------------------------------
  8. #  显示坐标的窗口。
  9. #==============================================================================
  10. class Window_xy < Window_Base#注意前面那个window_xy是文件名
  11. #--------------------------------------------------------------------------
  12. # ● 初始化窗口
  13. #--------------------------------------------------------------------------
  14. def initialize
  15.    super(0, 0, 160, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
  16.    self.contents = Bitmap.new(width - 32, height - 32)
  17.    self.back_opacity = 255  # 这个是背景透明
  18.    self.opacity = 255       # 这个是边框和背景都透明
  19.    self.contents_opacity = 255       # 这个是内容透明
  20.    self.visible = false
  21.    refresh
  22.    @x = $game_player.x
  23.    @y = $game_player.y
  24.    @id = $game_map.map_id
  25. end

  26. #--------------------------------------------------------------------------
  27. # ● 刷新
  28. #--------------------------------------------------------------------------
  29. def refresh
  30.    if $game_switches=25[XY_SWITCH ] #确定开关是否打开,可以自己改变开关
  31.      @x = $game_player.x #获取角色X坐标
  32.      @y = $game_player.y #获取角色Y坐标
  33.      @id = $game_map.map_id  #获取地图编号
  34.     self.contents.clear #清除以前的东西
  35.     $mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
  36.     map_name = $mapnames[@id].name #获得地图名
  37.     self.contents.font.color = normal_color#颜色,这里是白色~
  38.     self.contents.draw_text(0, 0, 116, 32, map_name,2)
  39.     self.contents.font.color = system_color#颜色,暗蓝色
  40.     self.contents.draw_text(0, 32, 120, 32, "X:")#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
  41.     self.contents.font.color = normal_color#颜色,这里是白色~
  42.     self.contents.draw_text(0, 32, 52, 32, @x.to_s,2)
  43.     self.contents.font.color = system_color#上面那个是X坐标的变量,可以自己更改变量名~
  44.     self.contents.draw_text(64, 32, 128, 32, "Y:")#显示Y这个字~
  45.     self.contents.font.color = normal_color
  46.     self.contents.draw_text(0, 32, 116, 32, @y.to_s,2)
  47.    end
  48. end
  49. #--------------------------------------------------------------------------
  50. # ● 判断文字刷新。节约内存用
  51. #--------------------------------------------------------------------------
  52. def judge
  53.    return true if @x != $game_player.x
  54.    return true if @y != $game_player.y
  55.    return true if @id != $game_map.map_id
  56.    return false
  57. end
  58. end
  59. ###########################################################################
  60. #                           下面的东西不需要掌握~                         #
  61. ###########################################################################

  62. class Scene_Map
  63. alias xy_66rpg_main main
  64. def main
  65.    @xy_window = Window_xy.new
  66.    @xy_window.x = 640 - 160
  67.    @xy_window.y = 480 - 96
  68.    @xy_window.opacity = 0
  69.    xy_66rpg_main
  70.    @xy_window.dispose
  71. end
  72. #--------------------------------------------------------------------------
  73. # ● 刷新画面
  74. #--------------------------------------------------------------------------
  75. alias xy_66rpg_update update
  76. def update
  77.    xy_66rpg_update
  78.    if $game_switches[XY_SWITCH]
  79.      @xy_window.visible = true      
  80.      @xy_window.refresh if @xy_window.judge
  81.    else
  82.      @xy_window.visible = false
  83.    end
  84. end
  85. end
  86. #==========================================================================
  87. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  88. #==========================================================================
复制代码

上面两个脚本第一个是 小地图的   第二个 是显坐标的,  两个脚本放在一起时,只能显示坐标,所以 想要一个即显地图又显坐标的脚本
作者: heronba    时间: 2008-12-20 23:26
re:主题:《小地图和坐标显示两个脚本怎么同时使用啊》 [LINE]1,#dddddd[/LINE]知道啊,两个脚本,冲突,显示地图的脚本无效····只能显示坐标了 啊
以下引用zphyp120于2008-12-19 23:18:28的发言:

狠掐LZ
XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。


作者: 西江月    时间: 2008-12-20 23:56
不会吧,我的可以同时显示啊!
作者: heronba    时间: 2008-12-21 00:42
以下引用西江月于2008-12-20 15:56:35的发言:

不会吧,我的可以同时显示啊!

能把你脚本发来吗??
{/fd}{/fd}{/fd}

作者: heronba    时间: 2008-12-21 00:45
主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 原帖[LINE]1,#dddddd[/LINE]
以下引用heronba于2008-12-20 15:23:26的发言:

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #==============================================================================
  5. # ■ 縮小地图的表示(ver 0.999)
  6. # by ピニョン clum-sea
  7. #==============================================================================
  8. #==============================================================================
  9. # □ 前期定义
  10. #==============================================================================
  11. module PLAN_Map_Window
  12.   WIN_X       = 8         # 地图的 X 座標
  13.   WIN_Y       = 8         # 地图的 Y 座標
  14.   WIN_WIDTH   = 8*25      # 地图的宽度
  15.   WIN_HEIGHT  = 6*25      # 地图的高度
  16.   ZOOM        = 6.0       # 地图的放缩比例
  17.   WINDOWSKIN  = ""        # 自定义地图窗口素材,如果留空则是默认的

  18.   ON_OFF_KEY  = Input::A  # 打开地图的按钮,A就是键盘的Z键

  19.   SWITCH      = 100       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
  20.                           # 使用地图功能,关闭则可以使用地图功能

  21.   WINDOW_MOVE = true      # 窗口中的地图跟随移动,(true:跟随, false:固定)
  22.   
  23.   OVER_X      = 632 - WIN_WIDTH   # 移動后的 X 座標(初期位置と往復します)
  24.   OVER_Y      = 8         # 移動后的 Y 座標(初期位置と往復します)

  25.   OPACITY     = 192       # 窗口的透明度
  26.   C_OPACITY   = 192       # 地图的透明度
  27.   VISIBLE     = true      # 最初是否可见
  28. end
  29. #==============================================================================
  30. # ■ Game_Temp
  31. #==============================================================================
  32. class Game_Temp
  33.   attr_accessor  :map_visible     # 地图的表示状態
  34.   alias plan_map_window_initialize initialize
  35.   def initialize
  36.     plan_map_window_initialize
  37.     @map_visible = false
  38.   end
  39. end
  40. #==============================================================================
  41. # ■ Scene_Map
  42. #==============================================================================
  43. class Scene_Map
  44.   #--------------------------------------------------------------------------
  45.   # ● 主处理
  46.   #--------------------------------------------------------------------------
  47.   alias plan_map_window_main main
  48.   def main
  49.     @map_window         = Window_Map.new
  50.     @map_window.visible = $game_temp.map_visible
  51.     plan_map_window_main
  52.     @map_window.dispose
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 更新
  56.   #--------------------------------------------------------------------------
  57.   alias plan_map_window_update update
  58.   def update
  59.     $game_temp.map_visible = @map_window.visible
  60.     plan_map_window_update
  61.     unless $game_switches[PLAN_Map_Window::SWITCH]      
  62.       if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY)
  63.         if @map_window.visible
  64.           @map_window.visible = false
  65.         else
  66.           @map_window.visible = true
  67.         end
  68.       end
  69.     else
  70.       if @map_window.visible
  71.         @map_window.visible = false
  72.       end
  73.     end
  74.     if @map_window.visible
  75.       @map_window.update
  76.     end
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 场所移动的变化
  80.   #--------------------------------------------------------------------------
  81.   alias plan_map_window_transfer_player transfer_player
  82.   def transfer_player
  83.     visible = @map_window.visible
  84.     @map_window.visible = false
  85.     plan_map_window_transfer_player
  86.     @map_window.dispose
  87.     @map_window = Window_Map.new
  88.     @map_window.visible = visible
  89.   end
  90. end
  91. #==============================================================================
  92. # ■ Window_Map
  93. #==============================================================================
  94. class Window_Map < Window_Base
  95.   #--------------------------------------------------------------------------
  96.   # ● 初始化
  97.   #--------------------------------------------------------------------------
  98.   def initialize
  99.     x = PLAN_Map_Window::WIN_X
  100.     y = PLAN_Map_Window::WIN_Y
  101.     w = PLAN_Map_Window::WIN_WIDTH
  102.     h = PLAN_Map_Window::WIN_HEIGHT
  103.     super(x, y, w, h)
  104.     unless PLAN_Map_Window::WINDOWSKIN.empty?
  105.       self.windowskin = RPG::Cache.windowskin(PLAN_Map_Window::WINDOWSKIN)
  106.     end
  107.     self.contents = Bitmap.new(width - 32, height - 32)
  108.     self.opacity = PLAN_Map_Window::OPACITY
  109.     self.contents_opacity = PLAN_Map_Window::C_OPACITY
  110.     @map_data = $game_map.data
  111.     @tileset = RPG::Cache.tileset($game_map.tileset_name)
  112.     @autotiles = []
  113.     for i in 0..6
  114.       autotile_name = $game_map.autotile_names[i]
  115.       @autotiles[i] = RPG::Cache.autotile(autotile_name)
  116.     end
  117.     @old_real_x = $game_player.real_x
  118.     @old_real_y = $game_player.real_y
  119.     @all_map = make_all_map
  120.     self.visible = PLAN_Map_Window::VISIBLE
  121.     refresh
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 缩小图做成
  125.   #--------------------------------------------------------------------------
  126.   def make_all_map
  127.     all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32)
  128.     for y in 0...$game_map.height
  129.       for x in 0...$game_map.width
  130.         for z in 0...3
  131.           tile_num = @map_data[x, y, z]
  132.           next if tile_num == nil
  133.           if tile_num < 384
  134.             if tile_num >= 48
  135.               tile_num -= 48
  136.               src_rect = Rect.new(32, 2 * 32, 32, 32)
  137.               all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect)
  138.             end
  139.           else
  140.             tile_num -= 384
  141.             src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32)
  142.             all_map.blt(x * 32, y * 32, @tileset, src_rect)
  143.           end
  144.         end
  145.       end
  146.     end
  147.     w = ($game_map.width / PLAN_Map_Window::ZOOM) * 32
  148.     h = ($game_map.height / PLAN_Map_Window::ZOOM) * 32
  149.     ret_bitmap = Bitmap.new(w, h)
  150.     src_rect = Rect.new(0, 0, all_map.width, all_map.height)
  151.     dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height)
  152.     ret_bitmap.stretch_blt(dest_rect, all_map, src_rect)
  153.     all_map.dispose
  154.     return ret_bitmap
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ● 刷新
  158.   #--------------------------------------------------------------------------
  159.   def refresh
  160.     self.contents.clear
  161.     one_tile_size = 32 / PLAN_Map_Window::ZOOM
  162.     x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2
  163.     y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2
  164.     x = x * one_tile_size / 128
  165.     y = y * one_tile_size / 128
  166.     half_width = self.contents.width * 128 / 2
  167.     rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size
  168.     rev_x = 0
  169.     if @all_map.width < self.contents.width
  170.       rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
  171.       rev_x -= (self.contents.width - @all_map.width) / 2
  172.       x += rev_x
  173.     elsif half_width > $game_player.real_x * one_tile_size
  174.       rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
  175.       x += rev_x
  176.     elsif half_width > rest_width
  177.       rev_x = -((half_width - rest_width) / 128)
  178.       x += rev_x
  179.     end
  180.     half_height = self.contents.height * 128 / 2
  181.     rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size
  182.     rev_y = 0
  183.     if @all_map.height < self.contents.height
  184.       rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
  185.       rev_y -= (self.contents.height - @all_map.height) / 2
  186.       y += rev_y
  187.     elsif half_height > $game_player.real_y * one_tile_size
  188.       rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
  189.       y += rev_y
  190.     elsif half_height > rest_height
  191.       rev_y = -((half_height - rest_height) / 128)
  192.       y += rev_y
  193.     end
  194.     src_rect = Rect.new(x, y, self.contents.width, self.contents.height)
  195.     self.contents.blt(0, 0, @all_map, src_rect)
  196.     if PLAN_Map_Window::WINDOW_MOVE == true
  197.       w = self.x..self.x + self.width
  198.       h = self.y..self.y + self.height
  199.       if w === $game_player.screen_x and h === $game_player.screen_y
  200.         if self.x == PLAN_Map_Window::WIN_X and self.y == PLAN_Map_Window::WIN_Y
  201.           self.x = PLAN_Map_Window::OVER_X
  202.           self.y = PLAN_Map_Window::OVER_Y
  203.         else
  204.           self.x = PLAN_Map_Window::WIN_X
  205.           self.y = PLAN_Map_Window::WIN_Y
  206.         end
  207.       end
  208.     end
  209.     if $game_party.actors.size > 0
  210.       for i in [2, 1, 0]
  211.         tile = @map_data[$game_player.x, $game_player.y, i]
  212.         next if tile == 0
  213.         return if $game_map.priorities[tile] > 0
  214.       end
  215.       actor = $game_party.actors[0]
  216.       bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  217.       width = bitmap.width / 4
  218.       height = bitmap.height / 4
  219.       src_rect = Rect.new(0, 0, width, height)
  220.       w = width / PLAN_Map_Window::ZOOM
  221.       h = height / PLAN_Map_Window::ZOOM
  222.       x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x
  223.       y = self.contents.height / 2 - h / 2 - rev_y
  224.       dest_rect = Rect.new(x, y, w, h)
  225.       self.contents.stretch_blt(dest_rect, bitmap, src_rect)
  226.     end
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 更新
  230.   #--------------------------------------------------------------------------
  231.   def update
  232.     super
  233.     if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y
  234.       @old_real_x = $game_player.real_x
  235.       @old_real_y = $game_player.real_y
  236.       refresh
  237.     end
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 解放
  241.   #--------------------------------------------------------------------------
  242.   def dispose
  243.     super
  244.     @all_map.dispose
  245.   end
  246. end


  247. #==============================================================================
  248. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  249. #==============================================================================

复制代码
  1. #==========================================================================
  2. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  3. #==========================================================================

  4. XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。

  5. #==============================================================================
  6. # ■ Window_XY
  7. #------------------------------------------------------------------------------
  8. #  显示坐标的窗口。
  9. #==============================================================================
  10. class Window_xy < Window_Base#注意前面那个window_xy是文件名
  11. #--------------------------------------------------------------------------
  12. # ● 初始化窗口
  13. #--------------------------------------------------------------------------
  14. def initialize
  15.    super(0, 0, 160, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
  16.    self.contents = Bitmap.new(width - 32, height - 32)
  17.    self.back_opacity = 255  # 这个是背景透明
  18.    self.opacity = 255       # 这个是边框和背景都透明
  19.    self.contents_opacity = 255       # 这个是内容透明
  20.    self.visible = false
  21.    refresh
  22.    @x = $game_player.x
  23.    @y = $game_player.y
  24.    @id = $game_map.map_id
  25. end

  26. #--------------------------------------------------------------------------
  27. # ● 刷新
  28. #--------------------------------------------------------------------------
  29. def refresh
  30.    if $game_switches=25[XY_SWITCH ] #确定开关是否打开,可以自己改变开关
  31.      @x = $game_player.x #获取角色X坐标
  32.      @y = $game_player.y #获取角色Y坐标
  33.      @id = $game_map.map_id  #获取地图编号
  34.     self.contents.clear #清除以前的东西
  35.     $mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
  36.     map_name = $mapnames[@id].name #获得地图名
  37.     self.contents.font.color = normal_color#颜色,这里是白色~
  38.     self.contents.draw_text(0, 0, 116, 32, map_name,2)
  39.     self.contents.font.color = system_color#颜色,暗蓝色
  40.     self.contents.draw_text(0, 32, 120, 32, "X:")#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
  41.     self.contents.font.color = normal_color#颜色,这里是白色~
  42.     self.contents.draw_text(0, 32, 52, 32, @x.to_s,2)
  43.     self.contents.font.color = system_color#上面那个是X坐标的变量,可以自己更改变量名~
  44.     self.contents.draw_text(64, 32, 128, 32, "Y:")#显示Y这个字~
  45.     self.contents.font.color = normal_color
  46.     self.contents.draw_text(0, 32, 116, 32, @y.to_s,2)
  47.    end
  48. end
  49. #--------------------------------------------------------------------------
  50. # ● 判断文字刷新。节约内存用
  51. #--------------------------------------------------------------------------
  52. def judge
  53.    return true if @x != $game_player.x
  54.    return true if @y != $game_player.y
  55.    return true if @id != $game_map.map_id
  56.    return false
  57. end
  58. end
  59. ###########################################################################
  60. #                           下面的东西不需要掌握~                         #
  61. ###########################################################################

  62. class Scene_Map
  63. alias xy_66rpg_main main
  64. def main
  65.    @xy_window = Window_xy.new
  66.    @xy_window.x = 640 - 160
  67.    @xy_window.y = 480 - 96
  68.    @xy_window.opacity = 0
  69.    xy_66rpg_main
  70.    @xy_window.dispose
  71. end
  72. #--------------------------------------------------------------------------
  73. # ● 刷新画面
  74. #--------------------------------------------------------------------------
  75. alias xy_66rpg_update update
  76. def update
  77.    xy_66rpg_update
  78.    if $game_switches[XY_SWITCH]
  79.      @xy_window.visible = true      
  80.      @xy_window.refresh if @xy_window.judge
  81.    else
  82.      @xy_window.visible = false
  83.    end
  84. end
  85. end
  86. #==========================================================================
  87. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  88. #==========================================================================

复制代码

上面两个脚本第一个是 小地图的   第二个 是显坐标的,  两个脚本放在一起时,只能显示坐标,所以 想要一个即显地图又显坐标的脚本

为什么显小地图的脚本和显坐标的脚本不能同时起作用,只要发在一起,就只能坐标的脚本起作用???{/fn}{/fn}{/fn}
作者: 塑望    时间: 2008-12-21 02:23
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]SWITCH      = 100       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
                         # 使用地图功能,关闭则可以使用地图功能

[LINE]1[/LINE]
XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。
[LINE]1[/LINE]
我想说的是这两个脚本并不存在冲突...也不需要整合...

<柯南-头脑风暴>就有用到该2个脚本
作者: 西江月    时间: 2008-12-21 04:10
就是用4L的脚本啊
作者: heronba    时间: 2008-12-21 04:10
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]
以下引用塑望于2008-12-20 18:23:05的发言:

SWITCH      = 100       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
                        # 使用地图功能,关闭则可以使用地图功能




XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。
我把两个脚本放在一起就能显示坐标啊,不显示小图?


我想说的是这两个脚本并不存在冲突...也不需要整合...

<柯南-头脑风暴>就有用到该2个脚本


作者: heronba    时间: 2008-12-21 07:59
四楼的脚本,只能显示坐标,显示不了小地图啊
以下引用西江月于2008-12-20 20:10:25的发言:

就是用4L的脚本啊


作者: 飛影    时间: 2008-12-21 10:35
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]放在一起。100的 開關是默認關閉才會顯示,所以你只要打開  25 號開關就可以
作者: heronba    时间: 2008-12-21 15:40
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]
以下引用飛影于2008-12-21 2:35:12的发言:

放在一起。100的 開關是默認關閉才會顯示,所以你只要打開  25 號開關就可以

我试了,只要两个脚本放在一起,显示小地图的脚本就不能发挥作用
作者: hgfor    时间: 2008-12-21 17:02
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]
   试试这个小地图

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================



  4. #冬夜更新说明
  5. #更改了小地图的位置,Q是开启小地图跟随开关
  6. #S是固定小地图位置

  7. #更新了场所移动时地图的不同步,更新了战斗后的地图不同步
  8. #小地图默认成为FLASE,只在第一次登入时是,以后跟随开关的指示
  9. #恩恩  
  10. #最后更新,测试过


  11. #修正了由于小地图变化引起的不能转换问题,修休整了房间内的地图原先的那个羁押功能




  12. #==============================================================================
  13. # ■ 縮小地图的表示(ver 0.999)
  14. # by ピニョン clum-sea
  15. #==============================================================================
  16. #==============================================================================
  17. # □ 前期定义
  18. #==============================================================================
  19. module PLAN_Map_Window
  20.   WIN_X       = 0         # 地图的 X 座標
  21.   WIN_Y       = 0         # 地图的 Y 座標
  22.   WIN_WIDTH   = 250     # 地图的宽度
  23.   WIN_HEIGHT  = 200     # 地图的高度
  24.   ZOOM        = 3.5     # 地图的放缩比例
  25.   WINDOWSKIN  = ""        # 自定义地图窗口素材,如果留空则是默认的

  26.   ON_OFF_KEY  = Input::L  # 打开地图的按钮,L就是键盘的Q键

  27.   SWITCH      = 1       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
  28.                           # 使用地图功能,关闭则可以使用地图功能
  29.                           
  30.   WINDOW_MOVE = true   # 窗口中的地图跟随移动,(true:跟随, false:固定)
  31.   
  32.   OVER_X      = 632 - WIN_WIDTH   # 移動后的 X 座標(初期位置と往復します)
  33.   OVER_Y      = 0         # 移動后的 Y 座標(初期位置と往復します)

  34.   OPACITY     = 255  # 窗口的透明度
  35.   C_OPACITY   = 255   # 地图的透明度
  36.   
  37.   VISIBLE     = false      # 最初是否可见
  38.   SWITCH_KEY  = Input::L  # Q键锁定/解锁小地图
  39. end
  40. #==============================================================================
  41. # ■ Game_Temp
  42. #==============================================================================
  43. class Game_Temp
  44.   attr_accessor  :map_visible     # 地图的表示状態
  45. end
  46. #==============================================================================
  47. # ■ Scene_Map
  48. #==============================================================================
  49. class Scene_Map
  50.   #--------------------------------------------------------------------------
  51.   # ● 主处理
  52.   #--------------------------------------------------------------------------
  53.   alias plan_map_window_main main
  54.   def main
  55.   $小地图 = false
  56.   @map_window         = Window_Map.new
  57.     @map_window.visible = $game_switches[406]
  58.     plan_map_window_main
  59.     @map_window.dispose
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 更新
  63.   #--------------------------------------------------------------------------
  64.   alias plan_map_window_update update
  65.   def update
  66.     $game_temp.map_visible = @map_window.visible
  67.     plan_map_window_update
  68.     if $game_switches[PLAN_Map_Window::SWITCH]      
  69.       if @map_window.visible
  70.       @map_window.visible = false
  71.       $game_switches[406] = false
  72.       $game_switches[405] = false
  73.       $game_variables[19] = $direction
  74.       $地图关闭 = true
  75.       end  
  76.     else
  77.       if $地图关闭         
  78.          @map_window.visible = true
  79.          $game_switches[406] = true
  80.          $地图关闭 = false
  81.       end
  82.     if !$game_temp.in_battle
  83.       if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY)
  84.         if @map_window.visible
  85.           $game_system.se_play($data_system.cancel_se)
  86.           @map_window.visible = false
  87.           $game_switches[406] = false
  88.           $game_switches[405] = false
  89.           $game_variables[19] = $direction
  90.         else
  91.           $game_system.se_play($data_system.decision_se)
  92.           @map_window.visible = true
  93.           $game_switches[406] = true
  94.         end
  95.       end
  96.       if Input.trigger?(PLAN_Map_Window::SWITCH_KEY)
  97.         if @map_window.visible
  98.         if $game_switches[405]
  99.           $game_system.se_play($data_system.cancel_se)
  100.           $game_switches[405] = false
  101.           $game_variables[19] = $direction
  102.          else
  103.           $game_system.se_play($data_system.decision_se)
  104.           $game_switches[405] = true
  105.          end
  106.        end
  107.      end
  108.    end
  109.     end
  110.     if @map_window.visible
  111.       @map_window.update
  112.     end
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 场所移动的变化
  116.   #--------------------------------------------------------------------------
  117.   alias plan_map_window_transfer_player transfer_player
  118.   def transfer_player
  119. #   visible = @map_window.visible
  120.     @map_window.visible = false
  121.     plan_map_window_transfer_player
  122.     @map_window.dispose
  123.     @map_window = Window_Map.new
  124.   end
  125. end
  126. #==============================================================================
  127. # ■ Window_Map
  128. #==============================================================================
  129. class Window_Map < Window_Base
  130.   #--------------------------------------------------------------------------
  131.   # ● 初始化
  132.   #--------------------------------------------------------------------------
  133.   def initialize
  134.    $direction = $game_variables[19]
  135.    if $win_x != nil
  136.       x = $win_x
  137.       y = $win_y
  138.    else
  139.    case $direction
  140.      when 0
  141.      x = 0
  142.      y = 0
  143.      $win_x = x
  144.      $win_y = y
  145.      when 1
  146.      x = 382
  147.      y = 8
  148.      $win_x = x
  149.      $win_y = y
  150.      when 2
  151.      x = 8
  152.      y = 280 - 8
  153.      $win_x = x
  154.      $win_y = y
  155.      when 3
  156.      x = 382
  157.      y = 280 - 8
  158.      $win_x = x
  159.      $win_y = y
  160.      end
  161.    end
  162.     w = PLAN_Map_Window::WIN_WIDTH
  163.     h = PLAN_Map_Window::WIN_HEIGHT
  164.   $小地图 = true
  165.    super(x, y, w, h)
  166.   $小地图 = false
  167. #   @windowskin_name = $game_system.windowskin_name
  168. #   self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  169.     self.contents = Bitmap.new(width - 32, height - 32)
  170.     self.opacity = PLAN_Map_Window::OPACITY
  171.     self.contents_opacity = PLAN_Map_Window::C_OPACITY
  172.     @map_data = $game_map.data
  173.     @tileset = RPG::Cache.tileset($game_map.tileset_name)
  174.     @autotiles = []
  175.     for i in 0..6
  176.       autotile_name = $game_map.autotile_names[i]
  177.       @autotiles[i] = RPG::Cache.autotile(autotile_name)
  178.     end
  179.     @old_real_x = $game_player.real_x
  180.     @old_real_y = $game_player.real_y
  181.   if $game_map.width > 70 or $game_map.height > 70
  182.       $ZOOM = 2 * PLAN_Map_Window::ZOOM
  183.   else
  184.    
  185.      if $game_map.width < 40 or $game_map.height < 40
  186.       $ZOOM = PLAN_Map_Window::ZOOM / 2
  187.     else
  188.       $ZOOM = PLAN_Map_Window::ZOOM
  189.       end
  190.   end
  191.     @all_map = make_all_map
  192.     self.visible = $game_switches[406]
  193.      unless PLAN_Map_Window::WINDOWSKIN.empty?
  194.       self.windowskin = RPG::Cache.windowskin("")
  195.     end
  196.    # PLAN_Map_Window::WINDOWSKIN
  197.    # self.visible = PLAN_Map_Window::VISIBLE
  198.     refresh
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 缩小图做成
  202.   #--------------------------------------------------------------------------
  203.   def make_all_map
  204.     all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32)
  205.     for y in 0...$game_map.height
  206.       for x in 0...$game_map.width
  207.         for z in 0...3
  208.           tile_num = @map_data[x, y, z]
  209.           next if tile_num == nil
  210.           if tile_num < 384
  211.             if tile_num >= 48
  212.               tile_num -= 48
  213.               src_rect = Rect.new(32, 2 * 32, 32, 32)
  214.               all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect)
  215.             end
  216.           else
  217.             tile_num -= 384
  218.             src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32)
  219.             all_map.blt(x * 32, y * 32, @tileset, src_rect)
  220.           end
  221.         end
  222.       end
  223.     end
  224.     w = ($game_map.width / $ZOOM) * 32
  225.     h = ($game_map.height / $ZOOM) * 32
  226.     ret_bitmap = Bitmap.new(w, h)
  227.     src_rect = Rect.new(0, 0, all_map.width, all_map.height)
  228.     dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height)
  229.     ret_bitmap.stretch_blt(dest_rect, all_map, src_rect)
  230.     all_map.dispose
  231.     return ret_bitmap
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● 刷新
  235.   #--------------------------------------------------------------------------
  236.   def refresh
  237.     self.contents.clear

  238.     self.x = $win_x
  239.     self.y = $win_y
  240.     self.z = 9999  # 让窗口在最上层
  241.   @small_map = false
  242.   if $game_map.width < 80 or $game_map.height < 80
  243.     #这个是当地图大小宽和高小于指定大小时才改变大小,限制小地图窗口大小
  244.     if $game_map.width < 40 or $game_map.height < 40
  245.       #这同时限制了变换小地图的大小,防止关卡和队长办公室因为地图宽长无法切换
  246.       self.width = [@all_map.width,200].min
  247.       self.height = [@all_map.height,200].min
  248.       self.contents = Bitmap.new(width-32, height-32)
  249.      #让改变的小地图X坐标紧贴边缘
  250.     if self.x + self.width > 250
  251.       self.x = 625 - self.width
  252.     end
  253.       #让改变的小地图Y左边紧贴边缘
  254.     if self.y + self.height > 380
  255.       self.y = 470 - self.height
  256.     end
  257.      @small_map = true
  258.   end
  259. end
  260.    if self.windowskin == nil
  261.    @windowskin_name = $game_system.windowskin_name
  262.    self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  263.    end
  264.     one_tile_size = 32 / $ZOOM
  265.     x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2
  266.     y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2
  267.     x = x * one_tile_size / 128
  268.     y = y * one_tile_size / 128
  269.     half_width = self.contents.width * 128 / 2
  270.     rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size
  271.     rev_x = 0
  272.     if @all_map.width < self.contents.width
  273.       rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
  274.       rev_x -= (self.contents.width - @all_map.width) / 2
  275.       x += rev_x
  276.     elsif half_width > $game_player.real_x * one_tile_size
  277.       rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
  278.       x += rev_x
  279.     elsif half_width > rest_width
  280.       rev_x = -((half_width - rest_width) / 128)
  281.       x += rev_x
  282.     end
  283.     half_height = self.contents.height * 128 / 2
  284.     rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size
  285.     rev_y = 0
  286.     if @all_map.height < self.contents.height
  287.       rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
  288.       rev_y -= (self.contents.height - @all_map.height) / 2
  289.       y += rev_y
  290.     elsif half_height > $game_player.real_y * one_tile_size
  291.       rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
  292.       y += rev_y
  293.     elsif half_height > rest_height
  294.       rev_y = -((half_height - rest_height) / 128)
  295.       y += rev_y
  296.     end
  297.     src_rect = Rect.new(x, y, self.contents.width, self.contents.height)
  298.     self.contents.blt(0, 0, @all_map, src_rect)
  299.      if PLAN_Map_Window::WINDOW_MOVE == true
  300.       w = self.x - 32 .. self.x + self.width + 32
  301.       h = self.y - 64 .. self.y + self.height + 64
  302.       if w === $game_player.screen_x and h === $game_player.screen_y
  303.      if !@small_map
  304.      case self.x
  305.       when 8
  306.          self.x = 382
  307.       when 382
  308.         self.x = 8
  309.       end
  310.      case self.y
  311.     when 272
  312.       self.y = 8
  313.     when 8
  314.       self.y = 272
  315.     end
  316.   else
  317.     case self.x
  318.     when  625 - self.width
  319.       self.x = 8
  320.     when 8
  321.       self.x = 625 - self.width
  322.     end
  323.     case self.y
  324.     when 470 - self.height
  325.       self.y = 8
  326.     when 8
  327.       self.y = 470 - self.height
  328.     end
  329.     end
  330. end
  331. end
  332.      #主角位置
  333.     if $game_party.actors.size > 0
  334. #      for i in [2, 1, 0]
  335. #      tile = @map_data[$game_player.x, $game_player.y, i]
  336. #        next if tile == 0
  337. #        return if $game_map.priorities[tile] > 0
  338. #      end
  339.       actor = $game_party.actors[0]
  340.       bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  341.       width = bitmap.width/ 4
  342.       height = bitmap.height / 4
  343.       sy = ($game_player.direction - 2) / 2 * height
  344.       #原始行走图大小矩形
  345.       src_rect = Rect.new(0, sy, width, height)
  346.       if $ZOOM > 7
  347.       w = width / 5
  348.       h = height / 5
  349.       else  
  350.       w = width / $ZOOM
  351.       h = height / $ZOOM
  352.       end
  353.       x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x
  354.       y = self.contents.height / 2 - h / 2 - rev_y
  355.       #小地图上的行走图大小
  356.       dest_rect = Rect.new(x, y, w, h)
  357.       self.contents.stretch_blt(dest_rect, bitmap, src_rect)
  358.     end
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # ● 更新
  362.   #--------------------------------------------------------------------------
  363.   def update
  364.     super
  365.     if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y
  366.       @old_real_x = $game_player.real_x
  367.       @old_real_y = $game_player.real_y
  368.       refresh
  369.     end
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● 解放
  373.   #--------------------------------------------------------------------------
  374.   def dispose
  375.     super
  376.     @all_map.dispose
  377.   end
  378. end
  379. #==============================================================================
  380. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  381. #==============================================================================
复制代码

作者: heronba    时间: 2008-12-21 17:35
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]
以下引用hgfor于2008-12-21 9:02:36的发言:


  试试这个小地图

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

不是没有小地图,是两个脚本放在一起小地图就不显示了

#冬夜更新说明
#更改了小地图的位置,Q是开启小地图跟随开关
#S是固定小地图位置

#更新了场所移动时地图的不同步,更新了战斗后的地图不同步
#小地图默认成为FLASE,只在第一次登入时是,以后跟随开关的指示
#恩恩  
#最后更新,测试过


#修正了由于小地图变化引起的不能转换问题,修休整了房间内的地图原先的那个羁押功能




#==============================================================================
# ■ 縮小地图的表示(ver 0.999)
# by ピニョン clum-sea
#==============================================================================
#==============================================================================
# □ 前期定义
#==============================================================================
module PLAN_Map_Window
  WIN_X       = 0         # 地图的 X 座標
  WIN_Y       = 0         # 地图的 Y 座標
  WIN_WIDTH   = 250     # 地图的宽度
  WIN_HEIGHT  = 200     # 地图的高度
  ZOOM        = 3.5     # 地图的放缩比例
  WINDOWSKIN  = ""        # 自定义地图窗口素材,如果留空则是默认的

  ON_OFF_KEY  = Input::L  # 打开地图的按钮,L就是键盘的Q键

  SWITCH      = 1       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
                          # 使用地图功能,关闭则可以使用地图功能
                          
  WINDOW_MOVE = true   # 窗口中的地图跟随移动,(true:跟随, false:固定)
  
  OVER_X      = 632 - WIN_WIDTH   # 移動后的 X 座標(初期位置と往復します)
  OVER_Y      = 0         # 移動后的 Y 座標(初期位置と往復します)

  OPACITY     = 255  # 窗口的透明度
  C_OPACITY   = 255   # 地图的透明度
  
  VISIBLE     = false      # 最初是否可见
  SWITCH_KEY  = Input::L  # Q键锁定/解锁小地图
end
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
  attr_accessor  :map_visible     # 地图的表示状態
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  alias plan_map_window_main main
  def main
  $小地图 = false
  @map_window         = Window_Map.new
    @map_window.visible = $game_switches[406]
    plan_map_window_main
    @map_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 更新
  #--------------------------------------------------------------------------
  alias plan_map_window_update update
  def update
    $game_temp.map_visible = @map_window.visible
    plan_map_window_update
    if $game_switches[PLAN_Map_Window::SWITCH]      
      if @map_window.visible
      @map_window.visible = false
      $game_switches[406] = false
      $game_switches[405] = false
      $game_variables[19] = $direction
      $地图关闭 = true
      end  
    else
      if $地图关闭         
         @map_window.visible = true
         $game_switches[406] = true
         $地图关闭 = false
      end
    if !$game_temp.in_battle
      if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY)
        if @map_window.visible
          $game_system.se_play($data_system.cancel_se)
          @map_window.visible = false
          $game_switches[406] = false
          $game_switches[405] = false
          $game_variables[19] = $direction
        else
          $game_system.se_play($data_system.decision_se)
          @map_window.visible = true
          $game_switches[406] = true
        end
      end
      if Input.trigger?(PLAN_Map_Window::SWITCH_KEY)
        if @map_window.visible
        if $game_switches[405]
          $game_system.se_play($data_system.cancel_se)
          $game_switches[405] = false
          $game_variables[19] = $direction
         else
          $game_system.se_play($data_system.decision_se)
          $game_switches[405] = true
         end
       end
     end
   end
    end
    if @map_window.visible
      @map_window.update
    end
  end
  #--------------------------------------------------------------------------
  # ● 场所移动的变化
  #--------------------------------------------------------------------------
  alias plan_map_window_transfer_player transfer_player
  def transfer_player
#   visible = @map_window.visible
    @map_window.visible = false
    plan_map_window_transfer_player
    @map_window.dispose
    @map_window = Window_Map.new
  end
end
#==============================================================================
# ■ Window_Map
#==============================================================================
class Window_Map < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化
  #--------------------------------------------------------------------------
  def initialize
   $direction = $game_variables[19]
   if $win_x != nil
      x = $win_x
      y = $win_y
   else
   case $direction
     when 0
     x = 0
     y = 0
     $win_x = x
     $win_y = y
     when 1
     x = 382
     y = 8
     $win_x = x
     $win_y = y
     when 2
     x = 8
     y = 280 - 8
     $win_x = x
     $win_y = y
     when 3
     x = 382
     y = 280 - 8
     $win_x = x
     $win_y = y
     end
   end
    w = PLAN_Map_Window::WIN_WIDTH
    h = PLAN_Map_Window::WIN_HEIGHT
  $小地图 = true
   super(x, y, w, h)
  $小地图 = false
#   @windowskin_name = $game_system.windowskin_name
#   self.windowskin = RPG::Cache.windowskin(@windowskin_name)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = PLAN_Map_Window::OPACITY
    self.contents_opacity = PLAN_Map_Window::C_OPACITY
    @map_data = $game_map.data
    @tileset = RPG::Cache.tileset($game_map.tileset_name)
    @autotiles = []
    for i in 0..6
      autotile_name = $game_map.autotile_names
      @autotiles = RPG::Cache.autotile(autotile_name)
    end
    @old_real_x = $game_player.real_x
    @old_real_y = $game_player.real_y
  if $game_map.width > 70 or $game_map.height > 70
      $ZOOM = 2 * PLAN_Map_Window::ZOOM
  else
   
     if $game_map.width < 40 or $game_map.height < 40
      $ZOOM = PLAN_Map_Window::ZOOM / 2
    else
      $ZOOM = PLAN_Map_Window::ZOOM
      end
  end
    @all_map = make_all_map
    self.visible = $game_switches[406]
     unless PLAN_Map_Window::WINDOWSKIN.empty?
      self.windowskin = RPG::Cache.windowskin("")
    end
   # PLAN_Map_Window::WINDOWSKIN
   # self.visible = PLAN_Map_Window::VISIBLE
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 缩小图做成
  #--------------------------------------------------------------------------
  def make_all_map
    all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32)
    for y in 0...$game_map.height
      for x in 0...$game_map.width
        for z in 0...3
          tile_num = @map_data[x, y, z]
          next if tile_num == nil
          if tile_num < 384
            if tile_num >= 48
              tile_num -= 48
              src_rect = Rect.new(32, 2 * 32, 32, 32)
              all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect)
            end
          else
            tile_num -= 384
            src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32)
            all_map.blt(x * 32, y * 32, @tileset, src_rect)
          end
        end
      end
    end
    w = ($game_map.width / $ZOOM) * 32
    h = ($game_map.height / $ZOOM) * 32
    ret_bitmap = Bitmap.new(w, h)
    src_rect = Rect.new(0, 0, all_map.width, all_map.height)
    dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height)
    ret_bitmap.stretch_blt(dest_rect, all_map, src_rect)
    all_map.dispose
    return ret_bitmap
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear

    self.x = $win_x
    self.y = $win_y
    self.z = 9999  # 让窗口在最上层
  @small_map = false
  if $game_map.width < 80 or $game_map.height < 80
    #这个是当地图大小宽和高小于指定大小时才改变大小,限制小地图窗口大小
    if $game_map.width < 40 or $game_map.height < 40
      #这同时限制了变换小地图的大小,防止关卡和队长办公室因为地图宽长无法切换
      self.width = [@all_map.width,200].min
      self.height = [@all_map.height,200].min
      self.contents = Bitmap.new(width-32, height-32)
     #让改变的小地图X坐标紧贴边缘
    if self.x + self.width > 250
      self.x = 625 - self.width
    end
      #让改变的小地图Y左边紧贴边缘
    if self.y + self.height > 380
      self.y = 470 - self.height
    end
     @small_map = true
  end
end
   if self.windowskin == nil
   @windowskin_name = $game_system.windowskin_name
   self.windowskin = RPG::Cache.windowskin(@windowskin_name)
   end
    one_tile_size = 32 / $ZOOM
    x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2
    y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2
    x = x * one_tile_size / 128
    y = y * one_tile_size / 128
    half_width = self.contents.width * 128 / 2
    rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size
    rev_x = 0
    if @all_map.width < self.contents.width
      rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
      rev_x -= (self.contents.width - @all_map.width) / 2
      x += rev_x
    elsif half_width > $game_player.real_x * one_tile_size
      rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
      x += rev_x
    elsif half_width > rest_width
      rev_x = -((half_width - rest_width) / 128)
      x += rev_x
    end
    half_height = self.contents.height * 128 / 2
    rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size
    rev_y = 0
    if @all_map.height < self.contents.height
      rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
      rev_y -= (self.contents.height - @all_map.height) / 2
      y += rev_y
    elsif half_height > $game_player.real_y * one_tile_size
      rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
      y += rev_y
    elsif half_height > rest_height
      rev_y = -((half_height - rest_height) / 128)
      y += rev_y
    end
    src_rect = Rect.new(x, y, self.contents.width, self.contents.height)
    self.contents.blt(0, 0, @all_map, src_rect)
     if PLAN_Map_Window::WINDOW_MOVE == true
      w = self.x - 32 .. self.x + self.width + 32
      h = self.y - 64 .. self.y + self.height + 64
      if w === $game_player.screen_x and h === $game_player.screen_y
     if !@small_map
     case self.x
      when 8
         self.x = 382
      when 382
        self.x = 8
      end
     case self.y
    when 272
      self.y = 8
    when 8
      self.y = 272
    end
  else
    case self.x
    when  625 - self.width
      self.x = 8
    when 8
      self.x = 625 - self.width
    end
    case self.y
    when 470 - self.height
      self.y = 8
    when 8
      self.y = 470 - self.height
    end
    end
end
end
     #主角位置
    if $game_party.actors.size > 0
#      for i in [2, 1, 0]
#      tile = @map_data[$game_player.x, $game_player.y, i]
#        next if tile == 0
#        return if $game_map.priorities[tile] > 0
#      end
      actor = $game_party.actors[0]
      bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
      width = bitmap.width/ 4
      height = bitmap.height / 4
      sy = ($game_player.direction - 2) / 2 * height
      #原始行走图大小矩形
      src_rect = Rect.new(0, sy, width, height)
      if $ZOOM > 7
      w = width / 5
      h = height / 5
      else  
      w = width / $ZOOM
      h = height / $ZOOM
      end
      x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x
      y = self.contents.height / 2 - h / 2 - rev_y
      #小地图上的行走图大小
      dest_rect = Rect.new(x, y, w, h)
      self.contents.stretch_blt(dest_rect, bitmap, src_rect)
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新
  #--------------------------------------------------------------------------
  def update
    super
    if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y
      @old_real_x = $game_player.real_x
      @old_real_y = $game_player.real_y
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    super
    @all_map.dispose
  end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


作者: heronba    时间: 2008-12-21 18:06
re:主题:《为什么显小地图的脚本和显坐标的脚本不能同时起作用》 [LINE]1,#dddddd[/LINE]
以下引用hgfor于2008-12-21 9:02:36的发言:


  试试这个小地图

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================



#冬夜更新说明
#更改了小地图的位置,Q是开启小地图跟随开关
#S是固定小地图位置

#更新了场所移动时地图的不同步,更新了战斗后的地图不同步
#小地图默认成为FLASE,只在第一次登入时是,以后跟随开关的指示
#恩恩  
#最后更新,测试过


#修正了由于小地图变化引起的不能转换问题,修休整了房间内的地图原先的那个羁押功能




#==============================================================================
# ■ 縮小地图的表示(ver 0.999)
# by ピニョン clum-sea
#==============================================================================
#==============================================================================
# □ 前期定义
#==============================================================================
module PLAN_Map_Window
  WIN_X       = 0         # 地图的 X 座標
  WIN_Y       = 0         # 地图的 Y 座標
  WIN_WIDTH   = 250     # 地图的宽度
  WIN_HEIGHT  = 200     # 地图的高度
  ZOOM        = 3.5     # 地图的放缩比例
  WINDOWSKIN  = ""        # 自定义地图窗口素材,如果留空则是默认的

  ON_OFF_KEY  = Input::L  # 打开地图的按钮,L就是键盘的Q键

  SWITCH      = 1       # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
                          # 使用地图功能,关闭则可以使用地图功能
                          
  WINDOW_MOVE = true   # 窗口中的地图跟随移动,(true:跟随, false:固定)
  
  OVER_X      = 632 - WIN_WIDTH   # 移動后的 X 座標(初期位置と往復します)
  OVER_Y      = 0         # 移動后的 Y 座標(初期位置と往復します)

  OPACITY     = 255  # 窗口的透明度
  C_OPACITY   = 255   # 地图的透明度
  
  VISIBLE     = false      # 最初是否可见
  SWITCH_KEY  = Input::L  # Q键锁定/解锁小地图
end
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
  attr_accessor  :map_visible     # 地图的表示状態
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  alias plan_map_window_main main
  def main
  $小地图 = false
  @map_window         = Window_Map.new
    @map_window.visible = $game_switches[406]
    plan_map_window_main
    @map_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 更新
  #--------------------------------------------------------------------------
  alias plan_map_window_update update
  def update
    $game_temp.map_visible = @map_window.visible
    plan_map_window_update
    if $game_switches[PLAN_Map_Window::SWITCH]      
      if @map_window.visible
      @map_window.visible = false
      $game_switches[406] = false
      $game_switches[405] = false
      $game_variables[19] = $direction
      $地图关闭 = true
      end  
    else
      if $地图关闭         
         @map_window.visible = true
         $game_switches[406] = true
         $地图关闭 = false
      end
    if !$game_temp.in_battle
      if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY)
        if @map_window.visible
          $game_system.se_play($data_system.cancel_se)
          @map_window.visible = false
          $game_switches[406] = false
          $game_switches[405] = false
          $game_variables[19] = $direction
        else
          $game_system.se_play($data_system.decision_se)
          @map_window.visible = true
          $game_switches[406] = true
        end
      end
      if Input.trigger?(PLAN_Map_Window::SWITCH_KEY)
        if @map_window.visible
        if $game_switches[405]
          $game_system.se_play($data_system.cancel_se)
          $game_switches[405] = false
          $game_variables[19] = $direction
         else
          $game_system.se_play($data_system.decision_se)
          $game_switches[405] = true
         end
       end
     end
   end
    end
    if @map_window.visible
      @map_window.update
    end
  end
  #--------------------------------------------------------------------------
  # ● 场所移动的变化
  #--------------------------------------------------------------------------
  alias plan_map_window_transfer_player transfer_player
  def transfer_player
#   visible = @map_window.visible
    @map_window.visible = false
    plan_map_window_transfer_player
    @map_window.dispose
    @map_window = Window_Map.new
  end
end
#==============================================================================
# ■ Window_Map
#==============================================================================
class Window_Map < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化
  #--------------------------------------------------------------------------
  def initialize
   $direction = $game_variables[19]
   if $win_x != nil
      x = $win_x
      y = $win_y
   else
   case $direction
     when 0
     x = 0
     y = 0
     $win_x = x
     $win_y = y
     when 1
     x = 382
     y = 8
     $win_x = x
     $win_y = y
     when 2
     x = 8
     y = 280 - 8
     $win_x = x
     $win_y = y
     when 3
     x = 382
     y = 280 - 8
     $win_x = x
     $win_y = y
     end
   end
    w = PLAN_Map_Window::WIN_WIDTH
    h = PLAN_Map_Window::WIN_HEIGHT
  $小地图 = true
   super(x, y, w, h)
  $小地图 = false
#   @windowskin_name = $game_system.windowskin_name
#   self.windowskin = RPG::Cache.windowskin(@windowskin_name)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = PLAN_Map_Window::OPACITY
    self.contents_opacity = PLAN_Map_Window::C_OPACITY
    @map_data = $game_map.data
    @tileset = RPG::Cache.tileset($game_map.tileset_name)
    @autotiles = []
    for i in 0..6
      autotile_name = $game_map.autotile_names
      @autotiles = RPG::Cache.autotile(autotile_name)
    end
    @old_real_x = $game_player.real_x
    @old_real_y = $game_player.real_y
  if $game_map.width > 70 or $game_map.height > 70
      $ZOOM = 2 * PLAN_Map_Window::ZOOM
  else
   
     if $game_map.width < 40 or $game_map.height < 40
      $ZOOM = PLAN_Map_Window::ZOOM / 2
    else
      $ZOOM = PLAN_Map_Window::ZOOM
      end
  end
    @all_map = make_all_map
    self.visible = $game_switches[406]
     unless PLAN_Map_Window::WINDOWSKIN.empty?
      self.windowskin = RPG::Cache.windowskin("")
    end
   # PLAN_Map_Window::WINDOWSKIN
   # self.visible = PLAN_Map_Window::VISIBLE
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 缩小图做成
  #--------------------------------------------------------------------------
  def make_all_map
    all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32)
    for y in 0...$game_map.height
      for x in 0...$game_map.width
        for z in 0...3
          tile_num = @map_data[x, y, z]
          next if tile_num == nil
          if tile_num < 384
            if tile_num >= 48
              tile_num -= 48
              src_rect = Rect.new(32, 2 * 32, 32, 32)
              all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect)
            end
          else
            tile_num -= 384
            src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32)
            all_map.blt(x * 32, y * 32, @tileset, src_rect)
          end
        end
      end
    end
    w = ($game_map.width / $ZOOM) * 32
    h = ($game_map.height / $ZOOM) * 32
    ret_bitmap = Bitmap.new(w, h)
    src_rect = Rect.new(0, 0, all_map.width, all_map.height)
    dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height)
    ret_bitmap.stretch_blt(dest_rect, all_map, src_rect)
    all_map.dispose
    return ret_bitmap
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear

    self.x = $win_x
    self.y = $win_y
    self.z = 9999  # 让窗口在最上层
  @small_map = false
  if $game_map.width < 80 or $game_map.height < 80
    #这个是当地图大小宽和高小于指定大小时才改变大小,限制小地图窗口大小
    if $game_map.width < 40 or $game_map.height < 40
      #这同时限制了变换小地图的大小,防止关卡和队长办公室因为地图宽长无法切换
      self.width = [@all_map.width,200].min
      self.height = [@all_map.height,200].min
      self.contents = Bitmap.new(width-32, height-32)
     #让改变的小地图X坐标紧贴边缘
    if self.x + self.width > 250
      self.x = 625 - self.width
    end
      #让改变的小地图Y左边紧贴边缘
    if self.y + self.height > 380
      self.y = 470 - self.height
    end
     @small_map = true
  end
end
   if self.windowskin == nil
   @windowskin_name = $game_system.windowskin_name
   self.windowskin = RPG::Cache.windowskin(@windowskin_name)
   end
    one_tile_size = 32 / $ZOOM
    x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2
    y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2
    x = x * one_tile_size / 128
    y = y * one_tile_size / 128
    half_width = self.contents.width * 128 / 2
    rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size
    rev_x = 0
    if @all_map.width < self.contents.width
      rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
      rev_x -= (self.contents.width - @all_map.width) / 2
      x += rev_x
    elsif half_width > $game_player.real_x * one_tile_size
      rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
      x += rev_x
    elsif half_width > rest_width
      rev_x = -((half_width - rest_width) / 128)
      x += rev_x
    end
    half_height = self.contents.height * 128 / 2
    rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size
    rev_y = 0
    if @all_map.height < self.contents.height
      rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
      rev_y -= (self.contents.height - @all_map.height) / 2
      y += rev_y
    elsif half_height > $game_player.real_y * one_tile_size
      rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
      y += rev_y
    elsif half_height > rest_height
      rev_y = -((half_height - rest_height) / 128)
      y += rev_y
    end
    src_rect = Rect.new(x, y, self.contents.width, self.contents.height)
    self.contents.blt(0, 0, @all_map, src_rect)
     if PLAN_Map_Window::WINDOW_MOVE == true
      w = self.x - 32 .. self.x + self.width + 32
      h = self.y - 64 .. self.y + self.height + 64
      if w === $game_player.screen_x and h === $game_player.screen_y
     if !@small_map
     case self.x
      when 8
         self.x = 382
      when 382
        self.x = 8
      end
     case self.y
    when 272
      self.y = 8
    when 8
      self.y = 272
    end
  else
    case self.x
    when  625 - self.width
      self.x = 8
    when 8
      self.x = 625 - self.width
    end
    case self.y
    when 470 - self.height
      self.y = 8
    when 8
      self.y = 470 - self.height
    end
    end
end
end
     #主角位置
    if $game_party.actors.size > 0
#      for i in [2, 1, 0]
#      tile = @map_data[$game_player.x, $game_player.y, i]
#        next if tile == 0
#        return if $game_map.priorities[tile] > 0
#      end
      actor = $game_party.actors[0]
      bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
      width = bitmap.width/ 4
      height = bitmap.height / 4
      sy = ($game_player.direction - 2) / 2 * height
      #原始行走图大小矩形
      src_rect = Rect.new(0, sy, width, height)
      if $ZOOM > 7
      w = width / 5
      h = height / 5
      else  
      w = width / $ZOOM
      h = height / $ZOOM
      end
      x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x
      y = self.contents.height / 2 - h / 2 - rev_y
      #小地图上的行走图大小
      dest_rect = Rect.new(x, y, w, h)
      self.contents.stretch_blt(dest_rect, bitmap, src_rect)
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新
  #--------------------------------------------------------------------------
  def update
    super
    if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y
      @old_real_x = $game_player.real_x
      @old_real_y = $game_player.real_y
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    super
    @all_map.dispose
  end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

{/pz}{/pz}你的脚本  于坐标显示脚本相会冲突········

作者: 西江月    时间: 2008-12-21 18:18
那就请你打开第25号开关……


作者: heronba    时间: 2008-12-21 19:37
以下引用西江月于2008-12-21 10:18:21的发言:

那就请你打开第25号开关……




[本贴由作者于 2008-12-21 10:37:04 最后编辑]

你把你的修改好的脚本发给我好吗??  25号开关打开的{/se}{/se}{/se}{/se}
作者: 西江月    时间: 2008-12-21 22:21
我用的就是4L的脚本啊 {/fd}
作者: heronba    时间: 2008-12-21 22:28
以下引用西江月于2008-12-21 14:21:21的发言:

我用的就是4L的脚本啊  

我的就显示坐标啊,找不到  25好开关在哪里啊???




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