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

Project1

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

[已经解决] 求教:脚本出错!

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2012-9-14
帖子
8
跳转到指定楼层
1
发表于 2012-9-18 00:08:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 wei19840826 于 2012-9-18 22:39 编辑

下载了这个整合系统 http://rpg.blue/thread-243669-1-1.html
开始游戏就跳错误框
完全不懂脚本 求破!!!!
  1. #==============================================================================
  2. # ■ Game_Character_re
  3. #------------------------------------------------------------------------------
  4. #  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
  5. # クラスのスーパークラスとして使用されます。(再定義)
  6. #==============================================================================

  7. class Game_Character
  8.   #--------------------------------------------------------------------------
  9.   # ● キャラクター衝突判定
  10.   #     x : X 座標
  11.   #     y : Y 座標
  12.   #    プレイヤーと乗り物を含め、通常キャラの衝突を検出する。
  13.   #--------------------------------------------------------------------------
  14.   def collide_with_characters?(x, y)
  15.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  16.       unless event.through                          # すり抜け OFF?
  17.         return true if self.is_a?(Game_Event)       # 自分がイベント
  18.         return true if event.priority_type == 1     # 相手が通常キャラ
  19.       end
  20.     end
  21.     if @priority_type == 1                          # 自分が通常キャラ
  22.       return true if $game_player.pos_nt?(x, y)     # プレイヤーの座標と一致
  23.       return true if $game_subplayer1.pos_nt?(x,y)  # サブプレイヤーの座標と一致#追加
  24.       return true if $game_subplayer2.pos_nt?(x,y)  # サブプレイヤーの座標と一致#追加
  25.       return true if $game_subplayer3.pos_nt?(x,y)  # サブプレイヤーの座標と一致#追加
  26.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  27.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  28.     end
  29.     return false
  30.   end
  31. end

  32. #==============================================================================
  33. # ■ Game_Player_re
  34. #------------------------------------------------------------------------------
  35. #  プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
  36. # 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
  37. # (再定義)
  38. #==============================================================================

  39. class Game_Player < Game_Character
  40.   #--------------------------------------------------------------------------
  41.   # ● 公開インスタンス変数
  42.   #--------------------------------------------------------------------------
  43.   attr_reader   :gather_on          # メンバー集合フラグ   #追加
  44.   attr_reader   :member             # 強制動作を行うプレイヤー番号(0:全員)#追加
  45.   #--------------------------------------------------------------------------
  46.   # ● オブジェクト初期化
  47.   #--------------------------------------------------------------------------
  48.   def initialize
  49.     super
  50.     @vehicle_type = -1
  51.     @vehicle_getting_on = false     # 乗る動作の途中フラグ
  52.     @vehicle_getting_off = false    # 降りる動作の途中フラグ
  53.     @transferring = false           # 場所移動フラグ
  54.     @new_map_id = 0                 # 移動先 マップ ID
  55.     @new_x = 0                      # 移動先 X 座標
  56.     @new_y = 0                      # 移動先 Y 座標
  57.     @new_direction = 0              # 移動後の向き
  58.     @walking_bgm = nil              # 歩行時の BGM 記憶用
  59.     @gather_on = false              # 追加
  60.     @gather_count = 0               # 集合用カウンター   #追加
  61.     @member = 0
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● リフレッシュ
  65.   #--------------------------------------------------------------------------
  66.   def refresh
  67.     if $game_party.members.size == 0
  68.       @character_name = ""
  69.       @character_index = 0
  70.     else
  71.       actor = $game_party.members[0]   # 先頭のアクターを取得
  72.       @character_name = actor.character_name
  73.       @character_index = actor.character_index
  74.     end
  75.       $game_subplayer1.refresh(1)#追加
  76.       $game_subplayer2.refresh(2)#追加
  77.       $game_subplayer3.refresh(3)#追加
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● 乗り物の処理
  81.   #--------------------------------------------------------------------------
  82.   def update_vehicle
  83.     return unless in_vehicle?
  84.     vehicle = $game_map.vehicles[@vehicle_type]
  85.     if @vehicle_getting_on                    # 乗る途中?
  86.       if not moving?
  87.         @direction = vehicle.direction        # 向きを変更
  88.         @move_speed = vehicle.speed           # 移動速度を変更
  89.         @vehicle_getting_on = false           # 乗る動作終了
  90.         @transparent = true                   # 透明化
  91.         $game_subplayer1.transparent = true    # 透明化    #追加
  92.         $game_subplayer2.transparent = true    # 透明化    #追加
  93.         $game_subplayer3.transparent = true    # 透明化    #追加
  94.       end
  95.     elsif @vehicle_getting_off                # 降りる途中?
  96.       if not moving? and vehicle.altitude == 0
  97.         @vehicle_getting_off = false          # 降りる動作終了
  98.         @vehicle_type = -1                    # 乗り物タイプ消去
  99.         @transparent = false                  # 透明を解除
  100.         $game_subplayer1.moveto($game_player.x,$game_player.y)      #追加
  101.         $game_subplayer1.transparent = false      # 透明を解除      #追加
  102.         $game_subplayer2.moveto($game_player.x,$game_player.y)      #追加
  103.         $game_subplayer2.transparent = false      # 透明を解除      #追加
  104.         $game_subplayer3.moveto($game_player.x,$game_player.y)      #追加
  105.         $game_subplayer3.transparent = false      # 透明を解除      #追加
  106.       end
  107.     else                                      # 乗り物に乗っている
  108.       vehicle.sync_with_player                # プレイヤーと同時に動かす
  109.     end
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # ● 乗り物から降りる
  113.   #    現在乗り物に乗っていることが前提。
  114.   #--------------------------------------------------------------------------
  115.   def get_off_vehicle
  116.     if in_airship?                                # 飛行船
  117.       return unless airship_land_ok?(@x, @y)      # 着陸できない?
  118.     else                                          # 小型船・大型船
  119.       front_x = $game_map.x_with_direction(@x, @direction)
  120.       front_y = $game_map.y_with_direction(@y, @direction)
  121.       return unless can_walk?(front_x, front_y)   # 接岸できない?
  122.     end
  123.     $game_map.vehicles[@vehicle_type].get_off     # 降りる処理
  124.     if in_airship?                                # 飛行船
  125.       @direction = 2                              # 下を向く
  126.     else                                          # 小型船・大型船
  127.       force_move_forward                          # 一歩前進
  128.       @transparent = false                        # 透明を解除
  129.     end
  130.     @vehicle_getting_off = true                   # 降りる動作の開始
  131.     @move_speed = 4                               # 移動速度を戻す
  132.     $game_subplayer1.move_speed = 4               # 移動速度を戻す# 追加
  133.     $game_subplayer2.move_speed = 4               # 移動速度を戻す# 追加
  134.     $game_subplayer3.move_speed = 4               # 移動速度を戻す# 追加
  135.     @through = false                              # すり抜け OFF
  136.     @walking_bgm.play                             # 歩行時の BGM 復帰
  137.     make_encounter_count                          # エンカウント初期化
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 下に移動
  141.   #     turn_ok : その場での向き変更を許可
  142.   #--------------------------------------------------------------------------
  143.   def move_down(turn_ok = true)
  144.     pos = []                                #追加
  145.     if passable?(@x, @y+1)                  # 通行可能
  146.       turn_down
  147.       pos.push(@x,@y)                          #追加
  148.       @y = $game_map.round_y(@y+1)
  149.       @real_y = (@y-1)*256
  150.       $game_subplayer1.move(pos)            #追加
  151.       increase_steps
  152.       @move_failed = false
  153.     else                                    # 通行不可能
  154.       turn_down if turn_ok
  155.       check_event_trigger_touch(@x, @y+1)   # 接触イベントの起動判定
  156.       @move_failed = true
  157.     end
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 左に移動
  161.   #     turn_ok : その場での向き変更を許可
  162.   #--------------------------------------------------------------------------
  163.   def move_left(turn_ok = true)
  164.     pos = []                                #追加
  165.     if passable?(@x-1, @y)                  # 通行可能
  166.       turn_left
  167.       pos.push(@x,@y)                          #追加
  168.       @x = $game_map.round_x(@x-1)
  169.       @real_x = (@x+1)*256
  170.       $game_subplayer1.move(pos)            #追加
  171.       increase_steps
  172.       @move_failed = false
  173.     else                                    # 通行不可能
  174.       turn_left if turn_ok
  175.       check_event_trigger_touch(@x-1, @y)   # 接触イベントの起動判定
  176.       @move_failed = true
  177.     end
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 右に移動
  181.   #     turn_ok : その場での向き変更を許可
  182.   #--------------------------------------------------------------------------
  183.   def move_right(turn_ok = true)
  184.     pos = []                                #追加
  185.     if passable?(@x+1, @y)                  # 通行可能
  186.       turn_right
  187.       pos.push(@x,@y)                          #追加
  188.       @x = $game_map.round_x(@x+1)
  189.       @real_x = (@x-1)*256
  190.       $game_subplayer1.move(pos)            #追加
  191.       increase_steps
  192.       @move_failed = false
  193.     else                                    # 通行不可能
  194.       turn_right if turn_ok
  195.       check_event_trigger_touch(@x+1, @y)   # 接触イベントの起動判定
  196.       @move_failed = true
  197.     end
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● 上に移動
  201.   #     turn_ok : その場での向き変更を許可
  202.   #--------------------------------------------------------------------------
  203.   def move_up(turn_ok = true)
  204.     pos = []                                #追加
  205.     if passable?(@x, @y-1)                  # 通行可能
  206.       turn_up
  207.       pos.push(@x,@y)                          #追加
  208.       @y = $game_map.round_y(@y-1)
  209.       @real_y = (@y+1)*256
  210.       $game_subplayer1.move(pos)            #追加
  211.       increase_steps
  212.       @move_failed = false
  213.     else                                    # 通行不可能
  214.       turn_up if turn_ok
  215.       check_event_trigger_touch(@x, @y-1)   # 接触イベントの起動判定
  216.       @move_failed = true
  217.     end
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 左下に移動
  221.   #--------------------------------------------------------------------------
  222.   def move_lower_left
  223.     pos = []                                #追加
  224.     unless @direction_fix
  225.       @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
  226.     end
  227.     if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
  228.        (passable?(@x-1, @y) and passable?(@x-1, @y+1))
  229.       pos.push(@x,@y)                          #追加
  230.       @x -= 1
  231.       @y += 1
  232.       $game_subplayer1.move(pos)            #追加
  233.       increase_steps
  234.       @move_failed = false
  235.     else
  236.       @move_failed = true
  237.     end
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 右下に移動
  241.   #--------------------------------------------------------------------------
  242.   def move_lower_right
  243.     pos = []                                #追加
  244.     unless @direction_fix
  245.       @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
  246.     end
  247.     if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
  248.        (passable?(@x+1, @y) and passable?(@x+1, @y+1))
  249.       pos.push(@x,@y)                          #追加
  250.       @x += 1
  251.       @y += 1
  252.       $game_subplayer1.move(pos)            #追加
  253.       increase_steps
  254.       @move_failed = false
  255.     else
  256.       @move_failed = true
  257.     end
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # ● 左上に移動
  261.   #--------------------------------------------------------------------------
  262.   def move_upper_left
  263.     pos = []                                #追加
  264.     unless @direction_fix
  265.       @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
  266.     end
  267.     if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
  268.        (passable?(@x-1, @y) and passable?(@x-1, @y-1))
  269.       pos.push(@x,@y)                          #追加
  270.       @x -= 1
  271.       @y -= 1
  272.       $game_subplayer1.move(pos)            #追加
  273.       increase_steps
  274.       @move_failed = false
  275.     else
  276.       @move_failed = true
  277.     end
  278.   end
  279.   #--------------------------------------------------------------------------
  280.   # ● 右上に移動
  281.   #--------------------------------------------------------------------------
  282.   def move_upper_right
  283.     pos = []                                #追加
  284.     unless @direction_fix
  285.       @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
  286.     end
  287.     if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
  288.        (passable?(@x+1, @y) and passable?(@x+1, @y-1))
  289.       pos.push(@x,@y)                          #追加
  290.       @x += 1
  291.       @y -= 1
  292.       $game_subplayer1.move(pos)            #追加
  293.       increase_steps
  294.       @move_failed = false
  295.     else
  296.       @move_failed = true
  297.     end
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ● キャラクター衝突判定
  301.   #     x : X 座標
  302.   #     y : Y 座標
  303.   #--------------------------------------------------------------------------
  304.   def collide_with_characters?(x, y)
  305.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  306.       unless event.through                          # すり抜け OFF?
  307.         return true if self.is_a?(Game_Event)       # 自分がイベント
  308.         return true if event.priority_type == 1     # 相手が通常キャラ
  309.       end
  310.     end
  311.     if @priority_type == 1                          # 自分が通常キャラ
  312.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  313.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  314.     end
  315.     return false
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 移動タイプ : カスタム
  319.   #--------------------------------------------------------------------------
  320.   def move_type_custom
  321.     if stopping?
  322.       command = @move_route.list[@move_route_index]   # 移動コマンドを取得
  323.       @move_failed = false
  324.       if command.code == 0                            # リストの最後
  325.         if @move_route.repeat                         # [動作を繰り返す]
  326.           @move_route_index = 0
  327.         elsif @move_route_forcing                     # 移動ルート強制中
  328.           @move_route_forcing = false                 # 強制を解除
  329.           @move_route = @original_move_route          # オリジナルを復帰
  330.           @move_route_index = @original_move_route_index
  331.           @original_move_route = nil
  332.         end
  333.       else
  334.         case command.code
  335.         when 1    # 下に移動
  336.           move_down
  337.         when 2    # 左に移動
  338.           move_left
  339.         when 3    # 右に移動
  340.           move_right
  341.         when 4    # 上に移動
  342.           move_up
  343.         when 5    # 左下に移動
  344.           move_lower_left
  345.         when 6    # 右下に移動
  346.           move_lower_right
  347.         when 7    # 左上に移動
  348.           move_upper_left
  349.         when 8    # 右上に移動
  350.           move_upper_right
  351.         when 9    # ランダムに移動
  352.           move_random
  353.         when 10   # プレイヤーに近づく
  354.           move_toward_player
  355.         when 11   # プレイヤーから遠ざかる
  356.           move_away_from_player
  357.         when 12   # 一歩前進
  358.           move_forward
  359.         when 13   # 一歩後退
  360.           move_backward
  361.         when 14   # ジャンプ
  362.           #以下変更
  363.           if command.parameters[0]==0 && command.parameters[1]==0
  364.             if @member==1
  365.               jump(command.parameters[0], command.parameters[1])
  366.             elsif @member==2
  367.               $game_subplayer1.jump(command.parameters[0], command.parameters[1])
  368.             elsif @member==3
  369.               $game_subplayer2.jump(command.parameters[0], command.parameters[1])
  370.             elsif @member==4
  371.               $game_subplayer3.jump(command.parameters[0], command.parameters[1])
  372.             elsif @member==0
  373.               $game_subplayer3.jump(command.parameters[0], command.parameters[1])
  374.               $game_subplayer2.jump(command.parameters[0], command.parameters[1])
  375.               $game_subplayer1.jump(command.parameters[0], command.parameters[1])
  376.               jump(command.parameters[0], command.parameters[1])
  377.             end
  378.           else
  379.             $game_subplayer3.jump(command.parameters[0], command.parameters[1])
  380.             $game_subplayer2.jump(command.parameters[0], command.parameters[1])
  381.             $game_subplayer1.jump(command.parameters[0], command.parameters[1])
  382.             jump(command.parameters[0], command.parameters[1])
  383.           end
  384.           #ここまで
  385.         when 15   # ウェイト
  386.           @wait_count = command.parameters[0] - 1
  387.         when 16   # 下を向く
  388.           #以下変更
  389.           if @member==1
  390.             turn_down
  391.           elsif @member==2
  392.             $game_subplayer1.turn_down
  393.           elsif @member==3
  394.             $game_subplayer2.turn_down
  395.           elsif @member==4
  396.             $game_subplayer3.turn_down
  397.           elsif @member==0
  398.             $game_subplayer3.turn_down
  399.             $game_subplayer2.turn_down
  400.             $game_subplayer1.turn_down
  401.             turn_down
  402.           end
  403.           #ここまで
  404.         when 17   # 左を向く
  405.           #以下変更
  406.           if @member==1
  407.             turn_left
  408.           elsif @member==2
  409.             $game_subplayer1.turn_left
  410.           elsif @member==3
  411.             $game_subplayer2.turn_left
  412.           elsif @member==4
  413.             $game_subplayer3.turn_left
  414.           elsif @member==0
  415.             $game_subplayer3.turn_left
  416.             $game_subplayer2.turn_left
  417.             $game_subplayer1.turn_left
  418.             turn_left
  419.           end
  420.           #ここまで
  421.         when 18   # 右を向く
  422.           #以下変更
  423.           if @member==1
  424.             turn_right
  425.           elsif @member==2
  426.             $game_subplayer1.turn_right
  427.           elsif @member==3
  428.             $game_subplayer2.turn_right
  429.           elsif @member==4
  430.             $game_subplayer3.turn_right
  431.           elsif @member==0
  432.             $game_subplayer3.turn_right
  433.             $game_subplayer2.turn_right
  434.             $game_subplayer1.turn_right
  435.             turn_right
  436.           end
  437.           #ここまで
  438.         when 19   # 上を向く
  439.           #以下変更
  440.           if @member==1
  441.             turn_up
  442.           elsif @member==2
  443.             $game_subplayer1.turn_up
  444.           elsif @member==3
  445.             $game_subplayer2.turn_up
  446.           elsif @member==4
  447.             $game_subplayer3.turn_up
  448.           elsif @member==0
  449.             $game_subplayer3.turn_up
  450.             $game_subplayer2.turn_up
  451.             $game_subplayer1.turn_up
  452.             turn_up
  453.           end
  454.           #ここまで
  455.         when 20   # 右に 90 度回転
  456.           #以下変更
  457.           if @member==1
  458.             turn_right_90
  459.           elsif @member==2
  460.             $game_subplayer1.turn_right_90
  461.           elsif @member==3
  462.             $game_subplayer2.turn_right_90
  463.           elsif @member==4
  464.             $game_subplayer3.turn_right_90
  465.           elsif @member==0
  466.             $game_subplayer3.turn_right_90
  467.             $game_subplayer2.turn_right_90
  468.             $game_subplayer1.turn_right_90
  469.             turn_right_90
  470.           end
  471.           #ここまで
  472.         when 21   # 左に 90 度回転
  473.           #以下変更
  474.           if @member==1
  475.             turn_left_90
  476.           elsif @member==2
  477.             $game_subplayer1.turn_left_90
  478.           elsif @member==3
  479.             $game_subplayer2.turn_left_90
  480.           elsif @member==4
  481.             $game_subplayer3.turn_left_90
  482.           elsif @member==0
  483.             $game_subplayer3.turn_left_90
  484.             $game_subplayer2.turn_left_90
  485.             $game_subplayer1.turn_left_90
  486.             turn_left_90
  487.           end
  488.           #ここまで
  489.         when 22   # 180 度回転
  490.           #以下変更
  491.           if @member==1
  492.             turn_180
  493.           elsif @member==2
  494.             $game_subplayer1.turn_180
  495.           elsif @member==3
  496.             $game_subplayer2.turn_180
  497.           elsif @member==4
  498.             $game_subplayer3.turn_180
  499.           elsif @member==0
  500.             $game_subplayer3.turn_180
  501.             $game_subplayer2.turn_180
  502.             $game_subplayer1.turn_180
  503.             turn_180
  504.           end
  505.           #ここまで
  506.         when 23   # 右か左に 90 度回転
  507.           #以下変更
  508.           if @member==1
  509.             turn_right_or_left_90
  510.           elsif @member==2
  511.             $game_subplayer1.turn_right_or_left_90
  512.           elsif @member==3
  513.             $game_subplayer2.turn_right_or_left_90
  514.           elsif @member==4
  515.             $game_subplayer3.turn_right_or_left_90
  516.           elsif @member==0
  517.             $game_subplayer3.turn_right_or_left_90
  518.             $game_subplayer2.turn_right_or_left_90
  519.             $game_subplayer1.turn_right_or_left_90
  520.             turn_right_or_left_90
  521.           end
  522.           #ここまで
  523.         when 24   # ランダムに方向転換
  524.           #以下変更
  525.           if @member==1
  526.             turn_random
  527.           elsif @member==2
  528.             $game_subplayer1.turn_random
  529.           elsif @member==3
  530.             $game_subplayer2.turn_random
  531.           elsif @member==4
  532.             $game_subplayer3.turn_random
  533.           elsif @member==0
  534.             $game_subplayer3.turn_random
  535.             $game_subplayer2.turn_random
  536.             $game_subplayer1.turn_random
  537.             turn_random
  538.           end
  539.           #ここまで
  540.         when 25   # プレイヤーの方を向く
  541.           #以下変更
  542.           if @member==1
  543.             turn_toward_player
  544.           elsif @member==2
  545.             $game_subplayer1.turn_toward_player
  546.           elsif @member==3
  547.             $game_subplayer2.turn_toward_player
  548.           elsif @member==4
  549.             $game_subplayer3.turn_toward_player
  550.           elsif @member==0
  551.             $game_subplayer3.turn_toward_player
  552.             $game_subplayer2.turn_toward_player
  553.             $game_subplayer1.turn_toward_player
  554.             turn_toward_player
  555.           end
  556.           #ここまで
  557.         when 26   # プレイヤーの逆を向く
  558.           #以下変更
  559.           if @member==1
  560.             turn_away_from_player
  561.           elsif @member==2
  562.             $game_subplayer1.turn_away_from_player
  563.           elsif @member==3
  564.             $game_subplayer2.turn_away_from_player
  565.           elsif @member==4
  566.             $game_subplayer3.turn_away_from_player
  567.           elsif @member==0
  568.             $game_subplayer3.turn_away_from_player
  569.             $game_subplayer2.turn_away_from_player
  570.             $game_subplayer1.turn_away_from_player
  571.             turn_away_from_player
  572.           end
  573.           #ここまで
  574.         when 27   # スイッチ ON
  575.           $game_switches[command.parameters[0]] = true
  576.           $game_map.need_refresh = true
  577.         when 28   # スイッチ OFF
  578.           $game_switches[command.parameters[0]] = false
  579.           $game_map.need_refresh = true
  580.         when 29   # 移動速度の変更
  581.           #以下変更
  582.           @move_speed = command.parameters[0]
  583.           $game_subplayer1.move_speed = command.parameters[0]
  584.           $game_subplayer2.move_speed = command.parameters[0]
  585.           $game_subplayer3.move_speed = command.parameters[0]
  586.           #ここまで
  587.         when 30   # 移動頻度の変更
  588.           @move_frequency = command.parameters[0]
  589.         when 31   # 歩行アニメ ON
  590.           #以下変更
  591.           if @member==1
  592.             @walk_anime = true
  593.           elsif @member==2
  594.             $game_subplayer1.walk_anime = true
  595.           elsif @member==3
  596.             $game_subplayer2.walk_anime = true
  597.           elsif @member==4
  598.             $game_subplayer3.walk_anime = true
  599.           elsif @member==0
  600.             $game_subplayer3.walk_anime = true
  601.             $game_subplayer2.walk_anime = true
  602.             $game_subplayer1.walk_anime = true
  603.             @walk_anime = true
  604.           end
  605.           #ここまで
  606.         when 32   # 歩行アニメ OFF
  607.           #以下変更
  608.           if @member==1
  609.             @walk_anime = false
  610.           elsif @member==2
  611.             $game_subplayer1.walk_anime = false
  612.           elsif @member==3
  613.             $game_subplayer2.walk_anime = false
  614.           elsif @member==4
  615.             $game_subplayer3.walk_anime = false
  616.           elsif @member==0
  617.             $game_subplayer3.walk_anime = false
  618.             $game_subplayer2.walk_anime = false
  619.             $game_subplayer1.walk_anime = false
  620.             @walk_anime = false
  621.           end
  622.           #ここまで
  623.         when 33   # 足踏みアニメ ON
  624.           #以下変更
  625.           if @member==1
  626.             @step_anime = true
  627.           elsif @member==2
  628.             $game_subplayer1.step_anime = true
  629.           elsif @member==3
  630.             $game_subplayer2.step_anime = true
  631.           elsif @member==4
  632.             $game_subplayer3.step_anime = true
  633.           elsif @member==0
  634.             $game_subplayer3.step_anime = true
  635.             $game_subplayer2.step_anime = true
  636.             $game_subplayer1.step_anime = true
  637.             @step_anime = true
  638.           end
  639.           #ここまで
  640.         when 34   # 足踏みアニメ OFF
  641.           #以下変更
  642.           if @member==1
  643.             @step_anime = false
  644.           elsif @member==2
  645.             $game_subplayer1.step_anime = false
  646.           elsif @member==3
  647.             $game_subplayer2.step_anime = false
  648.           elsif @member==4
  649.             $game_subplayer3.step_anime = false
  650.           elsif @member==0
  651.             $game_subplayer3.step_anime = false
  652.             $game_subplayer2.step_anime = false
  653.             $game_subplayer1.step_anime = false
  654.             @step_anime = false
  655.           end
  656.           #ここまで
  657.         when 35   # 向き固定 ON
  658.           #以下変更
  659.           if @member==1
  660.             @direction_fix = true
  661.           elsif @member==2
  662.             $game_subplayer1.direction_fix = true
  663.           elsif @member==3
  664.             $game_subplayer2.direction_fix = true
  665.           elsif @member==4
  666.             $game_subplayer3.direction_fix = true
  667.           elsif @member==0
  668.             $game_subplayer3.direction_fix = true
  669.             $game_subplayer2.direction_fix = true
  670.             $game_subplayer1.direction_fix = true
  671.             @direction_fix = true
  672.           end
  673.           #ここまで
  674.         when 36   # 向き固定 OFF
  675.           #以下変更
  676.           if @member==1
  677.             @direction_fix = false
  678.           elsif @member==2
  679.             $game_subplayer1.direction_fix = false
  680.           elsif @member==3
  681.             $game_subplayer2.direction_fix = false
  682.           elsif @member==4
  683.             $game_subplayer3.direction_fix = false
  684.           elsif @member==0
  685.             $game_subplayer3.direction_fix = false
  686.             $game_subplayer2.direction_fix = false
  687.             $game_subplayer1.direction_fix = false
  688.             @direction_fix = false
  689.           end
  690.           #ここまで
  691.         when 37   # すり抜け ON
  692.           #以下変更
  693.           @through = true
  694.           $game_subplayer1.through = true
  695.           $game_subplayer2.through = true
  696.           $game_subplayer3.through = true
  697.           #ここまで
  698.         when 38   # すり抜け OFF
  699.           #以下変更
  700.           @through = false
  701.           $game_subplayer1.through = false
  702.           $game_subplayer2.through = false
  703.           $game_subplayer3.through = false
  704.           #ここまで
  705.         when 39   # 透明化 ON
  706.           #以下変更
  707.           if @member==1
  708.             @transparent = true
  709.           elsif @member==2
  710.             $game_subplayer1.transparent = true
  711.           elsif @member==3
  712.             $game_subplayer2.transparent = true
  713.           elsif @member==4
  714.             $game_subplayer3.transparent = true
  715.           elsif @member==0
  716.             $game_subplayer3.transparent = true
  717.             $game_subplayer2.transparent = true
  718.             $game_subplayer1.transparent = true
  719.             @transparent = true
  720.           end
  721.           #ここまで
  722.         when 40   # 透明化 OFF
  723.           #以下変更
  724.           if @member==1
  725.             @transparent = false
  726.           elsif @member==2
  727.             $game_subplayer1.transparent = false
  728.           elsif @member==3
  729.             $game_subplayer2.transparent = false
  730.           elsif @member==4
  731.             $game_subplayer3.transparent = false
  732.           elsif @member==0
  733.             $game_subplayer3.transparent = false
  734.             $game_subplayer2.transparent = false
  735.             $game_subplayer1.transparent = false
  736.             @transparent = false
  737.           end
  738.           #ここまで
  739.         when 41   # グラフィック変更
  740.           #以下変更
  741.           if @member==1
  742.             set_graphic(command.parameters[0], command.parameters[1])
  743.           elsif @member==2
  744.             $game_subplayer1.set_graphic(command.parameters[0], command.parameters[1])
  745.           elsif @member==3
  746.             $game_subplayer2.set_graphic(command.parameters[0], command.parameters[1])
  747.           elsif @member==4
  748.             $game_subplayer3.set_graphic(command.parameters[0], command.parameters[1])
  749.           elsif @member==0
  750.             $game_subplayer3.set_graphic(command.parameters[0], command.parameters[1])
  751.             $game_subplayer2.set_graphic(command.parameters[0], command.parameters[1])
  752.             $game_subplayer1.set_graphic(command.parameters[0], command.parameters[1])
  753.             set_graphic(command.parameters[0], command.parameters[1])
  754.           end
  755.           #ここまで
  756.         when 42   # 不透明度の変更
  757.           #以下変更
  758.           if @member==1
  759.             @opacity = command.parameters[0]
  760.           elsif @member==2
  761.             $game_subplayer1.opacity = command.parameters[0]
  762.           elsif @member==3
  763.             $game_subplayer2.opacity = command.parameters[0]
  764.           elsif @member==4
  765.             $game_subplayer3.opacity = command.parameters[0]
  766.           elsif @member==0
  767.             $game_subplayer3.opacity = command.parameters[0]
  768.             $game_subplayer2.opacity = command.parameters[0]
  769.             $game_subplayer1.opacity = command.parameters[0]
  770.             @opacity = command.parameters[0]
  771.           end
  772.           #ここまで
  773.         when 43   # 合成方法の変更
  774.           #以下変更
  775.           if @member==1
  776.             @blend_type = command.parameters[0]
  777.           elsif @member==2
  778.             $game_subplayer1.blend_type = command.parameters[0]
  779.           elsif @member==3
  780.             $game_subplayer2.blend_type = command.parameters[0]
  781.           elsif @member==4
  782.             $game_subplayer3.blend_type = command.parameters[0]
  783.           elsif @member==0
  784.             $game_subplayer3.blend_type = command.parameters[0]
  785.             $game_subplayer2.blend_type = command.parameters[0]
  786.             $game_subplayer1.blend_type = command.parameters[0]
  787.             @blend_type = command.parameters[0]
  788.           end
  789.           #ここまで
  790.         when 44   # SE の演奏
  791.           command.parameters[0].play
  792.         when 45   # スクリプト
  793.           eval(command.parameters[0])
  794.         end
  795.         if not @move_route.skippable and @move_failed
  796.           return  # [移動できない場合は無視] OFF & 移動失敗
  797.         end
  798.         @move_route_index += 1
  799.       end
  800.     end
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ● 移動可能判定
  804.   #--------------------------------------------------------------------------
  805.   def movable?
  806.     return false if moving?                     # 移動中
  807.     return false if @move_route_forcing         # 移動ルート強制中
  808.     return false if @vehicle_getting_on         # 乗る動作の途中
  809.     return false if @vehicle_getting_off        # 降りる動作の途中
  810.     return false if $game_message.visible       # メッセージ表示中
  811.     return false if @gather_on                  # 集合中   #追加
  812.     return false if in_airship? and not $game_map.airship.movable?
  813.     return true
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● フレーム更新
  817.   #--------------------------------------------------------------------------
  818.   def update
  819.     last_real_x = @real_x
  820.     last_real_y = @real_y
  821.     last_moving = moving?
  822.     move_by_input
  823.    
  824.     #以下スーパークラスのupdateメソッドをコピー
  825.     if jumping?                 # ジャンプ中
  826.       update_jump
  827.     elsif moving?               # 移動中
  828.       update_move
  829.     else                        # 停止中
  830.       update_stop
  831.     end
  832.     if @wait_count > 0          # ウェイト中
  833.       @wait_count -= 1
  834.     elsif @gather_on            # 追加
  835.       update_gather             # 追加
  836.     elsif @move_route_forcing   # 移動ルート強制中
  837.       move_type_custom
  838.     elsif not @locked           # ロック中以外
  839.       update_self_movement
  840.     end
  841.     update_animation
  842.     #ここまで
  843.    
  844.     update_scroll(last_real_x, last_real_y)
  845.     update_vehicle
  846.     update_nonmoving(last_moving)
  847.   end
  848.   #--------------------------------------------------------------------------
  849.   # ● サブキャラクター集合メソッド(これを,スクリプトにより呼び出す)    #追加
  850.   #--------------------------------------------------------------------------
  851.   def gather
  852.     @gather_on = true
  853.   end
  854.   #--------------------------------------------------------------------------
  855.   # ● サブキャラクター集合更新                  #追加
  856.   #--------------------------------------------------------------------------
  857.   def update_gather
  858.     return unless @gather_on
  859.     return if $game_subplayer3.moving?
  860.     pos = []
  861.     pos.push(@x,@y)
  862.     if(@gather_count==0)
  863.       $game_subplayer1.move(pos);@gather_count+=1
  864.     elsif(@gather_count==1)
  865.       $game_subplayer2.move(pos);@gather_count+=1
  866.     elsif(@gather_count==2)
  867.       $game_subplayer3.move(pos);@gather_count+=1
  868.     elsif(@gather_count==3)
  869.       @gather_count=0;@gather_on=false
  870.     end
  871.   end
  872.   #--------------------------------------------------------------------------
  873.   # ● 強制行動キャラクタを選択する(これを,スクリプトにより呼び出す)   #追加
  874.   #--------------------------------------------------------------------------
  875.   def set_member(x)
  876.     @member = x
  877.   end
  878. end

  879. #==============================================================================
  880. # ■ Game_Interpreter_re
  881. #------------------------------------------------------------------------------
  882. #  イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
  883. # Game_Troop クラス、Game_Event クラスの内部で使用されます。(再定義)
  884. #==============================================================================

  885. class Game_Interpreter
  886.   #--------------------------------------------------------------------------
  887.   # ● 場所移動
  888.   #--------------------------------------------------------------------------
  889.   def command_201
  890.     return true if $game_temp.in_battle
  891.     if $game_player.transfer? or            # 場所移動中
  892.        $game_message.visible                # メッセージ表示中
  893.       return false
  894.     end
  895.     if @params[0] == 0                      # 直接指定
  896.       map_id = @params[1]
  897.       x = @params[2]
  898.       y = @params[3]
  899.       direction = @params[4]
  900.     else                                    # 変数で指定
  901.       map_id = $game_variables[@params[1]]
  902.       x = $game_variables[@params[2]]
  903.       y = $game_variables[@params[3]]
  904.       direction = @params[4]
  905.     end
  906.     $game_player.reserve_transfer(map_id, x, y, direction)
  907.     $game_subplayer1.reserve_transfer(map_id, x, y, direction) #追加
  908.     $game_subplayer2.reserve_transfer(map_id, x, y, direction) #追加
  909.     $game_subplayer3.reserve_transfer(map_id, x, y, direction) #追加
  910.     @index += 1
  911.     return false
  912.   end
  913.   #--------------------------------------------------------------------------
  914.   # ● 透明状態の変更
  915.   #--------------------------------------------------------------------------
  916.   def command_211
  917.     $game_player.transparent = (@params[0] == 0)
  918.     $game_subplayer1.transparent = (@params[0] == 0)  #追加
  919.     $game_subplayer2.transparent = (@params[0] == 0)  #追加
  920.     $game_subplayer3.transparent = (@params[0] == 0)  #追加
  921.     return true
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # ● アニメーションの表示
  925.   #--------------------------------------------------------------------------
  926.   def command_212
  927.     character = get_character(@params[0])
  928.     if character == $game_player
  929.       if $game_player.member == 0
  930.         $game_player.animation_id = @params[1]
  931.         $game_subplayer1.animation_id = @params[1]
  932.         $game_subplayer2.animation_id = @params[1]
  933.         $game_subplayer3.animation_id = @params[1]
  934.       elsif $game_player.member == 1
  935.         $game_player.animation_id = @params[1]
  936.       elsif $game_player.member == 2
  937.         $game_subplayer1.animation_id = @params[1]
  938.       elsif $game_player.member == 3
  939.         $game_subplayer2.animation_id = @params[1]
  940.       elsif $game_player.member == 4
  941.         $game_subplayer3.animation_id = @params[1]
  942.       end
  943.     elsif character != nil
  944.       character.animation_id = @params[1]
  945.     end
  946.     return true
  947.   end
  948.   #--------------------------------------------------------------------------
  949.   # ● フキダシアイコンの表示
  950.   #--------------------------------------------------------------------------
  951.   def command_213
  952.     character = get_character(@params[0])
  953.     if character == $game_player
  954.       if $game_player.member == 0
  955.         $game_player.balloon_id = @params[1]
  956.         $game_subplayer1.balloon_id = @params[1]
  957.         $game_subplayer2.balloon_id = @params[1]
  958.         $game_subplayer3.balloon_id = @params[1]
  959.       elsif $game_player.member == 1
  960.         $game_player.balloon_id = @params[1]
  961.       elsif $game_player.member == 2
  962.         $game_subplayer1.balloon_id = @params[1]
  963.       elsif $game_player.member == 3
  964.         $game_subplayer2.balloon_id = @params[1]
  965.       elsif $game_player.member == 4
  966.         $game_subplayer3.balloon_id = @params[1]
  967.       end
  968.     elsif character != nil
  969.       character.balloon_id = @params[1]
  970.     end
  971.     return true
  972.   end
  973. end


  974. #==============================================================================
  975. # ■ Scene_File
  976. #------------------------------------------------------------------------------
  977. #  ファイル画面の処理を行うクラスです。
  978. #==============================================================================

  979. class Scene_File < Scene_Base
  980.   #--------------------------------------------------------------------------
  981.   # ● セーブデータの書き込み
  982.   #     file : 書き込み用ファイルオブジェクト (オープン済み)
  983.   #--------------------------------------------------------------------------
  984.   def write_save_data(file)
  985.     characters = []
  986.     for actor in $game_party.members
  987.       characters.push([actor.character_name, actor.character_index])
  988.     end
  989.     $game_system.save_count += 1
  990.     $game_system.version_id = $data_system.version_id
  991.     @last_bgm = RPG::BGM::last
  992.     @last_bgs = RPG::BGS::last
  993.     Marshal.dump(characters,           file)
  994.     Marshal.dump(Graphics.frame_count, file)
  995.     Marshal.dump(@last_bgm,            file)
  996.     Marshal.dump(@last_bgs,            file)
  997.     Marshal.dump($game_system,         file)
  998.     Marshal.dump($game_message,        file)
  999.     Marshal.dump($game_switches,       file)
  1000.     Marshal.dump($game_variables,      file)
  1001.     Marshal.dump($game_self_switches,  file)
  1002.     Marshal.dump($game_actors,         file)
  1003.     Marshal.dump($game_party,          file)
  1004.     Marshal.dump($game_troop,          file)
  1005.     Marshal.dump($game_map,            file)
  1006.     Marshal.dump($game_player,         file)
  1007.     Marshal.dump($game_subplayer1,     file) #追加
  1008.     Marshal.dump($game_subplayer2,     file) #追加
  1009.     Marshal.dump($game_subplayer3,     file) #追加
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # ● セーブデータの読み込み
  1013.   #     file : 読み込み用ファイルオブジェクト (オープン済み)
  1014.   #--------------------------------------------------------------------------
  1015.   def read_save_data(file)
  1016.     characters           = Marshal.load(file)
  1017.     Graphics.frame_count = Marshal.load(file)
  1018.     @last_bgm            = Marshal.load(file)
  1019.     @last_bgs            = Marshal.load(file)
  1020.     $game_system         = Marshal.load(file)
  1021.     $game_message        = Marshal.load(file)
  1022.     $game_switches       = Marshal.load(file)
  1023.     $game_variables      = Marshal.load(file)
  1024.     $game_self_switches  = Marshal.load(file)
  1025.     $game_actors         = Marshal.load(file)
  1026.     $game_party          = Marshal.load(file)
  1027.     $game_troop          = Marshal.load(file)
  1028.     $game_map            = Marshal.load(file)
  1029.     $game_player         = Marshal.load(file)
  1030.     $game_subplayer1     = Marshal.load(file)  #追加
  1031.     $game_subplayer2     = Marshal.load(file)  #追加
  1032.     $game_subplayer3     = Marshal.load(file)  #追加
  1033.     if $game_system.version_id != $data_system.version_id
  1034.       $game_map.setup($game_map.map_id)
  1035.       $game_player.center($game_player.x, $game_player.y)
  1036.     end
  1037.   end
  1038. end

  1039. #==============================================================================
  1040. # ■ Scene_Map_re
  1041. #------------------------------------------------------------------------------
  1042. #  マップ画面の処理を行うクラスです。(再定義)
  1043. #==============================================================================

  1044. class Scene_Map < Scene_Base
  1045.   #--------------------------------------------------------------------------
  1046.   # ● フレーム更新
  1047.   #--------------------------------------------------------------------------
  1048.   def update
  1049.     super
  1050.     $game_map.interpreter.update      # インタプリタを更新
  1051.     $game_map.update                  # マップを更新
  1052.     $game_player.update               # プレイヤーを更新
  1053.     $game_subplayer1.update           # サブプレイヤーを更新  #追加
  1054.     $game_subplayer2.update           # サブプレイヤーを更新  #追加
  1055.     $game_subplayer3.update           # サブプレイヤーを更新  #追加
  1056.     $game_system.update               # タイマーを更新
  1057.     @spriteset.update                 # スプライトセットを更新
  1058.     @message_window.update            # メッセージウィンドウを更新
  1059.     unless $game_message.visible      # メッセージ表示中以外
  1060.       update_transfer_player
  1061.       update_encounter
  1062.       update_call_menu
  1063.       update_call_debug
  1064.       update_scene_change
  1065.     end
  1066.   end
  1067.   #--------------------------------------------------------------------------
  1068.   # ● 場所移動の処理
  1069.   #--------------------------------------------------------------------------
  1070.   def update_transfer_player
  1071.     return unless $game_player.transfer?
  1072.     fade = (Graphics.brightness > 0)
  1073.     fadeout(30) if fade
  1074.     @spriteset.dispose              # スプライトセットを解放
  1075.     $game_player.perform_transfer   # 場所移動の実行
  1076.     $game_subplayer1.perform_transfer   # 場所移動の実行   #追加
  1077.     $game_subplayer2.perform_transfer   # 場所移動の実行   #追加
  1078.     $game_subplayer3.perform_transfer   # 場所移動の実行   #追加
  1079.     $game_map.autoplay              # BGM と BGS の自動切り替え
  1080.     $game_map.update
  1081.     Graphics.wait(15)
  1082.     @spriteset = Spriteset_Map.new  # スプライトセットを再作成
  1083.     fadein(30) if fade
  1084.     Input.update
  1085.   end
  1086. end


  1087. #==============================================================================
  1088. # ■ Scene_Title_re
  1089. #------------------------------------------------------------------------------
  1090. #  タイトル画面の処理を行うクラスです。(再定義)
  1091. #==============================================================================

  1092. class Scene_Title < Scene_Base
  1093.   #--------------------------------------------------------------------------
  1094.   # ● 各種ゲームオブジェクトの作成
  1095.   #--------------------------------------------------------------------------
  1096.   def create_game_objects
  1097.     $game_temp          = Game_Temp.new
  1098.     $game_message       = Game_Message.new
  1099.     $game_system        = Game_System.new
  1100.     $game_switches      = Game_Switches.new
  1101.     $game_variables     = Game_Variables.new
  1102.     $game_self_switches = Game_SelfSwitches.new
  1103.     $game_actors        = Game_Actors.new
  1104.     $game_party         = Game_Party.new
  1105.     $game_troop         = Game_Troop.new
  1106.     $game_map           = Game_Map.new
  1107.     $game_player        = Game_Player.new
  1108.     $game_subplayer1    = Game_Subplayer.new     #追加
  1109.     $game_subplayer2    = Game_Subplayer.new     #追加
  1110.     $game_subplayer3    = Game_Subplayer.new     #追加
  1111.   end
  1112.   
  1113.   #--------------------------------------------------------------------------
  1114.   # ● コマンド : ニューゲーム
  1115.   #--------------------------------------------------------------------------
  1116.   def command_new_game
  1117.     confirm_player_location
  1118.     Sound.play_decision
  1119.     $game_party.setup_starting_members            # 初期パーティ
  1120.     $game_map.setup($data_system.start_map_id)    # 初期位置のマップ
  1121.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  1122.     $game_player.refresh
  1123.     $game_subplayer1.moveto($data_system.start_x, $data_system.start_y)#追加
  1124.     $game_subplayer1.refresh(1)                                        #追加
  1125.     $game_subplayer2.moveto($data_system.start_x, $data_system.start_y)#追加
  1126.     $game_subplayer2.refresh(2)                                        #追加
  1127.     $game_subplayer3.moveto($data_system.start_x, $data_system.start_y)#追加
  1128.     $game_subplayer3.refresh(3)                                        #追加
  1129.     $scene = Scene_Map.new
  1130.     RPG::BGM.fade(1500)
  1131.     close_command_window
  1132.     Graphics.fadeout(60)
  1133.     Graphics.wait(40)
  1134.     Graphics.frame_count = 0
  1135.     RPG::BGM.stop
  1136.     $game_map.autoplay
  1137.   end
  1138. end

  1139. #==============================================================================
  1140. # ■ Spriteset_Map_re
  1141. #------------------------------------------------------------------------------
  1142. #  マップ画面のスプライトやタイルマップなどをまとめたクラスです。このクラスは
  1143. # Scene_Map クラスの内部で使用されます。(再定義)
  1144. #==============================================================================

  1145. class Spriteset_Map
  1146.   #--------------------------------------------------------------------------
  1147.   # ● キャラクタースプライトの作成
  1148.   #--------------------------------------------------------------------------
  1149.   def create_characters
  1150.     @character_sprites = []
  1151.     for i in $game_map.events.keys.sort
  1152.       sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  1153.       @character_sprites.push(sprite)
  1154.     end
  1155.     for vehicle in $game_map.vehicles
  1156.       sprite = Sprite_Character.new(@viewport1, vehicle)
  1157.       @character_sprites.push(sprite)
  1158.     end
  1159.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_subplayer3))#追加
  1160.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_subplayer2))#追加
  1161.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_subplayer1))#追加
  1162.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  1163.   end
  1164. end

  1165. #==============================================================================
  1166. # ■ Game_Subplayer
  1167. #------------------------------------------------------------------------------
  1168. #  サブプレイヤーを扱うクラスです。
  1169. # このクラスのインスタンスは $game_subplayer1~3で参照されます。
  1170. # Game_Playerクラスを元に作っています
  1171. #==============================================================================

  1172. class Game_Subplayer < Game_Character
  1173.   #--------------------------------------------------------------------------
  1174.   # ● 定数
  1175.   #--------------------------------------------------------------------------
  1176.   CENTER_X = (544 / 2 - 16) * 8     # 画面中央の X 座標 * 8
  1177.   CENTER_Y = (416 / 2 - 16) * 8     # 画面中央の Y 座標 * 8
  1178.   #--------------------------------------------------------------------------
  1179.   # ● 公開インスタンス変数
  1180.   #--------------------------------------------------------------------------
  1181.   attr_accessor :move_speed             # 移動速度
  1182.   attr_accessor :walk_anime             # 歩行アニメ
  1183.   attr_accessor :step_anime             # 足踏みアニメ
  1184.   attr_accessor :direction_fix          # 向き固定
  1185.   attr_accessor :through                # すり抜け
  1186.   attr_accessor :opacity                # 不透明度
  1187.   attr_accessor :blend_type             # 合成方法
  1188.   #--------------------------------------------------------------------------
  1189.   # ● オブジェクト初期化
  1190.   #--------------------------------------------------------------------------
  1191.   def initialize
  1192.     super
  1193.     @transferring = false           # 場所移動フラグ
  1194.     @new_map_id = 0                 # 移動先 マップ ID
  1195.     @new_x = 0                      # 移動先 X 座標
  1196.     @new_y = 0                      # 移動先 Y 座標
  1197.     @new_direction = 0              # 移動後の向き
  1198.     @number = 0                     # 何番目のキャラか
  1199.   end
  1200.   #--------------------------------------------------------------------------
  1201.   # ● 場所移動の予約
  1202.   #     map_id    : マップ ID
  1203.   #     x         : X 座標
  1204.   #     y         : Y 座標
  1205.   #     direction : 移動後の向き
  1206.   #--------------------------------------------------------------------------
  1207.   def reserve_transfer(map_id, x, y, direction)
  1208.     @transferring = true
  1209.     @new_map_id = map_id
  1210.     @new_x = x
  1211.     @new_y = y
  1212.     @new_direction = direction
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ● 場所移動の実行
  1216.   #--------------------------------------------------------------------------
  1217.   def perform_transfer
  1218.     return unless @transferring
  1219.     @transferring = false
  1220.     set_direction(@new_direction)
  1221.     if $game_map.map_id != @new_map_id
  1222.       $game_map.setup(@new_map_id)     # 別マップへ移動
  1223.     end
  1224.     moveto(@new_x, @new_y)
  1225.   end
  1226.   #--------------------------------------------------------------------------
  1227.   # ● ダッシュ状態判定
  1228.   #--------------------------------------------------------------------------
  1229.   def dash?
  1230.     return false if $game_player.move_route_forcing
  1231.     return false if $game_map.disable_dash?
  1232.     return false if $game_player.gather_on       # 集合中
  1233.     return Input.press?(Input::A)
  1234.   end
  1235.   #--------------------------------------------------------------------------
  1236.   # ● デバッグすり抜け状態判定
  1237.   #--------------------------------------------------------------------------
  1238.   def debug_through?
  1239.     return false unless $TEST
  1240.     return Input.press?(Input::CTRL)
  1241.   end
  1242.   #--------------------------------------------------------------------------
  1243.   # ● 画面中央に来るようにマップの表示位置を設定
  1244.   #     x : X 座標
  1245.   #     y : Y 座標
  1246.   #--------------------------------------------------------------------------
  1247.   def center(x, y)
  1248.     display_x = x * 256 - CENTER_X                    # 座標を計算
  1249.     unless $game_map.loop_horizontal?                 # 横にループしない?
  1250.       max_x = ($game_map.width - 17) * 256            # 最大値を計算
  1251.       display_x = [0, [display_x, max_x].min].max     # 座標を修正
  1252.     end
  1253.     display_y = y * 256 - CENTER_Y                    # 座標を計算
  1254.     unless $game_map.loop_vertical?                   # 縦にループしない?
  1255.       max_y = ($game_map.height - 13) * 256           # 最大値を計算
  1256.       display_y = [0, [display_y, max_y].min].max     # 座標を修正
  1257.     end
  1258.     $game_map.set_display_pos(display_x, display_y)   # 表示位置変更
  1259.   end
  1260.   #--------------------------------------------------------------------------
  1261.   # ● 指定位置に移動
  1262.   #     x : X 座標
  1263.   #     y : Y 座標
  1264.   #--------------------------------------------------------------------------
  1265.   def moveto(x, y)
  1266.     super
  1267.     center(x, y)                                      # センタリング
  1268.   end
  1269.   #--------------------------------------------------------------------------
  1270.   # ● リフレッシュ
  1271.   #--------------------------------------------------------------------------
  1272.   def refresh(number)
  1273.     @number = number
  1274.     if $game_party.members.size <= number
  1275.       @character_name = ""
  1276.       @character_index = 0
  1277.     else
  1278.       actor = $game_party.members[number]   # アクターを取得
  1279.       @character_name = actor.character_name
  1280.       @character_index = actor.character_index
  1281.     end
  1282.   end
  1283.   #--------------------------------------------------------------------------
  1284.   # ● 動き
  1285.   #--------------------------------------------------------------------------
  1286.   def move(xy)
  1287.     if @x==xy[0] && @y==xy[1]
  1288.       return
  1289.     elsif @x==xy[0]+1 && @y==xy[1]
  1290.       move_left
  1291.     elsif @x==xy[0]-1 && @y==xy[1]
  1292.       move_right
  1293.     elsif @x==xy[0] && @y==xy[1]+1
  1294.       move_up
  1295.     elsif @x==xy[0] && @y==xy[1]-1
  1296.       move_down
  1297.     elsif @x==xy[0]+1 && @y==xy[1]+1
  1298.       move_upper_left
  1299.     elsif @x==xy[0]-1 && @y==xy[1]+1
  1300.       move_upper_right
  1301.     elsif @x==xy[0]+1 && @y==xy[1]-1
  1302.       move_lower_left
  1303.     elsif @x==xy[0]-1 && @y==xy[1]-1
  1304.       move_lower_right
  1305.     #画面ループの端っこの時
  1306.     elsif @x==0 && xy[0]>@x+1 && @y==xy[1]
  1307.       move_left
  1308.     elsif xy[0]==0 && @x+1>xy[0] && @y==xy[1]
  1309.       move_right
  1310.     elsif @x==xy[0] && @y==0 && xy[1]>@y+1
  1311.       move_up
  1312.     elsif @x==xy[0] && xy[1]==0 && @y+1>xy[1]
  1313.       move_down
  1314.     #画面ループの端っこで,ナナメ移動の場合
  1315.     elsif @x<0 || @y<0
  1316.       temp_x = $game_map.round_x(@x)
  1317.       temp_y = $game_map.round_y(@y)
  1318.       if temp_x==xy[0]+1 && @y==xy[1]
  1319.         move_left
  1320.       elsif temp_x==xy[0]-1 && @y==xy[1]
  1321.         move_right
  1322.       elsif @x==xy[0] && temp_y==xy[1]+1
  1323.         move_up
  1324.       elsif @x==xy[0] && temp_y==xy[1]-1
  1325.         move_down
  1326.       end
  1327.     end
  1328.   end
  1329.   #--------------------------------------------------------------------------
  1330.   # ● 下に移動
  1331.   #     turn_ok : その場での向き変更を許可
  1332.   #--------------------------------------------------------------------------
  1333.   def move_down(turn_ok = true)
  1334.     pos = []
  1335.     if passable?(@x, @y+1)                  # 通行可能
  1336.       turn_down
  1337.       pos.push(@x,@y)
  1338.       @y = $game_map.round_y(@y+1)
  1339.       @real_y = (@y-1)*256
  1340.       if @number == 1               
  1341.         $game_subplayer2.move(pos)
  1342.       elsif @number == 2
  1343.         $game_subplayer3.move(pos)
  1344.       end
  1345.       @move_failed = false
  1346.     else                                    # 通行不可能
  1347.       turn_down if turn_ok
  1348.       @move_failed = true
  1349.     end
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 左に移動
  1353.   #     turn_ok : その場での向き変更を許可
  1354.   #--------------------------------------------------------------------------
  1355.   def move_left(turn_ok = true)
  1356.     pos = []
  1357.     if passable?(@x-1, @y)                  # 通行可能
  1358.       turn_left
  1359.       pos.push(@x,@y)
  1360.       @x = $game_map.round_x(@x-1)
  1361.       @real_x = (@x+1)*256
  1362.       if @number == 1               
  1363.         $game_subplayer2.move(pos)
  1364.       elsif @number == 2
  1365.         $game_subplayer3.move(pos)
  1366.       end
  1367.       @move_failed = false
  1368.     else                                    # 通行不可能
  1369.       turn_left if turn_ok
  1370.       @move_failed = true
  1371.     end
  1372.   end
  1373.   #--------------------------------------------------------------------------
  1374.   # ● 右に移動
  1375.   #     turn_ok : その場での向き変更を許可
  1376.   #--------------------------------------------------------------------------
  1377.   def move_right(turn_ok = true)
  1378.     pos = []
  1379.     if passable?(@x+1, @y)                  # 通行可能
  1380.       turn_right
  1381.       pos.push(@x,@y)
  1382.       @x = $game_map.round_x(@x+1)
  1383.       @real_x = (@x-1)*256
  1384.       if @number == 1               
  1385.         $game_subplayer2.move(pos)
  1386.       elsif @number == 2
  1387.         $game_subplayer3.move(pos)
  1388.       end
  1389.       @move_failed = false
  1390.     else                                    # 通行不可能
  1391.       turn_right if turn_ok
  1392.       @move_failed = true
  1393.     end
  1394.   end
  1395.   #--------------------------------------------------------------------------
  1396.   # ● 上に移動
  1397.   #     turn_ok : その場での向き変更を許可
  1398.   #--------------------------------------------------------------------------
  1399.   def move_up(turn_ok = true)
  1400.     pos = []
  1401.     if passable?(@x, @y-1)                  # 通行可能
  1402.       turn_up
  1403.       pos.push(@x,@y)
  1404.       @y = $game_map.round_y(@y-1)
  1405.       @real_y = (@y+1)*256
  1406.       if @number == 1               
  1407.         $game_subplayer2.move(pos)
  1408.       elsif @number == 2
  1409.         $game_subplayer3.move(pos)
  1410.       end
  1411.       @move_failed = false
  1412.     else                                    # 通行不可能
  1413.       turn_up if turn_ok
  1414.       @move_failed = true
  1415.     end
  1416.   end
  1417.   #--------------------------------------------------------------------------
  1418.   # ● 左下に移動
  1419.   #--------------------------------------------------------------------------
  1420.   def move_lower_left
  1421.     pos = []
  1422.     unless @direction_fix
  1423.       @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
  1424.     end
  1425.     if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
  1426.        (passable?(@x-1, @y) and passable?(@x-1, @y+1))
  1427.       pos.push(@x,@y)
  1428.       @x -= 1
  1429.       @y += 1
  1430.       if @number == 1               
  1431.         $game_subplayer2.move(pos)
  1432.       elsif @number == 2
  1433.         $game_subplayer3.move(pos)
  1434.       end
  1435.       @move_failed = false
  1436.     else
  1437.       @move_failed = true
  1438.     end
  1439.   end
  1440.   #--------------------------------------------------------------------------
  1441.   # ● 右下に移動
  1442.   #--------------------------------------------------------------------------
  1443.   def move_lower_right
  1444.     pos = []
  1445.     unless @direction_fix
  1446.       @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
  1447.     end
  1448.     if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
  1449.        (passable?(@x+1, @y) and passable?(@x+1, @y+1))
  1450.       pos.push(@x,@y)
  1451.       @x += 1
  1452.       @y += 1
  1453.       if @number == 1               
  1454.         $game_subplayer2.move(pos)
  1455.       elsif @number == 2
  1456.         $game_subplayer3.move(pos)
  1457.       end
  1458.       @move_failed = false
  1459.     else
  1460.       @move_failed = true
  1461.     end
  1462.   end
  1463.   #--------------------------------------------------------------------------
  1464.   # ● 左上に移動
  1465.   #--------------------------------------------------------------------------
  1466.   def move_upper_left
  1467.     pos = []
  1468.     unless @direction_fix
  1469.       @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
  1470.     end
  1471.     if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
  1472.        (passable?(@x-1, @y) and passable?(@x-1, @y-1))
  1473.       pos.push(@x,@y)
  1474.       @x -=1
  1475.       @y -=1
  1476.       if @number == 1               
  1477.         $game_subplayer2.move(pos)
  1478.       elsif @number == 2
  1479.         $game_subplayer3.move(pos)
  1480.       end
  1481.       @move_failed = false
  1482.     else
  1483.       @move_failed = true
  1484.     end
  1485.   end
  1486.   #--------------------------------------------------------------------------
  1487.   # ● 右上に移動
  1488.   #--------------------------------------------------------------------------
  1489.   def move_upper_right
  1490.     pos = []
  1491.     unless @direction_fix
  1492.       @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
  1493.     end
  1494.     if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
  1495.        (passable?(@x+1, @y) and passable?(@x+1, @y-1))
  1496.       pos.push(@x,@y)
  1497.       @x += 1
  1498.       @y -= 1
  1499.       if @number == 1               
  1500.         $game_subplayer2.move(pos)
  1501.       elsif @number == 2
  1502.         $game_subplayer3.move(pos)
  1503.       end
  1504.       @move_failed = false
  1505.     else
  1506.       @move_failed = true
  1507.     end
  1508.   end
  1509.   #--------------------------------------------------------------------------
  1510.   # ● キャラクター衝突判定
  1511.   #     x : X 座標
  1512.   #     y : Y 座標
  1513.   #--------------------------------------------------------------------------
  1514.   def collide_with_characters?(x, y)
  1515.     for event in $game_map.events_xy(x, y)          # イベントの座標と一致
  1516.       unless event.through                          # すり抜け OFF?
  1517.         return true if self.is_a?(Game_Event)       # 自分がイベント
  1518.         return true if event.priority_type == 1     # 相手が通常キャラ
  1519.       end
  1520.     end
  1521.     if @priority_type == 1                          # 自分が通常キャラ
  1522.       return true if $game_map.boat.pos_nt?(x, y)   # 小型船の座標と一致
  1523.       return true if $game_map.ship.pos_nt?(x, y)   # 大型船の座標と一致
  1524.     end
  1525.     return false
  1526.   end
  1527. end
复制代码

点评

图挂了...  发表于 2012-9-18 08:48

Lv1.梦旅人

苍弩霸主

梦石
0
星屑
164
在线时间
423 小时
注册时间
2012-7-9
帖子
364
2
发表于 2012-9-18 16:08:37 | 只看该作者
虽然我不怎么懂脚本,但是你连错误信息截图都没谁能帮的了你。
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4644
在线时间
5238 小时
注册时间
2009-4-29
帖子
14318

贵宾

3
发表于 2012-9-18 16:46:48 | 只看该作者
添加的外来脚本多了,所以不兼容。
P叔帮你修复了,拿走吧
Scripts.rvdata (199.15 KB, 下载次数: 22)

点评

P叔果断伟大。哈哈。  发表于 2012-9-19 00:57
《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2012-9-14
帖子
8
4
 楼主| 发表于 2012-9-18 21:22:29 | 只看该作者
protosssonny 发表于 2012-9-18 16:46
添加的外来脚本多了,所以不兼容。
P叔帮你修复了,拿走吧
...

感谢P叔
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-28 04:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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