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

Project1

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

[已经解决] 【新人求助】 怎样让vx的视线范围变大。。。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
24 小时
注册时间
2010-10-21
帖子
23
跳转到指定楼层
1
发表于 2010-12-4 15:30:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 woodenpen 于 2010-12-5 10:00 编辑

可能有点异想天开。。。详细说呢。。就是vx的视线范围有点小了。所以走迷宫很麻烦的样子。
不知道有没有这么个脚本能够让游戏中也能缩放啊。。。
或者有没有什么办法做个即时地图。也就是能够显示自己所处位置的地图呢。。。
再或者有什么办法让vx的迷宫好走点。。。

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39816
在线时间
7488 小时
注册时间
2009-7-6
帖子
13484

开拓者贵宾

2
发表于 2010-12-4 16:40:13 | 只看该作者
不知道小地图是不是您想要的呢?
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
180
在线时间
829 小时
注册时间
2010-6-26
帖子
671
3
发表于 2010-12-4 17:56:40 | 只看该作者
额,迷宫好走还叫迷宫?
新手们!不要被看扁了!我们也会用论坛搜索,我们也会自己找脚本,我们也会自己点击关闭按钮旁边的小问号!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

弓箭手?剑兰

梦石
0
星屑
4854
在线时间
833 小时
注册时间
2010-11-17
帖子
1140
4
发表于 2010-12-4 18:07:48 | 只看该作者
加大视线范围:
一、脚本库在main里的第一行里插入:
  1. Graphics.resize_screen(640, 480)
复制代码
二、再将Spriteset_Map里大概第27至29的所有的544, 416改为640, 480,就像这样:
  1.     @viewport1 = Viewport.new(0, 0, 640, 480)
  2.     @viewport2 = Viewport.new(0, 0, 640, 480)
  3.     @viewport3 = Viewport.new(0, 0, 640, 480)
复制代码
这个就能加大视线范围。

