查看: 2138|回复: 1

[已经解决] 这个人物扩张脚本怎么改人数上线

[复制链接]
梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2016-1-31 09:04:23 | 显示全部楼层 |阅读模式

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

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

×
不是说在脚本里改好上线。
是说在游戏里可以通过事件改上线。
是不是BATTLE_MAX = 4,WAITING_MAX = 16前面加个@
好像不行吧。

脚本
  1. # 赠品:人物扩张脚本
  2. # 窗口界面部分来自 桜雅 在土 XRXS26
  3. module BFS_Setting
  4.   # 参战人数最大值
  5.   BATTLE_MAX = 4
  6.   # 待机人数最大值
  7.   WAITING_MAX = 16
  8.   # 待机人物是否获得经验
  9.   BACKWARD_EXP_GAINABLE = false
  10.   # 3人以下的时候,菜单是否拉伸大小(建议不要使用)
  11.   MENU_STATUS_STRETCH   = false
  12.   # 进入键
  13.   MENU_MEMBER_CHANGE_KEY_GO    = Input::RIGHT
  14.   # 离开键
  15.   MENU_MEMBER_CHANGE_KEY_END   = Input::LEFT  
  16.   # 可更换角色最小编号
  17.   MENU_MEMBER_CHANGE_INDEX_MIN = 0
  18.   # 不能待机的角色编号
  19.   FORCETOBATTLE_ACTORS         = []  
  20.   # 不能加入战斗的角色编号
  21.   UMBATTLABLE_ACTORS           = []   
  22.   # 不能移动的角色编号
  23.   UNMOVABLE_ACTORS             = []
  24.   # 列数
  25.   COLUMN_MAX = 1
  26.   # 光标高度
  27.   CURSOR_HEIGHT = 96
  28.   # 一行的高度
  29.   LINE_HEIGHT = 116
  30. end
  31. class Game_Temp
  32.   attr_accessor :friends_need_refresh
  33.   alias rwkz_ini initialize
  34.   def initialize
  35.     rwkz_ini
  36.     @friend_need_refresh = false
  37.   end
  38. end
  39. class Scene_Map
  40.   alias rwkz_main main
  41.   def main
  42.     if $game_temp.friends_need_refresh
  43.       BFS_Friends.delete_all_friends
  44.       BFS_Friends.prepare_for_transferring
  45.       $game_temp.friends_need_refresh = false
  46.     end
  47.     rwkz_main
  48.   end
  49. end
  50. class Game_Party
  51.   attr_accessor :waiting_actors
  52.   def gain_exp(exp)
  53.     for i in 0...$game_party.actors.size
  54.       actor = $game_party.actors[i]
  55.       if actor.cant_get_exp? == false
  56.         actor.exp += exp
  57.       end
  58.     end
  59.     if BFS_Setting::BACKWARD_EXP_GAINABLE
  60.       for i in 0...$game_party.waiting_actors.size
  61.         actor = $game_party.waiting_actors[i]
  62.         if actor.cant_get_exp? == false
  63.           actor.exp += exp
  64.         end
  65.       end
  66.     end
  67.   end
  68.   alias rk initialize
  69.   def initialize
  70.     rk
  71.     @waiting_actors = []
  72.   end
  73.   def remove_actor(actor_id)
  74.     if @actors.size == 1
  75.       p "数据库中的角色数量会变为0,为了游戏的正常运行,请不要这样做。"
  76.       p "因此,系统可能会忽略此次操作,见谅"
  77.       p "如有特殊情况,请在脚本中删除这段文字"
  78.       return
  79.     end
  80.     switch_leader if actor_id == $game_party.actors[0].id
  81.     if @actors.include?($game_actors[actor_id])
  82.       @actors.delete($game_actors[actor_id])
  83.       if @waiting_actors != []
  84.         waiting_leader = @waiting_actors[0]
  85.         @waiting_actors.delete_at(0)
  86.         @actors.push(waiting_leader)
  87.       end
  88.     else
  89.       if @waiting_actors.include?($game_actors[actor_id])
  90.         @waiting_actors.delete($game_actors[actor_id])
  91.       else
  92.         return
  93.       end
  94.     end
  95.     friend_party_update
  96.     BFS_Friends.delete_all_friends
  97.     BFS_Friends.prepare_for_transferring
  98.     $game_player.refresh
  99.     $scene.spriteset.dispose
  100.     $scene.spriteset = Spriteset_Map.new
  101.     $scene.hud_update
  102.   end
  103.   def add_actor(actor_id)
  104.     actor = $game_actors[actor_id]
  105.     unless @actors.include?(actor) or @waiting_actors.include?(actor)
  106.       if @actors.size < BFS_Setting::BATTLE_MAX
  107.         @actors.push(actor)
  108.         $game_player.refresh
  109.         friend_party_update
  110.         BFS_Friends.add(actor_id)
  111.         $scene.spriteset.dispose
  112.         $scene.spriteset = Spriteset_Map.new
  113.         BFS_Friends.weapon_recheck
  114.       else
  115.         if @waiting_actors.size < BFS_Setting::WAITING_MAX
  116.           @waiting_actors.push(actor)
  117.         end
  118.       end
  119.     end
  120.   end
  121. end
  122. #==============================================================================
  123. # --- XRXS. 第二カーソル 機構 ---
  124. #------------------------------------------------------------------------------
  125. #     ウィンドウに .index2 プロパティを追加します。
  126. #==============================================================================
  127. module XRXS_Cursor2
  128.   #--------------------------------------------------------------------------
  129.   # ● オブジェクト初期化
  130.   #--------------------------------------------------------------------------
  131.   def initialize(x, y, w, h)
  132.     super(x, y, h, w)
  133.     # 補助ウィンドウ(透明)を作成:カーソル専用
  134.     @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
  135.     @xrxsc2_window.opacity = 0
  136.     @xrxsc2_window.active = false
  137.     @xrxsc2_window.index = -1
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ○ 第二カーソルの設置
  141.   #--------------------------------------------------------------------------
  142.   def index2
  143.     return @xrxsc2_window.index
  144.   end
  145.   def index2=(index)
  146.     @xrxsc2_window.index = index
  147.     if index == -1
  148.       @xrxsc2_window.cursor_rect.empty
  149.     else
  150.       @xrxsc2_window.x = self.x
  151.       @xrxsc2_window.y = self.y
  152.       @xrxsc2_window.cursor_rect = self.cursor_rect
  153.     end
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ○ 先頭の行の設定
  157.   #--------------------------------------------------------------------------
  158.   def top_row=(row)
  159.     super
  160.     # 補助ウィンドウの oy を更新
  161.     pre_oy = @xrxsc2_window.oy
  162.     @xrxsc2_window.oy = self.oy
  163.     @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ○ 解放
  167.   #--------------------------------------------------------------------------
  168.   def dispose
  169.     @xrxsc2_window.dispose
  170.     super
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ○ X, Y 座標
  174.   #--------------------------------------------------------------------------
  175.   def x=(n)
  176.     super
  177.     @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
  178.   end
  179.   def y=(n)
  180.     super
  181.     @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
  182.   end
  183. end
  184. # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
  185. # by 桜雅 在土

  186. #==============================================================================
  187. # ■ Window_MenuStatus
  188. #==============================================================================
  189. class Window_MenuStatus < Window_Selectable
  190.   #--------------------------------------------------------------------------
  191.   # ○ インクルード
  192.   #--------------------------------------------------------------------------
  193.   include XRXS_Cursor2
  194.   #--------------------------------------------------------------------------
  195.   # ● 公開インスタンス変数
  196.   #--------------------------------------------------------------------------
  197.   attr_reader   :column_max             # 列数
  198.   #--------------------------------------------------------------------------
  199.   # ● オブジェクト初期化
  200.   #--------------------------------------------------------------------------
  201.   def initialize
  202.     h = 480
  203.     if MENU_STATUS_STRETCH
  204.       h = BATTLE_MAX * 116 + 16
  205.     end
  206.     super(0, 0, 480, h)
  207.     h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
  208.     self.contents = Bitmap.new(width - 32, h)
  209.     self.active = false
  210.     self.index = -1
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ○ 1 ページに表示できる行数の取得
  214.   #--------------------------------------------------------------------------
  215.   def page_row_max
  216.     if MENU_STATUS_STRETCH
  217.       return BATTLE_MAX          # 戦闘パーティ最大数
  218.     else
  219.       return [BATTLE_MAX, 4].max # 戦闘パーティ最大数(最低4)
  220.     end
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ○ 先頭の行の取得
  224.   #--------------------------------------------------------------------------
  225.   def top_row
  226.     # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
  227.     return self.oy / LINE_HEIGHT
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ○ 先頭の行の設定
  231.   #--------------------------------------------------------------------------
  232.   def top_row=(row)
  233.     super
  234.     self.oy = self.oy/32 * LINE_HEIGHT
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● カーソルの矩形更新
  238.   #--------------------------------------------------------------------------
  239.   def update_cursor_rect
  240.     super
  241.     unless @index < 0
  242.       y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
  243.       self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
  244.     end
  245.   end
  246. end
  247. #==============================================================================
  248. # ■ Scene_Menu
  249. #==============================================================================
  250. class Scene_Menu
  251.   include BFS_Setting
  252.   #--------------------------------------------------------------------------
  253.   # ● フレーム更新
  254.   #--------------------------------------------------------------------------
  255.   alias xrxs26ax_update update
  256.   def update
  257.     # インデックスを保存
  258.     @status_index = @status_window.index
  259.     # 呼び戻す
  260.     xrxs26ax_update
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  264.   #--------------------------------------------------------------------------
  265.   alias xrxs26ax_update_command update_command
  266.   def update_command
  267.     # 呼び戻す
  268.     xrxs26ax_update_command
  269.     # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
  270.     if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
  271.        @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
  272.        if $game_map.map_id  == 6
  273.       # 決定 SE を演奏
  274.       $game_system.se_play($data_system.decision_se)
  275.       # カーソル位置を記憶
  276.       @command_index_before_menu_member_change = @command_window.index
  277.       # 入れ替えウィンドウへ移行
  278.       @command_window.active = false
  279.       @command_window.index = -1
  280.       @status_window.active = true
  281.       @status_window.index = 0
  282.     else
  283.       end
  284.     end
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  288.   #--------------------------------------------------------------------------
  289.   alias xrxs26ax_update_status update_status
  290.   def update_status
  291.     # 呼び戻す
  292.     if @command_window.index != -1
  293.       xrxs26ax_update_status
  294.       return
  295.     end
  296.     # B ボタンか入れ替え終了キーが押されたとき
  297.     if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
  298.         @status_window.index2 == -1 and
  299.         @status_index%@status_window.column_max == 0)
  300.       # キャンセル SE を演奏
  301.       $game_system.se_play($data_system.cancel_se)
  302.       # コマンドウィンドウをアクティブにする
  303.       @command_window.active = true
  304.       @command_window.index = 0
  305.       @status_window.active = false
  306.       @status_window.index = -1
  307.       return
  308.     end
  309.     # B ボタンが押されたとき
  310.     if Input.trigger?(Input::B) and @status_window.index2 >= 0
  311.       @status_window.index = @status_window.index2
  312.       @status_window.index2 = -1
  313.       return
  314.     end
  315.     # 決定キーが押されたとき
  316.     if Input.trigger?(Input::C)
  317.       if @status_window.index2 == -1
  318.         if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
  319.           # ブザー SE を演奏
  320.           $game_system.se_play($data_system.buzzer_se)
  321.           return
  322.         end
  323.         # 決定 SE を演奏
  324.         $game_system.se_play($data_system.decision_se)
  325.         # メンバーの入れ替え一人目の決定
  326.         @status_window.index2 = @status_window.index
  327.       else
  328.         if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
  329.           # ブザー SE を演奏
  330.           $game_system.se_play($data_system.buzzer_se)
  331.           return
  332.         end
  333.         # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
  334.         if (@status_window.index < BATTLE_MAX or
  335.             @status_window.index2 < BATTLE_MAX) and
  336.            (UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
  337.             UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
  338.           # ブザー SE を演奏
  339.           $game_system.se_play($data_system.buzzer_se)
  340.           return
  341.         end
  342.         # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
  343.         if (@status_window.index >= BATTLE_MAX or
  344.             @status_window.index2 >= BATTLE_MAX) and
  345.            (FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
  346.             FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
  347.           # ブザー SE を演奏
  348.           $game_system.se_play($data_system.buzzer_se)
  349.           return
  350.         end
  351.         # 決定 SE を演奏
  352.         $game_system.se_play($data_system.decision_se)
  353.         # メンバーの入れ替え二人目の決定と入れ替えの実行
  354.         actor2 = @status_window.all_actors[@status_window.index]
  355.         actor = @status_window.all_actors[@status_window.index2]
  356.         @status_window.all_actors[@status_window.index2] = actor2
  357.         @status_window.all_actors[@status_window.index] = actor
  358.         $game_party.actors.clear
  359.         $game_party.waiting_actors.clear
  360.         for i in [email]0...@status_window.all_actors.size[/email]
  361.           if i < BATTLE_MAX
  362.             $game_party.actors.push(@status_window.all_actors[i])
  363.           else
  364.             $game_party.waiting_actors.push(@status_window.all_actors[i])
  365.           end
  366.         end
  367.         $game_temp.friends_need_refresh = true
  368.         @status_window.index = @status_window.index2
  369.         @status_window.index2 = -1
  370.         $game_party.friend_party_update
  371.         # プレイヤーをリフレッシュ
  372.         $game_player.refresh
  373.         # ステータスウィンドウをリフレッシュ
  374.         @status_window.refresh
  375.       end
  376.       return
  377.     end
  378.   end
  379. end
  380. #==============================================================================
  381. # ■ Window_MenuStatus
  382. #==============================================================================
  383. class Window_MenuStatus < Window_Selectable
  384.   #--------------------------------------------------------------------------
  385.   # ○ インクルード
  386.   #--------------------------------------------------------------------------
  387.   include BFS_Setting
  388.   #--------------------------------------------------------------------------
  389.   # ● 公開インスタンス変数
  390.   #--------------------------------------------------------------------------
  391.   attr_reader   :newitem_window
  392.   attr_reader   :all_actors
  393.   attr_reader   :bottomkeyhelp_window
  394.   #--------------------------------------------------------------------------
  395.   # ● オブジェクト初期化
  396.   #--------------------------------------------------------------------------
  397.   alias xrxs26bx_initialize initialize
  398.   def initialize
  399.     # 呼び戻す
  400.     xrxs26bx_initialize
  401.     # 寄生してウィンドウを作成
  402.     # ボトルキーヘルプウィンドウ
  403.     @bottomkeyhelp_window = Window_BottomKeyHelp.new
  404.     @bottomkeyhelp_window.visible = false
  405.     # 設定変更
  406.     self.height   = 448
  407.     self.contents = Bitmap.new(width - 32, height - 32)
  408.     @all_actors = $game_party.actors + $game_party.waiting_actors
  409.     refresh
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● リフレッシュ
  413.   #--------------------------------------------------------------------------
  414.   def refresh
  415.     self.contents.clear
  416.     @item_max = @all_actors.size
  417.     @column_max = 2
  418.     y = (BATTLE_MAX+1)/2 * 64 + 28
  419.     self.contents.font.size = 16
  420.     self.contents.font.color = system_color
  421.     self.contents.draw_text(4, 0, 92, 28, "参战")
  422.     self.contents.draw_text(4, y, 92, 28, "休息")
  423.     for i in [email]0...@all_actors.size[/email]
  424.       x = 64 + i%2 * 224
  425.       y = i/2 *  72 + 24
  426.       actor = @all_actors[i]
  427.       if i >= BATTLE_MAX
  428.         y += 32
  429.         self.contents.font.color = disabled_color
  430.         self.contents.draw_text(x, y, 120, 32, actor.name)
  431.       else
  432.         draw_actor_name(actor   , x     , y     )
  433.       end
  434.       draw_actor_graphic(actor, x - 40, y + 64)
  435.       draw_actor_level(actor  , x + 94, y     )
  436.       draw_actor_hp(actor     , x, y + 16)
  437.       draw_actor_sp(actor     , x, y + 32)
  438.       draw_actor_state(actor  , x, y + 48)
  439.     end
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # ○ フレーム更新
  443.   #--------------------------------------------------------------------------
  444.   def update
  445.     # ウィンドウを更新
  446.     @bottomkeyhelp_window.update
  447.     super
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # ○ 解放
  451.   #--------------------------------------------------------------------------
  452.   def dispose
  453.     @bottomkeyhelp_window.dispose
  454.     super
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● カーソルの矩形更新
  458.   #--------------------------------------------------------------------------
  459.   def update_cursor_rect
  460.     if @index < 0
  461.       self.cursor_rect.empty
  462.     else
  463.       y = @index/2 * 72 + 28
  464.       if @index >= BATTLE_MAX
  465.         y += 32
  466.       end
  467.       self.cursor_rect.set(@index%2 * 224, y, 224, 72)
  468.     end
  469.   end
  470. end
  471. #==============================================================================
  472. # ■ Scene_Menu
  473. #==============================================================================
  474. class Scene_Menu
  475.   #--------------------------------------------------------------------------
  476.   # ● フレーム更新
  477.   #--------------------------------------------------------------------------
  478.   alias xrxs26bx_update update
  479.   def update
  480.     # 登録
  481.     if @bottomkeyhelp_window.nil?
  482.       @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
  483.       @bottomkeyhelp_window.visible = true
  484.       set_keyhelp1
  485.     end
  486.     # 呼び戻す
  487.     xrxs26bx_update
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
  491.   #--------------------------------------------------------------------------
  492.   alias xrxs26bx_update_command update_command
  493.   def update_command
  494.     # 呼び戻す
  495.     xrxs26bx_update_command
  496.     # 入れ替え移行キーが押されたとき
  497.     if @command_window.index == -1 and @status_window.active
  498.       set_keyhelp2
  499.     end
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
  503.   #--------------------------------------------------------------------------
  504.   alias xrxs26bx_update_status update_status
  505.   def update_status
  506.     # 保存
  507.     last_index = @status_window.index2
  508.     # 呼び戻す
  509.     xrxs26bx_update_status
  510.     #
  511.     if last_index != @status_window.index2
  512.       # 一人目を選択した場合
  513.       if @status_window.index2 >= 0
  514.         set_keyhelp3
  515.       else
  516.         set_keyhelp2
  517.       end
  518.     end
  519.     # 戻った場合
  520.     unless @status_window.active
  521.       set_keyhelp1
  522.     end
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # ○ キーヘルプを設定 1
  526.   #--------------------------------------------------------------------------
  527.   def set_keyhelp1
  528.     @bottomkeyhelp_window.clear
  529.     @bottomkeyhelp_window.add("B","关闭本窗口")
  530.     @bottomkeyhelp_window.add("C","确定")
  531.     @bottomkeyhelp_window.add("→","人物顺序调整")
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ○ キーヘルプを設定 2
  535.   #--------------------------------------------------------------------------
  536.   def set_keyhelp2
  537.     @bottomkeyhelp_window.clear
  538.     @bottomkeyhelp_window.add("←,B","返回")
  539.     @bottomkeyhelp_window.add("C","第一个人物确定")
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # ○ キーヘルプを設定 3
  543.   #--------------------------------------------------------------------------
  544.   def set_keyhelp3
  545.     @bottomkeyhelp_window.clear
  546.     @bottomkeyhelp_window.add("B","返回")
  547.     @bottomkeyhelp_window.add("C","第二个人物确定")
  548.   end
  549. end



  550. #==============================================================================
  551. # □ Window_BottomKeyHelp
  552. #------------------------------------------------------------------------------
  553. #     画面下で操作説明をする透明なウィンドウです。
  554. #==============================================================================
  555. class Window_BottomKeyHelp < Window_Base
  556.   #--------------------------------------------------------------------------
  557.   # ○ オブジェクト初期化
  558.   #--------------------------------------------------------------------------
  559.   def initialize
  560.     super(0, 432, 640, 64)
  561.     self.contents = Bitmap.new(width - 32, height - 32)
  562.     self.opacity = 0
  563.     clear
  564.   end
  565.   #--------------------------------------------------------------------------
  566.   # ○ クリア
  567.   #--------------------------------------------------------------------------
  568.   def clear
  569.     self.contents.clear
  570.     @now_x = 608
  571.   end
  572.   #--------------------------------------------------------------------------
  573.   # ○ 追加
  574.   #--------------------------------------------------------------------------
  575.   def add(key, explanation)
  576.     # 計算
  577.     self.contents.font.size = 20
  578.     x  = self.contents.text_size(key).width
  579.     self.contents.font.size = 16
  580.     x += self.contents.text_size(explanation).width + 8
  581.     @now_x -= x
  582.     # 描写
  583.     self.contents.font.size = 20
  584.     self.contents.font.color = system_color
  585.     self.contents.draw_text(@now_x, 0, x, 32, key, 0)
  586.     self.contents.font.size = 16
  587.     self.contents.font.color = normal_color
  588.     self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
  589.     # 余白
  590.     @now_x -= 32
  591.   end
  592. end

  593. #==============================================================================
  594. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  595. #==============================================================================
复制代码

评分

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

查看全部评分

梦石
0
星屑
9726
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2016-1-31 14:33:24 | 显示全部楼层
本帖最后由 cinderelmini 于 2016-2-2 11:39 编辑

楼层更新:
·改变量名字的规则还是原来那样
·更改活动队伍最大值之后使用脚本【$game_party.refresh_fbs】刷新试试看
·待机队伍最大值改变的话不会刷新
点击展开/收起

  1. class Game_Party
  2.   def refresh_fbs
  3.     return if @actors.size == BFS_Setting::BATTLE_MAX
  4.     # 活动队伍数量增加时
  5.     if @actors.size < BFS_Setting::BATTLE_MAX
  6.       change_size = (@actors.size - BFS_Setting::BATTLE_MAX).abs
  7.       # 把等待队伍开头的角色塞进活动队伍
  8.       for i in 0...change_size
  9.         if @waiting_actors != []
  10.           break if @waiting_actors.size < 1
  11.           waiting_leader = @waiting_actors[0]
  12.           @waiting_actors.delete_at(0)
  13.           @actors.push(waiting_leader)
  14.           BFS_Friends.add(waiting_leader.id)
  15.         end
  16.       end
  17.       # BFS刷新
  18.       friend_party_update
  19.       $scene.spriteset.dispose
  20.       $scene.spriteset = Spriteset_Map.new
  21.       BFS_Friends.weapon_recheck
  22.     # 活动中的角色数量减少时
  23.     else
  24.       change_size = (@actors.size - BFS_Setting::BATTLE_MAX).abs
  25.       for i in 0...change_size
  26.         break if @actors.size < 2
  27.         to_wait_actor = @actors.pop
  28.         @waiting_actors.insert(0, to_wait_actor)
  29.       end
  30.       # FBS刷新
  31.       friend_party_update
  32.       BFS_Friends.delete_all_friends
  33.       BFS_Friends.prepare_for_transferring
  34.       $game_player.refresh
  35.       $scene.spriteset.dispose
  36.       $scene.spriteset = Spriteset_Map.new
  37.       $scene.hud_update
  38.     end
  39.   end
  40.   
  41. end
复制代码

点评

用现在这楼的办法也不会刷新?  发表于 2016-2-1 14:28
可以了。我已经解决了。就是一开始设定参战人数至少2就没事。就只有$game_variables[1]增加后不会马上刷新的问题了。  发表于 2016-2-1 14:27
嘛……说到底还是各种兼容问题~一个一个兼容太累了~最好还是自己能理解然后自己能处理吧~  发表于 2016-2-1 11:21
@battler = $game_party.actors[self.party_id]是另外个脚本里这个报错  发表于 2016-2-1 00:31
我修改了角色重复脚本里判断加入>后面改成变量就能待机参战了。问题是入队后再改变量再入队,就cannot convert array into integer说不是整数  发表于 2016-2-1 00:26

评分

参与人数 2星屑 +160 收起 理由
RyanBern + 150 认可答案
yang1zhi + 10 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部