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

Project1

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

[已经解决] 求整合

[复制链接]

Lv1.梦旅人

梦石
0
星屑
106
在线时间
470 小时
注册时间
2015-4-26
帖子
92
跳转到指定楼层
1
发表于 2015-7-23 14:31:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 云海尘清 于 2015-7-23 14:34 编辑

如何在acg_arpg此范例加上小地图脚本(下附)
小地图脚本

感谢@芯☆淡茹水

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

Lv5.捕梦者

梦石
0
星屑
33123
在线时间
5104 小时
注册时间
2012-11-19
帖子
4878

开拓者

2
发表于 2015-7-23 16:06:13 | 只看该作者
本帖最后由 芯☆淡茹水 于 2015-7-24 08:45 编辑

比较简单,只把一些参数改了。
  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*22      # 地图的宽度
  15.   WIN_HEIGHT  = 6*22      # 地图的高度
  16.   ZOOM        = 4.0       # 地图的放缩比例
  17.   WINDOWSKIN  = ""        # 自定义地图窗口素材,如果留空则是默认的
  18.   ON_OFF_KEY  = Input::A  # 打开地图的按钮,A就是键盘的Z键
  19.   SWITCH      = 1       # 禁用地图功能的开关,默认这个就是打开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 = true
  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
  115.       @autotiles << RPG::Cache.autotile(autotile_name[i])
  116.     end
  117.     @old_real_x = $game_actor.real_x
  118.     @old_real_y = $game_actor.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_actor.real_x - 128 * (self.contents.width / one_tile_size) / 2
  163.     y = $game_actor.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_actor.real_x) * one_tile_size
  168.     rev_x = 0
  169.     if @all_map.width < self.contents.width
  170.       rev_x = (half_width - $game_actor.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_actor.real_x * one_tile_size
  174.       rev_x = (half_width - $game_actor.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_actor.real_y) * one_tile_size
  182.     rev_y = 0
  183.     if @all_map.height < self.contents.height
  184.       rev_y = (half_height - $game_actor.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_actor.real_y * one_tile_size
  188.       rev_y = (half_height - $game_actor.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_actor.screen_x and h === $game_actor.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_actor.x, $game_actor.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_actor.real_x or @old_real_y != $game_actor.real_y
  234.       @old_real_x = $game_actor.real_x
  235.       @old_real_y = $game_actor.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星屑 +100 梦石 +1 收起 理由
RyanBern + 100 + 1 认可答案

查看全部评分

xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
106
在线时间
470 小时
注册时间
2015-4-26
帖子
92
3
 楼主| 发表于 2015-7-23 16:12:04 | 只看该作者
芯☆淡茹水 发表于 2015-7-23 16:06
比较简单,只把一些参数改了,但是没试

感谢你的关注,我也试了一下,还是出了错。
我怎么觉得应该在map项里添加生成释放的版块。

点评

是以前在主站淘来的脚本,以前也可用,之后放到这个ARPG脚本集也没报错,只是无法显示,但是经你的修改,现在也可以,十分感谢。  发表于 2015-7-24 08:57
LS已改。LZ哪儿淘的二手脚本?放新工程也报错。  发表于 2015-7-24 08:45
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
9 小时
注册时间
2014-9-4
帖子
11
4
发表于 2015-8-18 21:05:30 | 只看该作者
感谢大大
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 20:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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