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

Project1

 找回密码
 注册会员
搜索
楼主: Sion
打印 上一主题 下一主题

[RMVA发布] VA鼠标脚本 6/9 更新 v2.32 by Sion

  [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
65 小时
注册时间
2008-5-15
帖子
44
21
发表于 2013-3-12 20:18:43 | 只看该作者
感谢楼主的脚本,确实很好用的说。 再次感谢,但是还是有一小点BUG……谢谢!
回复 支持 反对

使用道具 举报

Lv2.观梦者

呼啸的团子

梦石
0
星屑
293
在线时间
93 小时
注册时间
2006-11-9
帖子
129
22
发表于 2013-3-13 09:10:50 | 只看该作者
突然有个想法,就是说我屏幕的左上方一直有个图标,只要鼠标移到那个位置上点击就能打开对应的界面。就像一些游戏里把物品,状态等窗口的打开用一个小图标的方式放在左边一排。
嗯,这么想的话可以做一个窗口摆在左边,从上到下分别是要的功能,这个窗口在角色移动的时候也得一直处于激活的状态,这样只要鼠标移过去就能点开里面的选项,但是问题是用方向键操作的时候,怎么区分是操作角色移动还是选择窗口里的选项。。。额,好像蛮乱的,只是个初步的想法哈,呵呵。

点评

按钮的话判断一下鼠标的位置和按下鼠标按键就行了。然后参照scene_menu就能做一个菜单,不会与角色操作冲突的。  发表于 2013-3-13 20:48
风啊!我会面对一切,让我们共赴痛苦之海吧!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
97 小时
注册时间
2011-11-6
帖子
50
23
发表于 2013-3-14 21:16:55 | 只看该作者
首先说下,这真是个不错的脚本!
不过还是希望楼主能加入一个鼠标移动到选项会播放声效的效果——这个应该不难吧?

点评

我觉得那样好吵啊…  发表于 2013-3-14 21:32
回复 支持 反对

使用道具 举报

Lv2.观梦者 (暗夜天使)

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
帖子
2309

贵宾

24
 楼主| 发表于 2013-3-14 21:37:19 | 只看该作者
为RPG生 发表于 2013-3-14 21:16
首先说下,这真是个不错的脚本!
不过还是希望楼主能加入一个鼠标移动到选项会播放声效的效果——这个应该 ...
  1. class Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 将光标设置到鼠标所在的位置,附带卷动菜单的功能
  4.   #--------------------------------------------------------------------------
  5.   def set_cursor
  6.     mouse_row, mouse_col = mouse_window_area
  7.     if    mouse_row == -1
  8.       @move_state += 1 if need_scroll?
  9.       cursor_up if (@move_state - 1) % 4 == 0 && !is_horzcommand?
  10.     elsif mouse_row == -2
  11.       @move_state += 1 if need_scroll?
  12.       cursor_down if (@move_state - 1) % 4 == 0 && !is_horzcommand?
  13.     elsif mouse_col == -1
  14.       @move_state += 1 if need_scroll?
  15.       cursor_left if (@move_state - 1) % 16 == 0 && is_horzcommand?
  16.     elsif mouse_col == -2
  17.       @move_state += 1 if need_scroll?
  18.       cursor_right if (@move_state - 1) % 16 == 0 && is_horzcommand?
  19.     else
  20.       @move_state = 0
  21.       new_index = (top_row + mouse_row) * col_max + mouse_col
  22.       if new_index < item_max && new_index != @index
  23.         Sound.play_cursor
  24.         select(new_index)
  25.       end
  26.     end
  27.   end
  28. end
复制代码
你可以自己试一试效果,放到鼠标脚本以下就行了;一些特殊的菜单还要另外改
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
589
在线时间
332 小时
注册时间
2011-11-19
帖子
194
25
发表于 2013-3-16 17:07:16 | 只看该作者
游戏中可不可以执行中途更换鼠标指针的指令呢?
比如游戏过程中切换鼠标指针图,或者鼠标移到特别事件上时自动更换的效果。
哈哈,鼠标功能越来越全了呢!

点评

最近比较忙了,有空的时候再更新吧- -b  发表于 2013-3-19 11:57
支持《彼岸之光》系列!加油!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
91 小时
注册时间
2011-12-21
帖子
10
26
发表于 2013-3-20 16:34:50 | 只看该作者
本帖最后由 ayano2k 于 2013-3-21 15:57 编辑

感谢楼主的脚本,很好用~~
但是这个功能想知道该怎么设置??
  [[  1.3a: 代码小修改;
          加入了鼠标点击启动事件的功能,
          在事件中加入“注释”: 鼠标启动  ,<<<?不懂
          该事件将无法用其它方式启动,只能用鼠标左键点击启动。]]
-------------------------------------------------
-------------------------------------------------
另外这个作者有作出8方向移动,不知道和滑鼠系统有没有机会完美整合
artificialprovidence.web.fc2.com/r3usability.html

--------------------------PM 04
传送完成了,请查收~~

点评

就是 事件编辑里面—流程控制—插入注释 鼠标启动。8向移动的话,你发个可用范例给我:[email protected]  发表于 2013-3-21 08:32
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
27
发表于 2013-3-23 11:58:03 | 只看该作者
本帖最后由 tyq4590 于 2013-3-24 13:26 编辑

这个脚本很不错,手感各方面都很出色。就是遇到一个问题:在其他脚本用到cursor_fix的时候会报错:undefined method 'cursor_fix=' for true:TrueClass 不知道有没有解决办法?(我测试了一下,只要把全鼠标脚本移除就不报错了,所以确定是跟全鼠标脚本的兼容性问题)

附上脚本(画廊),报错的部分是605行‘@list_window.activate.cursor_fix = true’这一句:

RUBY 代码复制
  1. #==============================================================================
  2. # ■ VXAce-RGSS3-18 ギャラリー        by Claimh
  3. #------------------------------------------------------------------------------
  4. # 写真を表示するギャラリーを作ります
  5. # なお、ギャラリーの管理情報は全セーブデータで共通となります。
  6. #------------------------------------------------------------------------------
  7. # ●ギャラリー全体の表示許可
  8. #   DataManager.garally.enable = true
  9. # ●写真の表示許可
  10. #   DataManager.garally[id] = true
  11. # ●写真の追加(LIST以外のスナップショットなどを追加)
  12. #   DataManager.garally.push(id, GFile.new(filename, text))
  13. # ●イベント等から呼び出す
  14. #   SceneManager.call(Scene_ExGarally)
  15. #==============================================================================
  16.  
  17. class GFile
  18.   attr_reader :name
  19.   attr_reader :text
  20.   def initialize(filename, text="")
  21.     @name = filename; @text = text
  22.   end
  23. end
  24.  
  25. module ExGarally
  26.   # 写真の設定
  27.   LIST = {
  28. #  ID => GFile.new("ファイル名(Graphics/Pictures)", 表示文字)
  29.    1  => GFile.new("BlueSky", "青い空\n改行"),
  30.    2  => GFile.new("CloudySky1", "曇った空"),
  31.    3  => GFile.new("CloudySky2"),
  32.    4  => GFile.new("DarkSpace1"),
  33.    5  => GFile.new("DarkSpace2"),
  34.    6  => GFile.new("Mountains1"),
  35.    7  => GFile.new("Mountains2"),
  36.    8  => GFile.new("Mountains3"),
  37.    9  => GFile.new("Mountains4"),
  38.    10 => GFile.new("Mountains5"),
  39.    12 => GFile.new("Ocean2"),
  40.    11 => GFile.new("Ocean1"),
  41.    13 => GFile.new("SeaofClouds"),
  42.    14 => GFile.new("StarlitSky"),
  43. #   15 => GFile.new("Sunset"),
  44.   }
  45.  
  46.   # ヘルプウィンドウの行数(1~3)
  47.   HELP_LINES = 2
  48. end
  49.  
  50.  
  51. #==============================================================================
  52. # ■ ExGarally
  53. #==============================================================================
  54. module ExGarally
  55.   #--------------------------------------------------------------------------
  56.   # ● ギャラリーの表示有効?
  57.   #--------------------------------------------------------------------------
  58.   def self.enable?
  59.     DataManager.garally.enable
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● ファイル名
  63.   #--------------------------------------------------------------------------
  64.   def self.filename
  65.     "exgallary.rvdata2"
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● セーブの実行
  69.   #--------------------------------------------------------------------------
  70.   def self.save_exdata(obj)
  71.     save_data(obj, filename)
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● ロードの実行
  75.   #--------------------------------------------------------------------------
  76.   def self.load_exdata
  77.     exist? ? load_data(filename) : Game_ExGarallyList.new
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● ファイル削除
  81.   #--------------------------------------------------------------------------
  82.   def self.delete_exdata
  83.     return unless exist?
  84.     File.delete(filename) rescue nil
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● ファイルの有無チェック
  88.   #--------------------------------------------------------------------------
  89.   def self.exist?
  90.     FileTest.exist?(filename)
  91.   end
  92. end
  93.  
  94.  
  95. #==============================================================================
  96. # ■ DataManager
  97. #==============================================================================
  98. class << DataManager
  99.   #--------------------------------------------------------------------------
  100.   # ● 各種ゲームオブジェクトの作成
  101.   #--------------------------------------------------------------------------
  102.   alias create_game_objects_exgrly create_game_objects
  103.   def create_game_objects
  104.     create_game_objects_exgrly
  105.     load_garally
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● セーブの実行
  109.   #--------------------------------------------------------------------------
  110.   alias save_game_exgarally save_game
  111.   def save_game(index)
  112.     r = save_game_exgarally(index)
  113.     save_garally if r
  114.     r
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● ロードの実行
  118.   #--------------------------------------------------------------------------
  119.   alias load_game_exgrly load_game
  120.   def load_game(index)
  121.     r = load_game_exgrly(index)
  122.     load_garally if r
  123.     r
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● ギャラリー情報load
  127.   #--------------------------------------------------------------------------
  128.   def load_garally
  129.     @exgarally = ExGarally.load_exdata
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● ギャラリー情報load
  133.   #--------------------------------------------------------------------------
  134.   def save_garally
  135.     ExGarally.save_exdata(@exgarally)
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● ギャラリー情報削除
  139.   #--------------------------------------------------------------------------
  140.   def delete_garally
  141.     ExGarally.delete_exdata
  142.     load_garally
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● ギャラリー情報参照
  146.   #--------------------------------------------------------------------------
  147.   def garally
  148.     @exgarally
  149.   end
  150. end
  151.  
  152.  
  153. #==============================================================================
  154. # ■ Game_ExGarally
  155. #==============================================================================
  156. class Game_ExGarally
  157.   attr_accessor :name   # ファイル名
  158.   attr_accessor :text   # 表示文字
  159.   attr_accessor :enable # 表示可否
  160.   #--------------------------------------------------------------------------
  161.   # ● オブジェクト初期化
  162.   #--------------------------------------------------------------------------
  163.   def initialize(file, enable=false)
  164.     @name   = file.name
  165.     @text   = file.text
  166.     @enable = enable
  167.   end
  168. end
  169.  
  170. #==============================================================================
  171. # ■ Game_ExGarallyList  : DataManager.garallyで参照可能
  172. #==============================================================================
  173. class Game_ExGarallyList
  174.   LIST = ExGarally::LIST
  175.   attr_accessor :enable
  176.   attr_reader   :size
  177.   #--------------------------------------------------------------------------
  178.   # ● オブジェクト初期化
  179.   #--------------------------------------------------------------------------
  180.   def initialize
  181.     clear
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● クリア
  185.   #--------------------------------------------------------------------------
  186.   def clear
  187.     @size = LIST.size
  188.     @data = {}
  189.     @enable = false
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● 参照
  193.   #--------------------------------------------------------------------------
  194.   def [](id)
  195.     return nil if LIST[id].nil? and @data[id].nil?
  196.     return Game_ExGarally.new(LIST[id]) if @data[id].nil?
  197.     @data[id]
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● 表示許可/禁止
  201.   #--------------------------------------------------------------------------
  202.   def []=(id, val)
  203.     return nil if LIST[id].nil? and @data[id].nil?
  204.     if val
  205.       @data[id] = Game_ExGarally.new(LIST[id]) if @data[id].nil?
  206.       @data[id].enable = true
  207.     elsif !@data[id].nil?
  208.       @data.delete(id)
  209.     end
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● リスト
  213.   #--------------------------------------------------------------------------
  214.   def list
  215.     (@data.keys+LIST.keys).uniq.sort.collect {|id| self.[](id) }
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ● 追加ギャラリー
  219.   #--------------------------------------------------------------------------
  220.   def push(id, name, enable=true)
  221.     @data[id] = Game_ExGarally.new(name, enable)
  222.     @size += 1 if LIST[id].nil?
  223.   end
  224. end
  225.  
  226.  
  227. #==============================================================================
  228. # ■ Sprite_ExGrlyPicture
  229. #==============================================================================
  230. class Sprite_ExGrlyPicture < Sprite
  231.   #--------------------------------------------------------------------------
  232.   # ● オブジェクト初期化
  233.   #--------------------------------------------------------------------------
  234.   def initialize(rect=Rect.new(0,0,Graphics.width,Graphics.height))
  235.     super(Viewport.new(rect))
  236.     viewport.z = 100
  237.     create_bitmap
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● オブジェクト解放
  241.   #--------------------------------------------------------------------------
  242.   def dispose
  243.     dispose_bitmap
  244.     super
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● ビットマップ生成
  248.   #--------------------------------------------------------------------------
  249.   def create_bitmap
  250.     self.bitmap = Bitmap.new(vw, vh)
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● ビットマップ下方
  254.   #--------------------------------------------------------------------------
  255.   def dispose_bitmap
  256.     self.bitmap.dispose
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● ピクチャ設定
  260.   #--------------------------------------------------------------------------
  261.   def picture(filename, enabled=true)
  262.     dispose_bitmap
  263.     if enabled
  264.       self.bitmap = Cache.picture(filename)
  265.     else
  266.       create_bitmap
  267.       self.bitmap.fill_rect(0,0,vw,vh,Color.new(0,0,0,160))
  268. #      self.bitmap.draw_text(0,0, vw, vh, filename, 1)
  269.     end
  270.     fit_screen
  271.     resize
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● ズーム倍率再設定
  275.   #--------------------------------------------------------------------------
  276.   def resize(r=Rect.new(0,0,vw,vh))
  277.     self.ox = bitmap.width  / 2
  278.     self.oy = bitmap.height / 2
  279.     self.x = r.width  / 2 + r.x
  280.     self.y = r.height / 2 + r.y
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 画面にフィットさせる
  284.   #--------------------------------------------------------------------------
  285.   def bwz;  (bitmap.width * zoom_x).truncate; end # ズーム後のbitmap幅
  286.   def bhz;  (bitmap.height* zoom_y).truncate; end # ズーム後のbitmap高さ
  287.   def vw;   viewport.rect.width;   end
  288.   def vh;   viewport.rect.height;  end
  289.   def fit_screen(w=vw, h=vh)
  290.     x_zoom = w * 1.0 / bitmap.width
  291.     y_zoom = h * 1.0 / bitmap.height
  292.     zoom = x_zoom < y_zoom ? x_zoom : y_zoom
  293.     self.zoom_x = self.zoom_y = zoom
  294.   end
  295. end
  296.  
  297.  
  298. #==============================================================================
  299. # ■ Sprite_ExGrlyPicture
  300. #==============================================================================
  301. class Sprite_ExGrlyPictFull < Sprite_ExGrlyPicture
  302.   #--------------------------------------------------------------------------
  303.   # ● オブジェクト初期化
  304.   #--------------------------------------------------------------------------
  305.   def initialize
  306.     super
  307.     hide.viewport.z = 200
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● ウィンドウの表示
  311.   #--------------------------------------------------------------------------
  312.   def show
  313.     self.visible = true
  314.     self
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # ● ウィンドウの非表示
  318.   #--------------------------------------------------------------------------
  319.   def hide
  320.     self.visible = false
  321.     self
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● ピクチャ設定
  325.   #--------------------------------------------------------------------------
  326.   def picture(filename, enabled=true)
  327.     dispose_bitmap
  328.     b = Cache.picture(filename)
  329.     r = Rect.new(0, 0, b.width, b.height)
  330.     self.bitmap = Bitmap.new(r.width, r.height)
  331.     self.bitmap.stretch_blt(r, b, r)
  332.     fit_screen
  333.     resize
  334.   end
  335. end
  336.  
  337. #==============================================================================
  338. # ■ Grly_Thumbnail
  339. #==============================================================================
  340. class Grly_Thumbnail
  341.   attr_reader :item
  342.   attr_reader :rect
  343.   #--------------------------------------------------------------------------
  344.   # ● オブジェクト初期化
  345.   #--------------------------------------------------------------------------
  346.   def initialize(item, rect)
  347.     @item = item; @rect = rect
  348.   end
  349. end
  350.  
  351. #==============================================================================
  352. # ■ SpritesetExGrlyPictures
  353. #==============================================================================
  354. class SpritesetExGrlyPictures
  355.   #--------------------------------------------------------------------------
  356.   # ● オブジェクト初期化
  357.   #--------------------------------------------------------------------------
  358.   def initialize
  359.     @sprites = []
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ● オブジェクト解放
  363.   #--------------------------------------------------------------------------
  364.   def dispose
  365.     dispose_sprites
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ● ピクチャスプライト生成
  369.   #--------------------------------------------------------------------------
  370.   def create_sprites(thumnails)
  371.     thumnails.each do |thm|
  372.       s = Sprite_ExGrlyPicture.new(thm.rect)
  373.       s.picture(thm.item.name, thm.item.enable)
  374.       @sprites.push(s)
  375.     end
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● ピクチャスプライト解放
  379.   #--------------------------------------------------------------------------
  380.   def dispose_sprites
  381.     @sprites.each { |s| s.dispose }
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● ピクチャスプライト更新
  385.   #--------------------------------------------------------------------------
  386.   def update_sprites(thumnails)
  387.     dispose_sprites
  388.     create_sprites(thumnails)
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● サムネイル矩形
  392.   #--------------------------------------------------------------------------
  393.   def thm_rect(i)
  394.     @sprites[i].nil? ? nil : @sprites[i].thm
  395.   end
  396. end
  397.  
  398.  
  399. #==============================================================================
  400. # ■ Window_GrlyPicture
  401. #==============================================================================
  402. class Window_GrlyPicture < Window_Selectable
  403.   attr_accessor :thum_sprites
  404.   #--------------------------------------------------------------------------
  405.   # ● オブジェクト初期化
  406.   #--------------------------------------------------------------------------
  407.   def initialize
  408.     @thum_sprites = nil
  409.     make_list
  410.     super(0, help_height, Graphics.width, Graphics.height-help_height)
  411.     activate
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● ヘルプウィンドウの高さ
  415.   #--------------------------------------------------------------------------
  416.   def help_height
  417.     fitting_height(ExGarally::HELP_LINES)
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● 桁数の取得
  421.   #--------------------------------------------------------------------------
  422.   def col_max
  423.     return 3
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● 横に項目が並ぶときの空白の幅を取得
  427.   #--------------------------------------------------------------------------
  428.   def spacing
  429.     return 16
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 項目数の取得
  433.   #--------------------------------------------------------------------------
  434.   def item_max
  435.     DataManager.garally.size
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● 項目の高さを取得
  439.   #--------------------------------------------------------------------------
  440.   def item_height
  441.     (Graphics.height - help_height - standard_padding * 2) / 2
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● 項目を描画する矩形の取得
  445.   #--------------------------------------------------------------------------
  446.   def item_rect(index)
  447.     rect = super(index)
  448.     thm  = calc_thm_rect
  449.     rect.x += (rect.width  - (thm.width  + 8)) / 2
  450.     rect.y += (rect.height - (thm.height + 8)) / 2
  451.     rect.width  = thm.width  + 8
  452.     rect.height = thm.height + 8
  453.     rect
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● サムネイル矩形計算
  457.   #--------------------------------------------------------------------------
  458.   def calc_thm_rect
  459.     r = Rect.new
  460.     r.width  = item_width  - 8
  461.     r.height = item_height - 8
  462.     if (Graphics.width  / r.width) > (Graphics.height / r.height)
  463.       r.height = r.width  * Graphics.height / Graphics.width
  464.     else
  465.       r.width  = r.height * Graphics.width  / Graphics.height
  466.     end
  467.     r
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● サムネイルの表示位置を取得
  471.   #--------------------------------------------------------------------------
  472.   def thum_rect(index)
  473.     r = item_rect_for_text(index)
  474.     r.x += self.x + standard_padding
  475.     r.y += self.y + standard_padding
  476.     r
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 先頭行のindex
  480.   #--------------------------------------------------------------------------
  481.   def top_i
  482.     (top_row * col_max)
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ● 先頭行からの@index
  486.   #--------------------------------------------------------------------------
  487.   def top_cur_i
  488.     (@index - (top_row * col_max))
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ● サムネイルの表示位置を取得
  492.   #--------------------------------------------------------------------------
  493.   def thumnails
  494.     n = [page_item_max, item_max - top_i].min
  495.     idxs = []
  496.     n.times { |i| idxs.push(i) }
  497.     idxs.collect { |i| Grly_Thumbnail.new(@list[i+top_i], thum_rect(i)) }
  498.   end
  499.   #--------------------------------------------------------------------------
  500.   # ● リスト生成
  501.   #--------------------------------------------------------------------------
  502.   def make_list
  503.     @list = DataManager.garally.list
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # ● 選択中アイテム
  507.   #--------------------------------------------------------------------------
  508.   def item
  509.     @list[@index]
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ● 選択項目の有効状態を取得
  513.   #--------------------------------------------------------------------------
  514.   def current_item_enabled?
  515.     !item.nil? and item.enable
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● ヘルプテキスト更新
  519.   #--------------------------------------------------------------------------
  520.   def update_help
  521.     text = ((!item.nil? and item.enable) ? item.text : "")
  522.     @help_window.set_text(text)
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # ● カーソルの更新
  526.   #--------------------------------------------------------------------------
  527.   def update_cursor
  528.     super
  529.     @thum_sprites.update_sprites(thumnails) unless @thum_sprites.nil?
  530.   end
  531. end
  532.  
  533.  
  534.  
  535. #==============================================================================
  536. # ■ Scene_ExGarally
  537. #==============================================================================
  538. class Scene_ExGarally < Scene_Base
  539.   #--------------------------------------------------------------------------
  540.   # ● 開始処理
  541.   #--------------------------------------------------------------------------
  542.   def start
  543.     super
  544.     create_background
  545.     @help_window = Window_Help.new(ExGarally::HELP_LINES)
  546.     @thumset = SpritesetExGrlyPictures.new
  547.     @full_pict = Sprite_ExGrlyPictFull.new
  548.     create_list_window
  549.   end
  550.   #--------------------------------------------------------------------------
  551.   # ● 終了処理
  552.   #--------------------------------------------------------------------------
  553.   def terminate
  554.     super
  555.     dispose_background
  556.     @thumset.dispose
  557.     @full_pict.dispose
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● 背景の作成
  561.   #--------------------------------------------------------------------------
  562.   def create_background
  563.     @background_sprite = Sprite.new
  564.     @background_sprite.bitmap = SceneManager.background_bitmap
  565.     @background_sprite.color.set(16, 16, 16, 128)
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● 背景の解放
  569.   #--------------------------------------------------------------------------
  570.   def dispose_background
  571.     @background_sprite.dispose
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ● ピクチャリストウィンドウ生成
  575.   #--------------------------------------------------------------------------
  576.   def create_list_window
  577.     @list_window = Window_GrlyPicture.new
  578.     @list_window.thum_sprites = @thumset
  579.     @list_window.help_window = @help_window
  580.     set_full_handler
  581.     @list_window.select(0)
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # ● フルスクリーン化用のハンドラ登録
  585.   #--------------------------------------------------------------------------
  586.   def set_full_handler
  587.     @list_window.set_handler(:ok,     method(:cmd_full))
  588.     @list_window.set_handler(:cancel, method(:return_scene))
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ● サムネイルリスト用のハンドラ登録
  592.   #--------------------------------------------------------------------------
  593.   def set_thum_handler
  594.     @list_window.set_handler(:ok,     method(:cmd_thum))
  595.     @list_window.set_handler(:cancel, method(:cmd_thum))
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # ● フルスクリーン化
  599.   #--------------------------------------------------------------------------
  600.   def cmd_full
  601.     Graphics.freeze
  602.     @full_pict.show.picture(@list_window.item.name)
  603.     perform_transition
  604.     set_thum_handler
  605.     @list_window.activate.cursor_fix = true
  606.   end
  607.   #--------------------------------------------------------------------------
  608.   # ● サムネイル化
  609.   #--------------------------------------------------------------------------
  610.   def cmd_thum
  611.     Graphics.freeze
  612.     @full_pict.hide
  613.     perform_transition
  614.     set_full_handler
  615.     @list_window.activate.cursor_fix = false
  616.   end
  617. end
  618.  
  619.  
  620.  
  621.  
  622.  
  623. #module Title
  624.   # 拡張コマンドへ追加
  625.   #EXCMD[3] = ["画廊", Scene_ExGarally, :garally]
  626.  
  627.   # コマンド画像ファイル(Graphics/System)
  628.   # CMD_GRPHIC[コマンド番号] [画像1, 画像2]
  629.   #CMD_GRPHIC[3] = ["garally",  "garally_s"]
  630. #end
  631.  
  632. #==============================================================================
  633. # ■ Scene_ExGarally
  634. #==============================================================================
  635. class Scene_ExGarally < Scene_Base
  636.   #--------------------------------------------------------------------------
  637.   # ● 呼び出し元のシーンへ戻る
  638.   #--------------------------------------------------------------------------
  639.   def return_scene
  640.     super
  641.     return unless SceneManager.scene_is?(Scene_Title)
  642.     SceneManager.scene.prepare(Title::Scene::S_TITLE, false,
  643.                                Title::CMD_BOX.index(4))
  644.   end
  645. end
  646.  
  647.  
  648. #==============================================================================
  649. # ■ Scene_Title
  650. #==============================================================================
  651. class Scene_Title < Scene_Base
  652.   #--------------------------------------------------------------------------
  653.   # ● メイン
  654.   #--------------------------------------------------------------------------
  655.   alias main_reload main
  656.   def main
  657.     DataManager.load_garally # ギャラリーのリロード
  658.     main_reload
  659.   end
  660. end

点评

这个是脚本冲突的问题..不看到脚本的话我也不确定能够解决.  发表于 2013-3-23 18:39
回复 支持 反对

使用道具 举报

Lv2.观梦者 (暗夜天使)

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
帖子
2309

贵宾

28
 楼主| 发表于 2013-3-23 18:41:55 | 只看该作者
本帖最后由 Sion 于 2013-10-28 18:58 编辑
ayano2k 发表于 2013-3-20 16:34
感谢楼主的脚本,很好用~~
但是这个功能想知道该怎么设置??
  [[  1.3a: 代码小修改;


RUBY 代码复制
  1. =begin ========================================================================
  2.  
  3.   八方移动补丁 置于Sion_Mouse_System脚本下
  4.  
  5.   2013.10.28 v1.2 鼠标2.0+更新修正
  6.   2013.5.3 v1.1 修正斜向触发事件
  7.  
  8. =end #=========================================================================
  9.  
  10. class Game_Player
  11.   # ───────────────────────────────────────
  12.   #  † 八方移动
  13.   # ───────────────────────────────────────
  14.   def move_by_input
  15.     return if !movable? || $game_map.interpreter.running?
  16.     case Input.dir8
  17.     when 2,4,6,8; move_straight(Input.dir8)
  18.     when 1
  19.       if diagonal_passable?(x, y, 4, 2); move_diagonal(4, 2)
  20.       elsif passable?(x, y, 4); move_straight(4)
  21.       else; move_straight(2)
  22.       end
  23.     when 3
  24.       if diagonal_passable?(x, y, 6, 2); move_diagonal(6, 2)
  25.       elsif passable?(x, y, 6); move_straight(6)
  26.       else; move_straight(2)
  27.       end
  28.     when 7
  29.       if diagonal_passable?(x, y, 4, 8); move_diagonal(4, 8)
  30.       elsif passable?(x, y, 4); move_straight(4)
  31.       else; move_straight(8)
  32.       end
  33.     when 9
  34.       if diagonal_passable?(x, y, 6, 8); move_diagonal(6, 8)
  35.       elsif passable?(x, y, 6); move_straight(6)
  36.       else; move_straight(6)
  37.       end
  38.     else;   move_by_mouse
  39.     end
  40.   end
  41.   # ───────────────────────────────────────
  42.   #  † 鼠标八方移动
  43.   # ───────────────────────────────────────
  44.   def move_by_mouse
  45.     unless @mouse_move_path.empty? # 移动路线数组不为空则执行移动
  46.       dir = @mouse_move_path.shift
  47.       if passable?(x, y, dir) && !@mouse_move_path.empty?
  48.         if @mouse_move_path[0] == dir
  49.           move_straight(dir)
  50.         else
  51.           if @mouse_move_path.size == 1 &&
  52.               touch_event?(x, y, dir, @mouse_move_path[0])
  53.             move_straight(dir)
  54.           elsif dir == 4 || dir == 6
  55.             move_diagonal(dir, @mouse_move_path.shift)
  56.           else
  57.             move_diagonal(@mouse_move_path.shift, dir)
  58.           end
  59.         end
  60.       elsif @mouse_move_path.empty? # 判断是否是最后一步
  61.         x2 = $game_map.round_x_with_direction(x, dir)
  62.         y2 = $game_map.round_y_with_direction(y, dir)
  63.         move_straight(dir) unless dir.zero?
  64.         unless x == x2 && y == y2 # 如果移动失败,检查是否启动前方事件、上下载具
  65.           check_event_trigger_there([0,1,2])
  66.           get_on_off_vehicle unless $game_map.setup_starting_event
  67.         end
  68.         $mouse_move_sign.transparent = true if $mouse_move_sign.direction == 2
  69.         @mouse_dash = false
  70.       elsif @mouse_move_path[0].zero? # 目标点无法抵达,调整朝向→目标点
  71.         @mouse_move_path.shift
  72.         @direction = dir
  73.         @mouse_dash = false
  74.       else
  75.         draw_move_path
  76.       end
  77.     end
  78.   end
  79.   def touch_event?(x, y, dir, dir_)
  80.     x = $game_map.round_x_with_direction(
  81.       $game_map.round_x_with_direction(x, dir), dir_)
  82.     y = $game_map.round_y_with_direction(
  83.       $game_map.round_y_with_direction(y, dir), dir_)
  84.     if collide_with_events?(x, y)
  85.       return x, y
  86.     else
  87.       return nil, nil
  88.     end
  89.   end
  90.   # ───────────────────────────────────────
  91.   #  † 步行路径
  92.   # ───────────────────────────────────────
  93.   def draw_walk_path
  94.     # 准备绘制路径表格
  95.     sheet = Table.new($game_map.width, $game_map.height)
  96.     chase_path  = []
  97.     new_end_points = [@moveto_x, @moveto_y]
  98.     sheet[@moveto_x, @moveto_y] = 1
  99.     reach_point = false
  100.     step = 2
  101.     loop do #loop1 开始填充表格
  102.       draw_path = false
  103.       check_points = new_end_points
  104.       new_end_points = []
  105.       break if step > KsOfSion::Break_Steps &&
  106.                !Input.press?(KsOfSion::Find_Path_Key)
  107.       loop do #loop3 从终点开始反向填充
  108.         point_x = check_points.shift
  109.         break if point_x == nil
  110.         point_y = check_points.shift
  111.         # 判断路径是否连通
  112.         if point_x == x && point_y == y
  113.           reach_point = true; break; end
  114.         # 以需要抵达该点的步数填充路径表格 #
  115.         left_x  = $game_map.round_x(point_x - 1)
  116.         right_x = $game_map.round_x(point_x + 1)
  117.         up_y    = $game_map.round_y(point_y - 1)
  118.         down_y  = $game_map.round_y(point_y + 1)
  119.         if sheet[left_x, point_y] == 0              &&
  120.            $game_map.passable?(left_x, point_y, 6)  &&
  121.            !collide_with_events?(left_x, point_y)   &&
  122.            $game_map.passable?(point_x, point_y, 4) &&
  123.            !collide_with_vehicles?(left_x, point_y) #judge_end
  124.           sheet[left_x, point_y] = step
  125.           draw_path = true
  126.           new_end_points.push(left_x, point_y)
  127.         end
  128.         if sheet[right_x, point_y] == 0             &&
  129.            $game_map.passable?(right_x, point_y, 4) &&
  130.            !collide_with_events?(right_x, point_y)  &&
  131.            $game_map.passable?(point_x, point_y, 6) &&
  132.            !collide_with_vehicles?(right_x, point_y)#judge_end
  133.           sheet[right_x, point_y] = step
  134.           draw_path = true
  135.           new_end_points.push(right_x, point_y)
  136.         end
  137.         if sheet[point_x, up_y] == 0                &&
  138.            $game_map.passable?(point_x, up_y, 2)    &&
  139.            !collide_with_events?(point_x, up_y)     &&
  140.            $game_map.passable?(point_x, point_y, 8) &&
  141.            !collide_with_vehicles?(point_x, up_y)   #judge_end
  142.           sheet[point_x, up_y] = step
  143.           draw_path = true
  144.           new_end_points.push(point_x, up_y)
  145.         end
  146.         if sheet[point_x, down_y] == 0              &&
  147.            $game_map.passable?(point_x, down_y, 8)  &&
  148.            !collide_with_events?(point_x, down_y)   &&
  149.            $game_map.passable?(point_x, point_y, 2) &&
  150.            !collide_with_vehicles?(point_x, down_y) #judge_end
  151.           sheet[point_x, down_y] = step
  152.           draw_path = true
  153.           new_end_points.push(point_x, down_y)
  154.         end
  155.       end#endOfLoop3
  156.       break if !draw_path || reach_point
  157.       step += 1
  158.     end #endOfLoop1 路径表格填充完毕
  159.     $mouse_move_sign.transparent = false
  160.     # 判断指定地点能否抵达
  161.     if reach_point
  162.       $mouse_move_sign.direction = 2
  163.     else
  164.       return not_reach_point
  165.     end
  166.     # 根据路径表格绘制最短移动路径(正向)
  167.     step -= 1 # 因为需要再填充一次才能判定是否抵达
  168.     point_x, point_y = x, y
  169.     for i in 2..step
  170.     step -= 1
  171.     if (@moveto_x - point_x).abs < (@moveto_y - point_y).abs
  172.       if    sheet[point_x, $game_map.round_y(point_y + 1)] == step          &&
  173.             $game_map.passable?(point_x, $game_map.round_y(point_y + 1), 8) &&
  174.             $game_map.passable?(point_x, point_y, 2)                #judge_end
  175.         chase_path.push(2)
  176.         point_y = $game_map.round_y(point_y + 1)
  177.       elsif sheet[point_x, $game_map.round_y(point_y - 1)] == step          &&
  178.             $game_map.passable?(point_x, $game_map.round_y(point_y - 1), 2) &&
  179.             $game_map.passable?(point_x, point_y, 8)                #judge_end
  180.         chase_path.push(8)
  181.         point_y = $game_map.round_y(point_y - 1)
  182.       elsif sheet[$game_map.round_x(point_x - 1), point_y] == step          &&
  183.             $game_map.passable?($game_map.round_x(point_x - 1), point_y, 6) &&
  184.             $game_map.passable?(point_x, point_y, 4)                #judge_end
  185.         chase_path.push(4)
  186.         point_x = $game_map.round_x(point_x - 1)
  187.       elsif sheet[$game_map.round_x(point_x + 1), point_y] == step          &&
  188.             $game_map.passable?($game_map.round_x(point_x + 1), point_y, 4) &&
  189.             $game_map.passable?(point_x, point_y, 6)                #judge_end
  190.         chase_path.push(6)
  191.         point_x = $game_map.round_x(point_x + 1)
  192.       end
  193.     else
  194.       if    sheet[$game_map.round_x(point_x - 1), point_y] == step          &&
  195.             $game_map.passable?($game_map.round_x(point_x - 1), point_y, 6) &&
  196.             $game_map.passable?(point_x, point_y, 4)                #judge_end
  197.         chase_path.push(4)
  198.         point_x = $game_map.round_x(point_x - 1)
  199.       elsif sheet[$game_map.round_x(point_x + 1), point_y] == step          &&
  200.             $game_map.passable?($game_map.round_x(point_x + 1), point_y, 4) &&
  201.             $game_map.passable?(point_x, point_y, 6)                #judge_end
  202.         chase_path.push(6)
  203.         point_x = $game_map.round_x(point_x + 1)
  204.       elsif sheet[point_x, $game_map.round_y(point_y + 1)] == step          &&
  205.             $game_map.passable?(point_x, $game_map.round_y(point_y + 1), 8) &&
  206.             $game_map.passable?(point_x, point_y, 2)                #judge_end
  207.         chase_path.push(2)
  208.         point_y = $game_map.round_y(point_y + 1)
  209.       elsif sheet[point_x, $game_map.round_y(point_y - 1)] == step          &&
  210.             $game_map.passable?(point_x, $game_map.round_y(point_y - 1), 2) &&
  211.             $game_map.passable?(point_x, point_y, 8)                #judge_end
  212.         chase_path.push(8)
  213.         point_y = $game_map.round_y(point_y - 1)
  214.       end
  215.     end
  216.     end#endOfForLoop
  217.     return chase_path
  218.   end#walk
  219.   # ───────────────────────────────────────
  220.   #  † boat路径
  221.   # ───────────────────────────────────────
  222.   def draw_boat_path
  223.     # 准备绘制路径表格
  224.     sheet = Table.new($game_map.width, $game_map.height)
  225.     chase_path  = []
  226.     new_end_points = [@moveto_x, @moveto_y]
  227.     sheet[@moveto_x, @moveto_y] = 1
  228.     reach_point = false
  229.     step = 2
  230.     loop do #loop1 开始填充表格
  231.       draw_path = false
  232.       check_points = new_end_points
  233.       new_end_points = []
  234.       break if step > KsOfSion::Break_Steps &&
  235.                !Input.press?(KsOfSion::Find_Path_Key)
  236.       loop do #loop3 从终点开始反向填充
  237.         point_x = check_points.shift
  238.         break if point_x == nil
  239.         point_y = check_points.shift
  240.         left_x  = $game_map.round_x(point_x - 1)
  241.         right_x = $game_map.round_x(point_x + 1)
  242.         up_y    = $game_map.round_y(point_y - 1)
  243.         down_y  = $game_map.round_y(point_y + 1)
  244.         # 判断路径是否连通
  245.         if left_x == x && point_y == y
  246.           reach_point = true; break
  247.         elsif right_x == x && point_y == y
  248.           reach_point = true; break
  249.         elsif point_x == x && up_y == y
  250.           reach_point = true; break
  251.         elsif point_x == x && down_y == y
  252.           reach_point = true; break
  253.         end
  254.         # 以需要抵达该点的步数填充路径表格 #
  255.         if sheet[left_x, point_y] == 0                &&
  256.            $game_map.boat_passable?(left_x, point_y)  &&
  257.            !collide_with_events?(left_x, point_y)     &&
  258.            !collide_with_vehicles?(left_x, point_y)   #judge_end
  259.           sheet[left_x, point_y] = step
  260.           draw_path = true
  261.           new_end_points.push(left_x, point_y)
  262.         end
  263.         if sheet[right_x, point_y] == 0               &&
  264.            $game_map.boat_passable?(right_x, point_y) &&
  265.            !collide_with_events?(right_x, point_y)    &&
  266.            !collide_with_vehicles?(right_x, point_y)  #judge_end
  267.           sheet[right_x, point_y] = step
  268.           draw_path = true
  269.           new_end_points.push(right_x, point_y)
  270.         end
  271.         if sheet[point_x, up_y] == 0                  &&
  272.            $game_map.boat_passable?(point_x, up_y)    &&
  273.            !collide_with_events?(point_x, up_y)       &&
  274.            !collide_with_vehicles?(point_x, up_y)     #judge_end
  275.           sheet[point_x, up_y] = step
  276.           draw_path = true
  277.           new_end_points.push(point_x, up_y)
  278.         end
  279.         if sheet[point_x, down_y] == 0                &&
  280.            $game_map.boat_passable?(point_x, down_y)  &&
  281.            !collide_with_events?(point_x, down_y)     &&
  282.            !collide_with_vehicles?(point_x, down_y)   #judge_end
  283.           sheet[point_x, down_y] = step
  284.           draw_path = true
  285.           new_end_points.push(point_x, down_y)
  286.         end
  287.       end#endOfLoop3
  288.       break if !draw_path || reach_point
  289.       step += 1
  290.     end #endOfLoop1 路径表格填充完毕
  291.     $mouse_move_sign.transparent = false
  292.     # 判断指定地点能否抵达
  293.     if reach_point
  294.       $mouse_move_sign.direction = 2
  295.     else
  296.       return not_reach_point
  297.     end
  298.     # 根据路径表格绘制最短移动路径(正向)
  299.     point_x, point_y = x, y
  300.     for i in 2..step # forLoop
  301.     step -= 1
  302.     if (@moveto_x - point_x).abs < (@moveto_y - point_y).abs
  303.       if    sheet[point_x, $game_map.round_y(point_y + 1)] == step
  304.         chase_path.push(2)
  305.         point_y = $game_map.round_y(point_y + 1)
  306.       elsif sheet[point_x, $game_map.round_y(point_y - 1)] == step
  307.         chase_path.push(8)
  308.         point_y = $game_map.round_y(point_y - 1)
  309.       elsif sheet[$game_map.round_x(point_x - 1), point_y] == step
  310.         chase_path.push(4)
  311.         point_x = $game_map.round_x(point_x - 1)
  312.       elsif sheet[$game_map.round_x(point_x + 1), point_y] == step
  313.         chase_path.push(6)
  314.         point_x = $game_map.round_x(point_x + 1)
  315.       end
  316.     else
  317.       if    sheet[$game_map.round_x(point_x - 1), point_y] == step
  318.         chase_path.push(4)
  319.         point_x = $game_map.round_x(point_x - 1)
  320.       elsif sheet[$game_map.round_x(point_x + 1), point_y] == step
  321.         chase_path.push(6)
  322.         point_x = $game_map.round_x(point_x + 1)
  323.       elsif sheet[point_x, $game_map.round_y(point_y + 1)] == step
  324.         chase_path.push(2)
  325.         point_y = $game_map.round_y(point_y + 1)
  326.       elsif sheet[point_x, $game_map.round_y(point_y - 1)] == step
  327.         chase_path.push(8)
  328.         point_y = $game_map.round_y(point_y - 1)
  329.       end
  330.     end
  331.     end #endOfForLoop
  332.     # 如果指定点无法抵达或者登陆
  333.     return not_reach_point unless landable?(@moveto_x, @moveto_y, chase_path)
  334.     return chase_path
  335.   end#boat
  336.   # ───────────────────────────────────────
  337.   #  † ship路径
  338.   # ───────────────────────────────────────
  339.   def draw_ship_path
  340.     # 准备绘制路径表格
  341.     sheet = Table.new($game_map.width, $game_map.height)
  342.     chase_path  = []
  343.     new_end_points = [@moveto_x, @moveto_y]
  344.     sheet[@moveto_x, @moveto_y] = 1
  345.     reach_point = false
  346.     step = 2
  347.     loop do #loop1 开始填充表格
  348.       draw_path = false
  349.       check_points = new_end_points
  350.       new_end_points = []
  351.       break if step > KsOfSion::Break_Steps &&
  352.                !Input.press?(KsOfSion::Find_Path_Key)
  353.       loop do #loop3 从终点开始反向填充
  354.         point_x = check_points.shift
  355.         break if point_x == nil
  356.         point_y = check_points.shift
  357.         left_x  = $game_map.round_x(point_x - 1)
  358.         right_x = $game_map.round_x(point_x + 1)
  359.         up_y    = $game_map.round_y(point_y - 1)
  360.         down_y  = $game_map.round_y(point_y + 1)
  361.         # 判断路径是否连通
  362.         if left_x == x && point_y == y
  363.           reach_point = true; break
  364.         elsif right_x == x && point_y == y
  365.           reach_point = true; break
  366.         elsif point_x == x && up_y == y
  367.           reach_point = true; break
  368.         elsif point_x == x && down_y == y
  369.           reach_point = true; break
  370.         end
  371.         # 以需要抵达该点的步数填充路径表格 #
  372.         if sheet[left_x, point_y] == 0                &&
  373.            $game_map.ship_passable?(left_x, point_y)  &&
  374.            !collide_with_events?(left_x, point_y)     &&
  375.            !collide_with_vehicles?(left_x, point_y)   #judge_end
  376.           sheet[left_x, point_y] = step
  377.           draw_path = true
  378.           new_end_points.push(left_x, point_y)
  379.         end
  380.         if sheet[right_x, point_y] == 0               &&
  381.            $game_map.ship_passable?(right_x, point_y) &&
  382.            !collide_with_events?(right_x, point_y)    &&
  383.            !collide_with_vehicles?(right_x, point_y)  #judge_end
  384.           sheet[right_x, point_y] = step
  385.           draw_path = true
  386.           new_end_points.push(right_x, point_y)
  387.         end
  388.         if sheet[point_x, up_y] == 0                  &&
  389.            $game_map.ship_passable?(point_x, up_y)    &&
  390.            !collide_with_events?(point_x, up_y)       &&
  391.            !collide_with_vehicles?(point_x, up_y)     #judge_end
  392.           sheet[point_x, up_y] = step
  393.           draw_path = true
  394.           new_end_points.push(point_x, up_y)
  395.         end
  396.         if sheet[point_x, down_y] == 0                &&
  397.            $game_map.ship_passable?(point_x, down_y)  &&
  398.            !collide_with_events?(point_x, down_y)     &&
  399.            !collide_with_vehicles?(point_x, down_y)   #judge_end
  400.           sheet[point_x, down_y] = step
  401.           draw_path = true
  402.           new_end_points.push(point_x, down_y)
  403.         end
  404.       end#endOfLoop3
  405.       break if !draw_path || reach_point
  406.       step += 1
  407.     end #endOfLoop1 路径表格填充完毕
  408.     $mouse_move_sign.transparent = false
  409.     # 判断指定地点能否抵达
  410.     if reach_point
  411.       $mouse_move_sign.direction = 2
  412.     else
  413.       not_reach_point
  414.       return
  415.     end
  416.     # 根据路径表格绘制最短移动路径(正向)
  417.     point_x, point_y = x, y
  418.     for i in 2..step
  419.     step -= 1
  420.     if (@moveto_x - point_x).abs < (@moveto_y - point_y).abs
  421.       if    sheet[point_x, $game_map.round_y(point_y + 1)] == step
  422.         chase_path.push(2)
  423.         point_y = $game_map.round_y(point_y + 1)
  424.       elsif sheet[point_x, $game_map.round_y(point_y - 1)] == step
  425.         chase_path.push(8)
  426.         point_y = $game_map.round_y(point_y - 1)
  427.       elsif sheet[$game_map.round_x(point_x - 1), point_y] == step
  428.         chase_path.push(4)
  429.         point_x = $game_map.round_x(point_x - 1)
  430.       elsif sheet[$game_map.round_x(point_x + 1), point_y] == step
  431.         chase_path.push(6)
  432.         point_x = $game_map.round_x(point_x + 1)
  433.       end
  434.     else
  435.       if    sheet[$game_map.round_x(point_x - 1), point_y] == step
  436.         chase_path.push(4)
  437.         point_x = $game_map.round_x(point_x - 1)
  438.       elsif sheet[$game_map.round_x(point_x + 1), point_y] == step
  439.         chase_path.push(6)
  440.         point_x = $game_map.round_x(point_x + 1)
  441.       elsif sheet[point_x, $game_map.round_y(point_y + 1)] == step
  442.         chase_path.push(2)
  443.         point_y = $game_map.round_y(point_y + 1)
  444.       elsif sheet[point_x, $game_map.round_y(point_y - 1)] == step
  445.         chase_path.push(8)
  446.         point_y = $game_map.round_y(point_y - 1)
  447.       end
  448.     end
  449.     end #endOfForLoop
  450.     # 如果指定点无法抵达或者登陆
  451.     return not_reach_point unless landable?(@moveto_x, @moveto_y, chase_path)
  452.     return chase_path
  453.   end#ship
  454. end

点评

GJ~大感谢阿!!  发表于 2013-3-24 18:37
脚本补在28L了,麻烦抽空帮我看看。多谢了!  发表于 2013-3-24 09:38

评分

参与人数 1星屑 +45 收起 理由
黑舞嗜 + 45 赞美LZ

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
29
发表于 2013-3-25 10:49:22 | 只看该作者
Sion 发表于 2013-3-23 22:41
8方移动补丁,不需要原来那个了,自己写了个。

发生冲突的脚本我补在28L了,麻烦抽空帮我看看是什么问题吧。多谢了!

点评

这个“画廊”脚本要怎么使用呢?  发表于 2013-3-25 14:29
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
帖子
113
30
发表于 2013-3-25 18:37:10 | 只看该作者
tyq4590 发表于 2013-3-25 14:49
发生冲突的脚本我补在28L了,麻烦抽空帮我看看是什么问题吧。多谢了!

1.Graphics\Pictures\里放入和‘module ExGarally’下设定的文件名相同的图片(放一张就可以测试了),比如:
  1  => GFile.new("BlueSky", "123"), 然后在Graphics\Pictures\放一个叫"BlueSky"的图片

2.在事件里添加脚本:DataManager.garally[1] = true 来解锁画廊里的1号图片

3.在事件里添加脚本:SceneManager.call(Scene_ExGarally)来打开画廊(这个时候应该可以看到第一张图片"BlueSky"了,然后用鼠标点该图片会打开大图,就是这个时候会报错跳出)

点评

万分感谢!  发表于 2013-3-28 11:21
附件更新,可以了  发表于 2013-3-26 19:36
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 23:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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