小地图(显示自己位置):
  1. #===============================================================
  2. # ■ 小地图显示系统
  3. #    适用Scene_Map里的于小地图
  4. #--------------------------------------------------------------
  5. # 默认开关10控制关闭地图 17行
  6. #--------------------------------------------------------------
  7. # ◦ Credit: KGC for XP MiniMap Script,
  8. # this script can't be done without his MiniMap.
  9. #--------------------------------------------------------------

  10. module MiniMap
  11.   #===========================================================================
  12.   # 数据搜索
  13.   #---------------------------------------------------------------------------
  14.   SWITCH_NO_MINIMAP = 10 # 开关编号,开时小地图关闭
  15.    
  16.   MAP_RECT = [410, 20, 100, 100]

  17.   MAP_Z = 0

  18.   GRID_SIZE = 5
  19.   
  20.   MINIMAP_BORDER_COLOR = Color.new(0, 0, 255, 160)
  21.   MINIMAP_BORDER_SIZE = 2
  22.   
  23.   FOREGROUND_COLOR = Color.new(224, 224, 255, 160)
  24.   BACKGROUND_COLOR = Color.new(0, 0, 0, 160)

  25.   USE_OUTLINE_PLAYER = true
  26.   PLAYER_OUTLINE_COLOR = Color.new(0, 0, 0, 192)
  27.   USE_OUTLINE_EVENT = true
  28.   EVENT_OUTLINE_COLOR = Color.new(255, 255, 255, 192)
  29.   
  30.   PLAYER_COLOR = Color.new(255, 0, 0, 192)

  31.   OBJECT_COLOR = {}
  32.   OBJECT_COLOR['npc'] = Color.new(30,144,255,160)
  33.   OBJECT_COLOR['treasure'] = Color.new(0,255,255,160)
  34.   OBJECT_COLOR['enemy'] = Color.new(139,35,35,160)
  35.   OBJECT_COLOR['merchant'] = Color.new(255,255,0,160)
  36.   
  37.   TAG_NO_MINIMAP = '[NOMAP]'
  38.   TAG_EVENT = 'MMEV'
  39.   
  40.   def self.refresh
  41.     if $scene.is_a?(Scene_Map)
  42.       $scene.spriteset.minimap.refresh
  43.     end
  44.   end
  45.   
  46.   def self.update_object
  47.     if $scene.is_a?(Scene_Map)
  48.       $scene.spriteset.minimap.update_object_list
  49.     end
  50.   end
  51. end

  52. #==============================================================================
  53. # ■ RPG::MapInfo
  54. #==============================================================================
  55. class RPG::MapInfo
  56.   def name
  57.     return @name.gsub(/\[.*\]/) { }
  58.   end

  59.   def original_name
  60.     return @name
  61.   end

  62.   def show_minimap?
  63.     return [email protected]?(MiniMap::TAG_NO_MINIMAP)
  64.   end
  65. end
  66. #==============================================================================
  67. # ■ Game_System
  68. #==============================================================================
  69. class Game_System
  70.   attr_accessor :minimap
  71.   alias wora_minimap_gamsys_ini initialize
  72.   
  73.   def initialize
  74.     wora_minimap_gamsys_ini
  75.     @minimap = MiniMap::MAP_RECT
  76.   end
  77.   
  78.   def show_minimap
  79.     return !$game_switches[MiniMap::SWITCH_NO_MINIMAP]
  80.   end
  81. end
  82. #==============================================================================
  83. # ■ Game_Map
  84. #==============================================================================
  85. class Game_Map
  86.   alias wora_minimap_gammap_setup setup
  87.   def setup(map_id)
  88.     wora_minimap_gammap_setup(map_id)
  89.     @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
  90.     @map_info = @db_info[map_id]
  91.   end
  92.   
  93.   def show_minimap?
  94.     return @map_info.show_minimap?
  95.   end
  96. end
  97. #==============================================================================
  98. # ■ Game_Event
  99. #==============================================================================
  100. class Game_Event < Game_Character
  101.   def mm_comment?(comment, return_comment = false )
  102.     if [email protected]?
  103.       for i in [email protected] - 1
  104.         next if @list[i].code != 108
  105.         if @list[i].parameters[0].include?(comment)
  106.           return @list[i].parameters[0] if return_comment
  107.           return true
  108.         end
  109.       end
  110.     end
  111.     return '' if return_comment
  112.     return false
  113.   end
  114. end
  115. #==============================================================================
  116. # ■ Game_MiniMap
  117. #------------------------------------------------------------------------------
  118. class Game_MiniMap
  119.   def initialize(tilemap)
  120.     @tilemap = tilemap
  121.     refresh
  122.   end

  123.   def dispose
  124.     @border.bitmap.dispose
  125.     @border.dispose
  126.     @map_sprite.bitmap.dispose
  127.     @map_sprite.dispose
  128.     @object_sprite.bitmap.dispose
  129.     @object_sprite.dispose
  130.     @position_sprite.bitmap.dispose
  131.     @position_sprite.dispose
  132.   end

  133.   def visible
  134.     return @map_sprite.visible
  135.   end

  136.   def visible=(value)
  137.     @map_sprite.visible = value
  138.     @object_sprite.visible = value
  139.     @position_sprite.visible = value
  140.     @border.visible = value
  141.   end

  142.   def refresh
  143.     @mmr = $game_system.minimap
  144.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  145.     grid_size = [MiniMap::GRID_SIZE, 1].max

  146.     @x = 0
  147.     @y = 0
  148.     @size = [map_rect.width / grid_size, map_rect.height / grid_size]

  149.     @border = Sprite.new
  150.     @border.x = map_rect.x - MiniMap::MINIMAP_BORDER_SIZE
  151.     @border.y = map_rect.y - MiniMap::MINIMAP_BORDER_SIZE
  152.     b_width = map_rect.width + (MiniMap::MINIMAP_BORDER_SIZE * 2)
  153.     b_height = map_rect.height + (MiniMap::MINIMAP_BORDER_SIZE * 2)
  154.     @border.bitmap = Bitmap.new(b_width, b_height)
  155.     @border.bitmap.fill_rect(@border.bitmap.rect, MiniMap::MINIMAP_BORDER_COLOR)
  156.     @border.bitmap.clear_rect(MiniMap::MINIMAP_BORDER_SIZE, MiniMap::MINIMAP_BORDER_SIZE,
  157.     @border.bitmap.width - (MiniMap::MINIMAP_BORDER_SIZE * 2),
  158.     @border.bitmap.height - (MiniMap::MINIMAP_BORDER_SIZE * 2))
  159.    
  160.     @map_sprite = Sprite.new
  161.     @map_sprite.x = map_rect.x
  162.     @map_sprite.y = map_rect.y
  163.     @map_sprite.z = MiniMap::MAP_Z
  164.     bitmap_width = $game_map.width * grid_size + map_rect.width
  165.     bitmap_height = $game_map.height * grid_size + map_rect.height
  166.     @map_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
  167.     @map_sprite.src_rect = map_rect

  168.     @object_sprite = Sprite.new
  169.     @object_sprite.x = map_rect.x
  170.     @object_sprite.y = map_rect.y
  171.     @object_sprite.z = MiniMap::MAP_Z + 1
  172.     @object_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
  173.     @object_sprite.src_rect = map_rect

  174.     @position_sprite = Sprite_Base.new
  175.     @position_sprite.x = map_rect.x + @size[0] / 2 * grid_size
  176.     @position_sprite.y = map_rect.y + @size[1] / 2 * grid_size
  177.     @position_sprite.z = MiniMap::MAP_Z + 2
  178.    
  179.     bitmap = Bitmap.new(grid_size, grid_size)
  180.     if MiniMap::USE_OUTLINE_PLAYER and MiniMap::GRID_SIZE >= 3
  181.       bitmap.fill_rect(bitmap.rect, MiniMap::PLAYER_OUTLINE_COLOR)
  182.       brect = Rect.new(bitmap.rect.x + 1, bitmap.rect.y + 1, bitmap.rect.width - 2,
  183.         bitmap.rect.height - 2)
  184.       bitmap.clear_rect(brect)
  185.     else
  186.       brect = bitmap.rect
  187.     end
  188.    
  189.     bitmap.fill_rect(brect, MiniMap::PLAYER_COLOR)
  190.     @position_sprite.bitmap = bitmap

  191.     draw_map
  192.     update_object_list
  193.     draw_object
  194.     update_position
  195.   end

  196.   def draw_map
  197.     bitmap = @map_sprite.bitmap
  198.     bitmap.fill_rect(bitmap.rect, MiniMap::BACKGROUND_COLOR)
  199.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  200.     grid_size = [MiniMap::GRID_SIZE, 1].max
  201.    
  202.     $game_map.width.times do |i|
  203.       $game_map.height.times do |j|
  204.         if !$game_map.passable?(i, j)
  205.           next
  206.         end
  207.         rect = Rect.new(map_rect.width / 2 + grid_size * i,
  208.           map_rect.height / 2 + grid_size * j,
  209.           grid_size, grid_size)
  210.         if grid_size >= 3
  211.           if !$game_map.passable?(i, j)
  212.             rect.height -= 1
  213.             rect.x += 1
  214.             rect.width -= 1
  215.             rect.width -= 1
  216.             rect.y += 1
  217.             rect.height -= 1
  218.           end
  219.         end
  220.         bitmap.fill_rect(rect, MiniMap::FOREGROUND_COLOR)
  221.       end
  222.     end
  223.   end

  224.   def update_object_list
  225.     @object_list = {}
  226.     $game_map.events.values.each do |e|
  227.       comment = e.mm_comment?(MiniMap::TAG_EVENT, true)
  228.       if comment != ''
  229.         type = comment.gsub(/#{MiniMap::TAG_EVENT}/){}.gsub(/\s+/){}
  230.         @object_list[type] = [] if @object_list[type].nil?
  231.         @object_list[type] << e
  232.       end
  233.     end
  234.   end

  235.   def draw_object
  236.     bitmap = @object_sprite.bitmap
  237.     bitmap.clear
  238.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  239.     grid_size = [MiniMap::GRID_SIZE, 1].max
  240.     rect = Rect.new(0, 0, grid_size, grid_size)
  241.     mw = map_rect.width / 2
  242.     mh = map_rect.height / 2

  243.     @object_list.each do |key, events|
  244.       color = MiniMap::OBJECT_COLOR[key]
  245.       next if events.nil? or color.nil?
  246.       events.each do |obj|
  247.         if !obj.character_name.empty?
  248.           rect.x = mw + obj.real_x * grid_size / 256
  249.           rect.y = mh + obj.real_y * grid_size / 256
  250.           # Event's Outline
  251.           if MiniMap::USE_OUTLINE_EVENT and MiniMap::GRID_SIZE >= 3
  252.             bitmap.fill_rect(rect, MiniMap::EVENT_OUTLINE_COLOR)
  253.             brect = Rect.new(rect.x + 1, rect.y + 1, rect.width - 2,
  254.             rect.height - 2)
  255.             bitmap.clear_rect(brect)
  256.           else
  257.             brect = bitmap.rect
  258.           end
  259.           bitmap.fill_rect(brect, color)
  260.         end
  261.       end
  262.     end
  263.   end

  264.   def update
  265.     if @mmr != $game_system.minimap
  266.       dispose
  267.       refresh
  268.     end
  269.     draw_object
  270.     update_position
  271.     if @map_sprite.visible
  272.       @map_sprite.update
  273.       @object_sprite.update
  274.       @position_sprite.update
  275.     end
  276.   end

  277.   def update_position
  278.     map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
  279.     grid_size = [MiniMap::GRID_SIZE, 1].max
  280.     sx = $game_player.real_x * grid_size / 256
  281.     sy = $game_player.real_y * grid_size / 256
  282.     @map_sprite.src_rect.x = sx
  283.     @map_sprite.src_rect.y = sy
  284.     @object_sprite.src_rect.x = sx
  285.     @object_sprite.src_rect.y = sy
  286.   end
  287. end
  288. #==============================================================================
  289. # ■ Spriteset_Map
  290. #------------------------------------------------------------------------------
  291. class Spriteset_Map
  292.   attr_reader :minimap
  293.   alias wora_minimap_sprsetmap_ini initialize
  294.   alias wora_minimap_sprsetmap_dis dispose
  295.   alias wora_minimap_sprsetmap_upd update
  296.   
  297.   def initialize
  298.     wora_minimap_sprsetmap_ini
  299.     if $game_map.show_minimap?
  300.       @minimap = Game_MiniMap.new(@tilemap)
  301.       $game_system.show_minimap = true if $game_system.show_minimap.nil?
  302.       @minimap.visible = $game_system.show_minimap
  303.     end
  304.   end
  305.   
  306.   def dispose
  307.     @minimap.dispose if [email protected]?
  308.     wora_minimap_sprsetmap_dis
  309.   end

  310.   def update
  311.     if [email protected]?
  312.       if $game_system.show_minimap
  313.         @minimap.visible = true
  314.         @minimap.update
  315.       else
  316.         @minimap.visible = false
  317.       end
  318.     end
  319.     wora_minimap_sprsetmap_upd
  320.   end
  321. end
  322. #==============================================================================
  323. # ■ Scene_Map
  324. #------------------------------------------------------------------------------
  325. class Scene_Map < Scene_Base
  326.   attr_reader :spriteset
  327. end
复制代码

评分

参与人数 1星屑 +800 收起 理由
夕阳武士 + 800 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
24 小时
注册时间
2010-11-7
帖子
36
5
发表于 2010-12-4 18:11:53 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
24 小时
注册时间
2010-10-21
帖子
23
6
 楼主| 发表于 2010-12-5 09:13:20 | 只看该作者
回复 一箭烂YiJL 的帖子

谢谢了~可是用了这个脚本对话框的位置变的很诡异诶。。。有什么办法可以解决吗?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

弓箭手?剑兰

梦石
0
星屑
4854
在线时间
833 小时
注册时间
2010-11-17
帖子
1140
7
发表于 2010-12-5 09:46:12 | 只看该作者
回复 woodenpen 的帖子

在Window_Message那夜里把super(0, 288, 544, 128)以这个代替:
  1. super(0, 352, 640, 128)
复制代码

点评

谢谢谢谢~  发表于 2010-12-5 09:59
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 18:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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