楼主: Sion

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

 火 [复制链接]
梦石
0
星屑
50
在线时间
65 小时
注册时间
2008-5-15
回帖
29
发表于 2013-3-12 20:18:43 | 显示全部楼层
感谢楼主的脚本,确实很好用的说。 再次感谢,但是还是有一小点BUG……谢谢!
回复

使用道具 举报

呼啸的团子

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

点评

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

使用道具 举报

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

点评

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

使用道具 举报

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

贵宾

 楼主| 发表于 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
复制代码
你可以自己试一试效果,放到鼠标脚本以下就行了;一些特殊的菜单还要另外改
回复

使用道具 举报

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

点评

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

使用道具 举报

梦石
0
星屑
50
在线时间
91 小时
注册时间
2011-12-21
回帖
9
发表于 2013-3-20 16:34:50 | 显示全部楼层
本帖最后由 ayano2k 于 2013-3-21 15:57 编辑

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

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

点评

就是 事件编辑里面—流程控制—插入注释 鼠标启动。8向移动的话,你发个可用范例给我:tcsion@163.com  发表于 2013-3-21 08:32
回复

使用道具 举报

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
回帖
103
发表于 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’这一句:

  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. class GFile
  17.   attr_reader :name
  18.   attr_reader :text
  19.   def initialize(filename, text="")
  20.     @name = filename; @text = text
  21.   end
  22. end

  23. module ExGarally
  24.   # 写真の設定
  25.   LIST = {
  26. #  ID => GFile.new("ファイル名(Graphics/Pictures)", 表示文字)
  27.    1  => GFile.new("BlueSky", "青い空\n改行"),
  28.    2  => GFile.new("CloudySky1", "曇った空"),
  29.    3  => GFile.new("CloudySky2"),
  30.    4  => GFile.new("DarkSpace1"),
  31.    5  => GFile.new("DarkSpace2"),
  32.    6  => GFile.new("Mountains1"),
  33.    7  => GFile.new("Mountains2"),
  34.    8  => GFile.new("Mountains3"),
  35.    9  => GFile.new("Mountains4"),
  36.    10 => GFile.new("Mountains5"),
  37.    12 => GFile.new("Ocean2"),
  38.    11 => GFile.new("Ocean1"),
  39.    13 => GFile.new("SeaofClouds"),
  40.    14 => GFile.new("StarlitSky"),
  41. #   15 => GFile.new("Sunset"),
  42.   }
  43.   
  44.   # ヘルプウィンドウの行数(1~3)
  45.   HELP_LINES = 2
  46. end


  47. #==============================================================================
  48. # ■ ExGarally
  49. #==============================================================================
  50. module ExGarally
  51.   #--------------------------------------------------------------------------
  52.   # ● ギャラリーの表示有効?
  53.   #--------------------------------------------------------------------------
  54.   def self.enable?
  55.     DataManager.garally.enable
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● ファイル名
  59.   #--------------------------------------------------------------------------
  60.   def self.filename
  61.     "exgallary.rvdata2"
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● セーブの実行
  65.   #--------------------------------------------------------------------------
  66.   def self.save_exdata(obj)
  67.     save_data(obj, filename)
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● ロードの実行
  71.   #--------------------------------------------------------------------------
  72.   def self.load_exdata
  73.     exist? ? load_data(filename) : Game_ExGarallyList.new
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● ファイル削除
  77.   #--------------------------------------------------------------------------
  78.   def self.delete_exdata
  79.     return unless exist?
  80.     File.delete(filename) rescue nil
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● ファイルの有無チェック
  84.   #--------------------------------------------------------------------------
  85.   def self.exist?
  86.     FileTest.exist?(filename)
  87.   end
  88. end


  89. #==============================================================================
  90. # ■ DataManager
  91. #==============================================================================
  92. class << DataManager
  93.   #--------------------------------------------------------------------------
  94.   # ● 各種ゲームオブジェクトの作成
  95.   #--------------------------------------------------------------------------
  96.   alias create_game_objects_exgrly create_game_objects
  97.   def create_game_objects
  98.     create_game_objects_exgrly
  99.     load_garally
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● セーブの実行
  103.   #--------------------------------------------------------------------------
  104.   alias save_game_exgarally save_game
  105.   def save_game(index)
  106.     r = save_game_exgarally(index)
  107.     save_garally if r
  108.     r
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● ロードの実行
  112.   #--------------------------------------------------------------------------
  113.   alias load_game_exgrly load_game
  114.   def load_game(index)
  115.     r = load_game_exgrly(index)
  116.     load_garally if r
  117.     r
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● ギャラリー情報load
  121.   #--------------------------------------------------------------------------
  122.   def load_garally
  123.     @exgarally = ExGarally.load_exdata
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● ギャラリー情報load
  127.   #--------------------------------------------------------------------------
  128.   def save_garally
  129.     ExGarally.save_exdata(@exgarally)
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● ギャラリー情報削除
  133.   #--------------------------------------------------------------------------
  134.   def delete_garally
  135.     ExGarally.delete_exdata
  136.     load_garally
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● ギャラリー情報参照
  140.   #--------------------------------------------------------------------------
  141.   def garally
  142.     @exgarally
  143.   end
  144. end


  145. #==============================================================================
  146. # ■ Game_ExGarally
  147. #==============================================================================
  148. class Game_ExGarally
  149.   attr_accessor :name   # ファイル名
  150.   attr_accessor :text   # 表示文字
  151.   attr_accessor :enable # 表示可否
  152.   #--------------------------------------------------------------------------
  153.   # ● オブジェクト初期化
  154.   #--------------------------------------------------------------------------
  155.   def initialize(file, enable=false)
  156.     @name   = file.name
  157.     @text   = file.text
  158.     @enable = enable
  159.   end
  160. end

  161. #==============================================================================
  162. # ■ Game_ExGarallyList  : DataManager.garallyで参照可能
  163. #==============================================================================
  164. class Game_ExGarallyList
  165.   LIST = ExGarally::LIST
  166.   attr_accessor :enable
  167.   attr_reader   :size
  168.   #--------------------------------------------------------------------------
  169.   # ● オブジェクト初期化
  170.   #--------------------------------------------------------------------------
  171.   def initialize
  172.     clear
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● クリア
  176.   #--------------------------------------------------------------------------
  177.   def clear
  178.     @size = LIST.size
  179.     @data = {}
  180.     @enable = false
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ● 参照
  184.   #--------------------------------------------------------------------------
  185.   def [](id)
  186.     return nil if LIST[id].nil? and @data[id].nil?
  187.     return Game_ExGarally.new(LIST[id]) if @data[id].nil?
  188.     @data[id]
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 表示許可/禁止
  192.   #--------------------------------------------------------------------------
  193.   def []=(id, val)
  194.     return nil if LIST[id].nil? and @data[id].nil?
  195.     if val
  196.       @data[id] = Game_ExGarally.new(LIST[id]) if @data[id].nil?
  197.       @data[id].enable = true
  198.     elsif !@data[id].nil?
  199.       @data.delete(id)
  200.     end
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● リスト
  204.   #--------------------------------------------------------------------------
  205.   def list
  206.     (@data.keys+LIST.keys).uniq.sort.collect {|id| self.[](id) }
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # ● 追加ギャラリー
  210.   #--------------------------------------------------------------------------
  211.   def push(id, name, enable=true)
  212.     @data[id] = Game_ExGarally.new(name, enable)
  213.     @size += 1 if LIST[id].nil?
  214.   end
  215. end


  216. #==============================================================================
  217. # ■ Sprite_ExGrlyPicture
  218. #==============================================================================
  219. class Sprite_ExGrlyPicture < Sprite
  220.   #--------------------------------------------------------------------------
  221.   # ● オブジェクト初期化
  222.   #--------------------------------------------------------------------------
  223.   def initialize(rect=Rect.new(0,0,Graphics.width,Graphics.height))
  224.     super(Viewport.new(rect))
  225.     viewport.z = 100
  226.     create_bitmap
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● オブジェクト解放
  230.   #--------------------------------------------------------------------------
  231.   def dispose
  232.     dispose_bitmap
  233.     super
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ● ビットマップ生成
  237.   #--------------------------------------------------------------------------
  238.   def create_bitmap
  239.     self.bitmap = Bitmap.new(vw, vh)
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● ビットマップ下方
  243.   #--------------------------------------------------------------------------
  244.   def dispose_bitmap
  245.     self.bitmap.dispose
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ● ピクチャ設定
  249.   #--------------------------------------------------------------------------
  250.   def picture(filename, enabled=true)
  251.     dispose_bitmap
  252.     if enabled
  253.       self.bitmap = Cache.picture(filename)
  254.     else
  255.       create_bitmap
  256.       self.bitmap.fill_rect(0,0,vw,vh,Color.new(0,0,0,160))
  257. #      self.bitmap.draw_text(0,0, vw, vh, filename, 1)
  258.     end
  259.     fit_screen
  260.     resize
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● ズーム倍率再設定
  264.   #--------------------------------------------------------------------------
  265.   def resize(r=Rect.new(0,0,vw,vh))
  266.     self.ox = bitmap.width  / 2
  267.     self.oy = bitmap.height / 2
  268.     self.x = r.width  / 2 + r.x
  269.     self.y = r.height / 2 + r.y
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ● 画面にフィットさせる
  273.   #--------------------------------------------------------------------------
  274.   def bwz;  (bitmap.width * zoom_x).truncate; end # ズーム後のbitmap幅
  275.   def bhz;  (bitmap.height* zoom_y).truncate; end # ズーム後のbitmap高さ
  276.   def vw;   viewport.rect.width;   end
  277.   def vh;   viewport.rect.height;  end
  278.   def fit_screen(w=vw, h=vh)
  279.     x_zoom = w * 1.0 / bitmap.width
  280.     y_zoom = h * 1.0 / bitmap.height
  281.     zoom = x_zoom < y_zoom ? x_zoom : y_zoom
  282.     self.zoom_x = self.zoom_y = zoom
  283.   end
  284. end


  285. #==============================================================================
  286. # ■ Sprite_ExGrlyPicture
  287. #==============================================================================
  288. class Sprite_ExGrlyPictFull < Sprite_ExGrlyPicture
  289.   #--------------------------------------------------------------------------
  290.   # ● オブジェクト初期化
  291.   #--------------------------------------------------------------------------
  292.   def initialize
  293.     super
  294.     hide.viewport.z = 200
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● ウィンドウの表示
  298.   #--------------------------------------------------------------------------
  299.   def show
  300.     self.visible = true
  301.     self
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● ウィンドウの非表示
  305.   #--------------------------------------------------------------------------
  306.   def hide
  307.     self.visible = false
  308.     self
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● ピクチャ設定
  312.   #--------------------------------------------------------------------------
  313.   def picture(filename, enabled=true)
  314.     dispose_bitmap
  315.     b = Cache.picture(filename)
  316.     r = Rect.new(0, 0, b.width, b.height)
  317.     self.bitmap = Bitmap.new(r.width, r.height)
  318.     self.bitmap.stretch_blt(r, b, r)
  319.     fit_screen
  320.     resize
  321.   end
  322. end

  323. #==============================================================================
  324. # ■ Grly_Thumbnail
  325. #==============================================================================
  326. class Grly_Thumbnail
  327.   attr_reader :item
  328.   attr_reader :rect
  329.   #--------------------------------------------------------------------------
  330.   # ● オブジェクト初期化
  331.   #--------------------------------------------------------------------------
  332.   def initialize(item, rect)
  333.     @item = item; @rect = rect
  334.   end
  335. end

  336. #==============================================================================
  337. # ■ SpritesetExGrlyPictures
  338. #==============================================================================
  339. class SpritesetExGrlyPictures
  340.   #--------------------------------------------------------------------------
  341.   # ● オブジェクト初期化
  342.   #--------------------------------------------------------------------------
  343.   def initialize
  344.     @sprites = []
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● オブジェクト解放
  348.   #--------------------------------------------------------------------------
  349.   def dispose
  350.     dispose_sprites
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● ピクチャスプライト生成
  354.   #--------------------------------------------------------------------------
  355.   def create_sprites(thumnails)
  356.     thumnails.each do |thm|
  357.       s = Sprite_ExGrlyPicture.new(thm.rect)
  358.       s.picture(thm.item.name, thm.item.enable)
  359.       @sprites.push(s)
  360.     end
  361.   end
  362.   #--------------------------------------------------------------------------
  363.   # ● ピクチャスプライト解放
  364.   #--------------------------------------------------------------------------
  365.   def dispose_sprites
  366.     @sprites.each { |s| s.dispose }
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # ● ピクチャスプライト更新
  370.   #--------------------------------------------------------------------------
  371.   def update_sprites(thumnails)
  372.     dispose_sprites
  373.     create_sprites(thumnails)
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● サムネイル矩形
  377.   #--------------------------------------------------------------------------
  378.   def thm_rect(i)
  379.     @sprites[i].nil? ? nil : @sprites[i].thm
  380.   end
  381. end


  382. #==============================================================================
  383. # ■ Window_GrlyPicture
  384. #==============================================================================
  385. class Window_GrlyPicture < Window_Selectable
  386.   attr_accessor :thum_sprites
  387.   #--------------------------------------------------------------------------
  388.   # ● オブジェクト初期化
  389.   #--------------------------------------------------------------------------
  390.   def initialize
  391.     @thum_sprites = nil
  392.     make_list
  393.     super(0, help_height, Graphics.width, Graphics.height-help_height)
  394.     activate
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● ヘルプウィンドウの高さ
  398.   #--------------------------------------------------------------------------
  399.   def help_height
  400.     fitting_height(ExGarally::HELP_LINES)
  401.   end
  402.   #--------------------------------------------------------------------------
  403.   # ● 桁数の取得
  404.   #--------------------------------------------------------------------------
  405.   def col_max
  406.     return 3
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # ● 横に項目が並ぶときの空白の幅を取得
  410.   #--------------------------------------------------------------------------
  411.   def spacing
  412.     return 16
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 項目数の取得
  416.   #--------------------------------------------------------------------------
  417.   def item_max
  418.     DataManager.garally.size
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● 項目の高さを取得
  422.   #--------------------------------------------------------------------------
  423.   def item_height
  424.     (Graphics.height - help_height - standard_padding * 2) / 2
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # ● 項目を描画する矩形の取得
  428.   #--------------------------------------------------------------------------
  429.   def item_rect(index)
  430.     rect = super(index)
  431.     thm  = calc_thm_rect
  432.     rect.x += (rect.width  - (thm.width  + 8)) / 2
  433.     rect.y += (rect.height - (thm.height + 8)) / 2
  434.     rect.width  = thm.width  + 8
  435.     rect.height = thm.height + 8
  436.     rect
  437.   end
  438.   #--------------------------------------------------------------------------
  439.   # ● サムネイル矩形計算
  440.   #--------------------------------------------------------------------------
  441.   def calc_thm_rect
  442.     r = Rect.new
  443.     r.width  = item_width  - 8
  444.     r.height = item_height - 8
  445.     if (Graphics.width  / r.width) > (Graphics.height / r.height)
  446.       r.height = r.width  * Graphics.height / Graphics.width
  447.     else
  448.       r.width  = r.height * Graphics.width  / Graphics.height
  449.     end
  450.     r
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # ● サムネイルの表示位置を取得
  454.   #--------------------------------------------------------------------------
  455.   def thum_rect(index)
  456.     r = item_rect_for_text(index)
  457.     r.x += self.x + standard_padding
  458.     r.y += self.y + standard_padding
  459.     r
  460.   end
  461.   #--------------------------------------------------------------------------
  462.   # ● 先頭行のindex
  463.   #--------------------------------------------------------------------------
  464.   def top_i
  465.     (top_row * col_max)
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # ● 先頭行からの@index
  469.   #--------------------------------------------------------------------------
  470.   def top_cur_i
  471.     (@index - (top_row * col_max))
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # ● サムネイルの表示位置を取得
  475.   #--------------------------------------------------------------------------
  476.   def thumnails
  477.     n = [page_item_max, item_max - top_i].min
  478.     idxs = []
  479.     n.times { |i| idxs.push(i) }
  480.     idxs.collect { |i| Grly_Thumbnail.new(@list[i+top_i], thum_rect(i)) }
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ● リスト生成
  484.   #--------------------------------------------------------------------------
  485.   def make_list
  486.     @list = DataManager.garally.list
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ● 選択中アイテム
  490.   #--------------------------------------------------------------------------
  491.   def item
  492.     @list[@index]
  493.   end
  494.   #--------------------------------------------------------------------------
  495.   # ● 選択項目の有効状態を取得
  496.   #--------------------------------------------------------------------------
  497.   def current_item_enabled?
  498.     !item.nil? and item.enable
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # ● ヘルプテキスト更新
  502.   #--------------------------------------------------------------------------
  503.   def update_help
  504.     text = ((!item.nil? and item.enable) ? item.text : "")
  505.     @help_window.set_text(text)
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ● カーソルの更新
  509.   #--------------------------------------------------------------------------
  510.   def update_cursor
  511.     super
  512.     @thum_sprites.update_sprites(thumnails) unless @thum_sprites.nil?
  513.   end
  514. end



  515. #==============================================================================
  516. # ■ Scene_ExGarally
  517. #==============================================================================
  518. class Scene_ExGarally < Scene_Base
  519.   #--------------------------------------------------------------------------
  520.   # ● 開始処理
  521.   #--------------------------------------------------------------------------
  522.   def start
  523.     super
  524.     create_background
  525.     @help_window = Window_Help.new(ExGarally::HELP_LINES)
  526.     @thumset = SpritesetExGrlyPictures.new
  527.     @full_pict = Sprite_ExGrlyPictFull.new
  528.     create_list_window
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● 終了処理
  532.   #--------------------------------------------------------------------------
  533.   def terminate
  534.     super
  535.     dispose_background
  536.     @thumset.dispose
  537.     @full_pict.dispose
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● 背景の作成
  541.   #--------------------------------------------------------------------------
  542.   def create_background
  543.     @background_sprite = Sprite.new
  544.     @background_sprite.bitmap = SceneManager.background_bitmap
  545.     @background_sprite.color.set(16, 16, 16, 128)
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ● 背景の解放
  549.   #--------------------------------------------------------------------------
  550.   def dispose_background
  551.     @background_sprite.dispose
  552.   end
  553.   #--------------------------------------------------------------------------
  554.   # ● ピクチャリストウィンドウ生成
  555.   #--------------------------------------------------------------------------
  556.   def create_list_window
  557.     @list_window = Window_GrlyPicture.new
  558.     @list_window.thum_sprites = @thumset
  559.     @list_window.help_window = @help_window
  560.     set_full_handler
  561.     @list_window.select(0)
  562.   end
  563.   #--------------------------------------------------------------------------
  564.   # ● フルスクリーン化用のハンドラ登録
  565.   #--------------------------------------------------------------------------
  566.   def set_full_handler
  567.     @list_window.set_handler(:ok,     method(:cmd_full))
  568.     @list_window.set_handler(:cancel, method(:return_scene))
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● サムネイルリスト用のハンドラ登録
  572.   #--------------------------------------------------------------------------
  573.   def set_thum_handler
  574.     @list_window.set_handler(:ok,     method(:cmd_thum))
  575.     @list_window.set_handler(:cancel, method(:cmd_thum))
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● フルスクリーン化
  579.   #--------------------------------------------------------------------------
  580.   def cmd_full
  581.     Graphics.freeze
  582.     @full_pict.show.picture(@list_window.item.name)
  583.     perform_transition
  584.     set_thum_handler
  585.     @list_window.activate.cursor_fix = true
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● サムネイル化
  589.   #--------------------------------------------------------------------------
  590.   def cmd_thum
  591.     Graphics.freeze
  592.     @full_pict.hide
  593.     perform_transition
  594.     set_full_handler
  595.     @list_window.activate.cursor_fix = false
  596.   end
  597. end





  598. #module Title
  599.   # 拡張コマンドへ追加
  600.   #EXCMD[3] = ["画廊", Scene_ExGarally, :garally]

  601.   # コマンド画像ファイル(Graphics/System)
  602.   # CMD_GRPHIC[コマンド番号] [画像1, 画像2]
  603.   #CMD_GRPHIC[3] = ["garally",  "garally_s"]
  604. #end

  605. #==============================================================================
  606. # ■ Scene_ExGarally
  607. #==============================================================================
  608. class Scene_ExGarally < Scene_Base
  609.   #--------------------------------------------------------------------------
  610.   # ● 呼び出し元のシーンへ戻る
  611.   #--------------------------------------------------------------------------
  612.   def return_scene
  613.     super
  614.     return unless SceneManager.scene_is?(Scene_Title)
  615.     SceneManager.scene.prepare(Title::Scene::S_TITLE, false,
  616.                                Title::CMD_BOX.index(4))
  617.   end
  618. end


  619. #==============================================================================
  620. # ■ Scene_Title
  621. #==============================================================================
  622. class Scene_Title < Scene_Base
  623.   #--------------------------------------------------------------------------
  624.   # ● メイン
  625.   #--------------------------------------------------------------------------
  626.   alias main_reload main
  627.   def main
  628.     DataManager.load_garally # ギャラリーのリロード
  629.     main_reload
  630.   end
  631. end
复制代码

点评

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

使用道具 举报

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

贵宾

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

  1. =begin ========================================================================

  2.   八方移动补丁 置于Sion_Mouse_System脚本下

  3.   2013.10.28 v1.2 鼠标2.0+更新修正
  4.   2013.5.3 v1.1 修正斜向触发事件
  5.   
  6. =end #=========================================================================

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

点评

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

评分

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

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
回帖
103
发表于 2013-3-25 10:49:22 | 显示全部楼层
Sion 发表于 2013-3-23 22:41
8方移动补丁,不需要原来那个了,自己写了个。

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

点评

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

使用道具 举报

梦石
0
星屑
50
在线时间
381 小时
注册时间
2012-8-13
回帖
103
发表于 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
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部