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

Project1

 找回密码
 注册会员
搜索
查看: 2025|回复: 7

[已经解决] 问个小白问题!关于主站上无冲突版人物仓库指令应用!

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
284 小时
注册时间
2012-9-9
帖子
24
发表于 2013-6-13 16:37:58 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 亿万星辰 于 2013-6-14 06:59 编辑

本人接触RM时间不久……更是彻彻底底的脚本盲……
是在是不会调用脚本中的指令……研究N就不是冲突就是错误……求教的说!!!
用的是主站上的人物仓库脚本,Scene_Menu增加了更换队伍指令……游戏初期就可以调换队友……
可是接着就出问题了……才刚选择开始应该就主角一人在队伍中,没有其他队友……但是调整队伍哪里却是数据库中设置的所有角色都存在并可以调换……求解……
顺便由于实在脚本晕,所以想了解一下确切的指令比如类似怎么加入多余的角色入仓库(4人满了以后调换用),怎么删除离队的仓库角色……以上!!!
这是哪个脚本……
  1. #party转换
  2. #这是简易的party转换的脚本。


  3. class Game_Party
  4. attr_accessor :party_max
  5. attr_accessor :party_min
  6. alias party_select_initialize initialize
  7. def initialize
  8.    party_select_initialize
  9.    @party_max = 4
  10.    @party_min = 1
  11. end
  12. def add_actor(actor_id)
  13.    # 获取角色
  14.    actor = $game_actors[actor_id]
  15.    # 同伴人数未满 4 人、本角色不在队伍中的情况下
  16.    if @actors.size < 4 and not @actors.include?(actor)
  17.      # 添加角色
  18.      @actors.push(actor)
  19.      # 还原主角
  20.      $game_player.refresh
  21.    end
  22.   #--------------------------------------------------------------------------
  23.   # ● 角色离开
  24.   #     actor_id : 角色 ID
  25.   #--------------------------------------------------------------------------
  26.   def remove_actor(actor_id)
  27.     # 删除觉得
  28.     @actors.delete($game_actors[actor_id])
  29.     # 还原主角
  30.     $game_player.refresh
  31.   end
  32. end
  33. end

  34. class Window_Party_Select < Window_Selectable
  35. #--------------------------------------------------------------------------
  36. # ● オブジェクト初期化
  37. #--------------------------------------------------------------------------
  38. def initialize
  39.    super(324, 24, 304, 384)
  40.    @party_in_ok_menber = party_in_menber
  41.    @item_max = party_in_menber.size
  42.    self.contents = Bitmap.new(width - 32, row_max * 32)
  43.    self.index = 0
  44. #==============================================================================
  45.    self.opacity = 0
  46.    refresh
  47. end
  48. #--------------------------------------------------------------------------
  49. # ● アクターの取得
  50. #--------------------------------------------------------------------------
  51. def menber
  52.    return @party_in_ok_menber[self.index]
  53. end
  54. #--------------------------------------------------------------------------
  55. # ● パーティーin可能なメンバー取得
  56. #--------------------------------------------------------------------------
  57. def party_in_menber
  58.    menber = []
  59.    menber.push($game_actors[1])  
  60.    menber.push($game_actors[2])
  61.    menber.push($game_actors[3])
  62.    menber.push($game_actors[4])
  63.    menber.push($game_actors[5])
  64.    menber.push($game_actors[6])
  65.    menber.push($game_actors[7])
  66.    menber.push($game_actors[8])
  67.    menber.push($game_actors[9])
  68.    menber.push($game_actors[10])
  69.    menber.push($game_actors[11])
  70.    menber.push($game_actors[12])
  71.    menber.push($game_actors[13])
  72.    menber.push($game_actors[14])
  73.    menber.delete($game_actors[6])  if $game_switches[984]
  74.    menber.delete($game_actors[12])  if $game_switches[985]
  75.    return menber
  76. end
  77. #--------------------------------------------------------------------------
  78. # ● リフレッシュ
  79. #--------------------------------------------------------------------------
  80. def refresh
  81.    self.contents.clear
  82.    for i in [email]0...@party_in_ok_menber.size[/email]
  83.      draw_menber(i)
  84.    end
  85. end
  86. #--------------------------------------------------------------------------
  87. # ● アクター描画
  88. #--------------------------------------------------------------------------
  89. def draw_menber(index)
  90.    actor = @party_in_ok_menber[index]
  91.    text = @party_in_ok_menber[index].name
  92.    lv = @party_in_ok_menber[index].level.to_s + " "
  93.    x = 4 + index % @column_max
  94.    y = index / @column_max * 32
  95.    if $game_party.actors.include?(actor)
  96.      color = normal_color
  97.      opacity = 255
  98.    else
  99.      color = disabled_color
  100.      opacity = 128
  101.    end
  102.    self.contents.font.color = color
  103.    self.contents.draw_text(x, y, 120, 32, actor.name)
  104.    self.contents.draw_text(8, index * 32+2, 262, 32,  "Level:   ", 2)
  105.    self.contents.draw_text(8, index * 32+2, 262, 32,  lv, 2)
  106.    self.contents.font.color = normal_color
  107.    self.contents.font.size = 19
  108. #==============================================================================
  109. end
  110. #--------------------------------------------------------------------------
  111. # ● カーソルの矩形更新
  112. #--------------------------------------------------------------------------
  113.   def update_cursor_rect
  114.     if @index < 0
  115.       self.cursor_rect.empty
  116.       return
  117.     end
  118.     row = @index / @column_max
  119.     if row < self.top_row
  120.       self.top_row = row
  121.     end
  122.     if row > self.top_row + (self.page_row_max - 1)
  123.       self.top_row = row - (self.page_row_max - 1)
  124.     end
  125.     cursor_width = 270
  126.     x = @index % @column_max * (cursor_width + 32)
  127.     y = @index / @column_max * 32 - self.oy
  128.     self.cursor_rect.set(x, y, cursor_width, 32)
  129.   end
  130.   def item_max
  131.     return @item_max
  132.   end
  133.   def actor?(index)
  134.     return @actors[index] == nil ? false : true
  135.   end
  136.   def set_index(x)
  137.     @index = x
  138.   end
  139. end

  140. class Window_Party_Select_Menber < Window_Base
  141. #--------------------------------------------------------------------------
  142. # ● オブジェクト初期化
  143. #--------------------------------------------------------------------------
  144.   def initialize
  145.     super(8, 12, 304, 224)
  146.     self.contents = Bitmap.new(width - 32, height - 32)
  147. #==============================================================================
  148.     self.opacity = 0
  149.     refresh
  150.   end
  151.   def actor
  152.     return @actors[self.index]
  153.   end
  154.   def refresh
  155.     if self.contents != nil
  156.       self.contents.dispose
  157.       self.contents = nil
  158. #==============================================================================
  159.       self.opacity = 0
  160.     end
  161.     @actors = []
  162.     for i in 0...$game_party.actors.size
  163.       @actors.push($game_party.actors[i])
  164.     end
  165.    
  166.     @item_max = 4
  167.     if @item_max > 0
  168.       self.contents = Bitmap.new(width - 32, height - 32)
  169.       for i in 0...@item_max
  170. #==============================================================================
  171.       self.opacity = 0
  172.         draw_item(i)
  173.       end
  174.     end
  175.   end
  176.   def draw_item(index)
  177.     if @actors[index] != nil
  178.       actor = @actors[index]
  179.       text = @actors[index].name
  180.       lv = @actors[index].level.to_s + " "
  181.       self.contents.font.color = Color.new(255, 255, 128, 255) #可以被移动的颜色
  182.       self.contents.draw_text(8, index * 32 + 32, 262, 32, text)
  183.       self.contents.font.color = normal_color
  184.       self.contents.font.size = 16
  185.       self.contents.draw_text(8, index * 32 + 32, 262, 32, "Level:   ", 2)
  186.       colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  187.       colory = [255.0000 / 60 * @actors[index].level,255].min
  188.       self.contents.font.color = Color.new(colorx, colory, 0)
  189.       self.contents.draw_text(8, index * 32 + 32, 262, 32,  lv, 2)
  190.       self.contents.font.color = Color.new(0, 255, 0)
  191.       self.contents.font.size = 19
  192. #==============================================================================
  193.       self.opacity = 0
  194.     else
  195.       self.contents.draw_text(8, index * 32 + 32, 262, 32,  "没有角色")
  196.     end
  197.   end
  198.   def update_cursor_rect
  199.     if @index < 0
  200.       self.cursor_rect.empty
  201.       return
  202.     end
  203.     row = @index / @column_max
  204.     if row < self.top_row
  205.       self.top_row = row
  206.     end
  207.     if row > self.top_row + (self.page_row_max - 1)
  208.       self.top_row = row - (self.page_row_max - 1)
  209.     end
  210.     cursor_width = self.width / @column_max - 32
  211.     x = @index % @column_max * (cursor_width + 32)
  212.     y = @index / @column_max * 32 - self.oy + 32
  213.     self.cursor_rect.set(x, y, cursor_width, 32)
  214.   end
  215.   def item_max
  216.     return @item_max
  217.   end
  218.   def actor?(index)
  219.     return @actors[index] == nil ? false : true
  220.   end
  221.   def set_index(x)
  222.     @index = x
  223.   end
  224. end

  225. class Window_Party_Select_Menber_Status < Window_Base
  226. #--------------------------------------------------------------------------
  227. # ● オブジェクト初期化
  228. #--------------------------------------------------------------------------
  229. def initialize
  230.    super(8, 232, 304, 256)
  231.    self.contents = Bitmap.new(width - 32, height - 32)
  232. #==============================================================================
  233.    self.opacity = 0
  234. end
  235. #--------------------------------------------------------------------------
  236. # ● リフレッシュ
  237. #--------------------------------------------------------------------------
  238. def refresh(actor)
  239.    self.contents.clear
  240.    draw_actor_name(actor, 24, 16)
  241.    draw_actor_state(actor, 132, 48)
  242.    draw_actor_hp(actor, 116, 80)
  243.    draw_actor_sp(actor, 116, 112)
  244.    draw_actor_level(actor, 24, 48)
  245.    draw_actor_class(actor, 132, 16)
  246.    draw_actor_graphic(actor, 40, 138)
  247.    [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  248. end
  249. end

  250. class Scene_Party_in
  251. #--------------------------------------------------------------------------
  252. # ● メイン処理
  253. #--------------------------------------------------------------------------
  254. def main
  255. #######################################
  256.    @background = Sprite.new
  257.    @background.bitmap = RPG::Cache.picture("ckbj")
  258.    @background.x = 0
  259.    @background.y = 0
  260. #######################################
  261.    @main_window = Window_Party_Select.new
  262.    @menber_window = Window_Party_Select_Menber.new
  263.    @status_window = Window_Party_Select_Menber_Status.new
  264.    @status_window.opacity = 0
  265.    @status_window.z += 0
  266.    @show_index = 0
  267.    status_window_position
  268.    @status_window.refresh(@main_window.menber)
  269.    @status_window.visible = true
  270.    @show_index = @main_window.index
  271.    # トランジション実行
  272.    Graphics.transition
  273.    # メインループ
  274.    loop do
  275.      # ゲーム画面を更新
  276.      Graphics.update
  277.      # 入力情報を更新
  278.      Input.update
  279.      # フレーム更新
  280.      update
  281.      # 画面が切り替わったらループを中断
  282.      if $scene != self
  283.        break
  284.      end
  285.    end
  286.    # トランジション準備
  287.    Graphics.freeze
  288.    # ウィンドウを解放
  289.    @background.dispose
  290.    @main_window.dispose
  291.    @menber_window.dispose
  292.    @status_window.dispose
  293. end
  294. #--------------------------------------------------------------------------
  295. # ● フレーム更新
  296. #--------------------------------------------------------------------------
  297. def update
  298.    # コマンドウィンドウを更新
  299.    @background.update
  300.    @main_window.update
  301.    if @status_window.visible and @show_index != @main_window.index
  302.      status_window_position
  303.      @status_window.refresh(@main_window.menber)
  304.      @show_index = @main_window.index
  305.    end
  306.    # B ボタンが押された場合
  307.    if Input.trigger?(Input::B)
  308.      if $game_party.actors.size < 1
  309.        # ブザー SE を演奏
  310.        $game_system.se_play($data_system.buzzer_se)
  311.        return
  312.      end
  313.      # キャンセル SE を演奏
  314.      $game_system.se_play($data_system.cancel_se)
  315.      # メニュー画面に切り替え
  316.      $scene = Scene_Menu.new(5)
  317.      return
  318.    end
  319.    # C ボタンが押された場合
  320.    if Input.trigger?(Input::C)
  321.      # 選択したアクターが強制加入アクターの場合入れ替え不可
  322.      if $game_party.actors.include?(@main_window.menber)
  323.        $game_party.remove_actor(@main_window.menber.id)
  324.      else
  325.        if $game_party.actors.size == $game_party.party_max
  326.          # ブザー SE を演奏
  327.          $game_system.se_play($data_system.buzzer_se)
  328.          return
  329.        end
  330.        $game_party.add_actor(@main_window.menber.id)
  331.      end
  332.      # 決定 SE を演奏
  333.      $game_system.se_play($data_system.decision_se)
  334.      @main_window.refresh
  335.      @menber_window.refresh
  336.      return
  337.    end
  338.     # A ボタンが押された場合
  339.    #if Input.trigger?(Input::A)
  340.      # 決定 SE を演奏
  341.      #$game_system.se_play($data_system.decision_se)
  342.      #if @status_window.visible
  343.         #@status_window.visible = false

  344.      #else
  345.         #status_window_position
  346.         #@status_window.refresh(@main_window.menber)
  347.         #@status_window.visible = true
  348.         #@show_index = @main_window.index
  349.      #end
  350.      #return
  351.    #end
  352. end
  353. def status_window_position
  354.    if @main_window.cursor_rect.y < 176
  355.      @status_window.y = 232
  356.    else
  357.      @status_window.y = 232
  358.    end
  359. end
  360. end
  361.   
复制代码

点评

发布帖子的时候有个“<>”的图案,点下去吧,那是代码功能,贴脚本用的==  发表于 2013-6-14 00:31

Lv1.梦旅人

梦石
0
星屑
50
在线时间
192 小时
注册时间
2010-8-23
帖子
161
发表于 2013-6-14 10:02:40 | 显示全部楼层
又见楼主了……
其实这个脚本是有大量注释的,我也用着这个脚本,不过你的这个好像没有。
强制角色(意思就是不能离开的人)的设定方法:
在脚本12行@party_min = 1下加入一句@must_actors = [1]就表示一号角色不能退出,事件中调用 方法是用事件中的脚本输入$game_party.must_actors = [1],表示1号角色不能离开。
可能加入的玩家列表的设定方法:
第60行,
def party_in_menber
menber = []的下面,有一些
  menber.push($game_actors[1])  
   menber.push($game_actors[2])
   menber.push($game_actors[3])
   menber.push($game_actors[4])
   menber.push($game_actors[5])
   menber.push($game_actors[6])
   menber.push($game_actors[7])
   menber.push($game_actors[8])
   menber.push($game_actors[9])
   menber.push($game_actors[10])
   menber.push($game_actors[11])
   menber.push($game_actors[12])
   menber.push($game_actors[13])
这就表示1~13号角色都是可能加入的,如果想让他们在一定情况才可以加入需要往下看
   menber.delete($game_actors[6])  if $game_switches[984]
   menber.delete($game_actors[12])  if $game_switches[985]
这两个表示了,如果如果第984号开关是开着的,第六号角色才会加入,调用这个脚本时压根就不会有他们的存在,就算这个第六号角色已经在你队伍里了也无法进行操作(例如退出团队)

PS:pt的艺术家油画笔干画笔+调色刀还是很好用的。
如果解决的话去http://rpg.blue/thread-244080-1-1.html结贴吧……
其实我是个三流的画师  ←_←
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
284 小时
注册时间
2012-9-9
帖子
24
 楼主| 发表于 2013-6-14 11:35:44 | 显示全部楼层
512195574 发表于 2013-6-14 10:02
又见楼主了……
其实这个脚本是有大量注释的,我也用着这个脚本,不过你的这个好像没有。
强制角色(意思就 ...

QQ截图20130614113036.png
哭……还是没搞懂……我试过结果每次在事件中插入指令都是冲突……这下更是脚本冲突了……只能先禁用更换队伍这个选项这个选项了……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
192 小时
注册时间
2010-8-23
帖子
161
发表于 2013-6-14 11:42:01 | 显示全部楼层
陌鸢 发表于 2013-6-14 11:35
哭……还是没搞懂……我试过结果每次在事件中插入指令都是冲突……这下更是脚本冲突了……只能先禁用更 ...
  1. #party转换
  2. #这是简易的party转换的脚本。

  3. #召唤界面:$scene = Scene_Party_in.new
  4. #可以用开关的on off来决定转换的操作可能与否。
  5. #此外,也可以设定不想要离开的角色。
  6. #不过由于毕竟只有角色的加入和退出的功能,使用起来可能不是很方便。
  7. #可以适应简单的身份表示。
  8. #用键盘a来做身份表示与否的变更。
  9. #设定方法
  10. #可加入party的最高人数
  11. #变更下面的@party_max = 4部分,通常用4。
  12. #可参加party的最少人数(必须选择的最低人数)
  13. #变更下面的@party_min = 1部分,初期姑且设定为1。
  14. #强制加入的角色(必须要加入到party中的角色)
  15. #变更下面的@must_actors = [$game_actors[1]]部分
  16. #在初级阶段,姑且将其设定为ID1号的角色(アルシェス)
  17. #设定的例子
  18. #@must_actors = [1, 2]
  19. #这样,1号和2号ID的角色就被设定为强制加入的角色了。
  20. #顺便一提,用事件指示的剧本,也就是
  21. #$game_party.must_actors = [1]
  22. #等,可以在游戏进行中设定。(最高最低人数等也同样是可能的。)
  23. #判断可否加入party
  24. #用 class Window_Party_Select 的 party_in_menber 来设定。
  25. #设定例子
  26. # menber.push($game_actors[1])  
  27. # menber.push($game_actors[2])  if $game_switches[1]
  28. #这样,就使1号ID的角色(アルシェス)的经常加入变为可能。
  29. #2号ID的角色(是谁来着?)在游戏开关的1号是on状态下将可能加入。
  30. #在初期设定阶段,1号ID是经常加入可能状态、
  31. #2-8号ID则被设定为各自在游戏开关的1-7号是on状态下方可加入。
  32. #
  33. #  2005.9.24 バグ修正
  34. #  強制加入アクターがセーブに反映されないバグを修正。
  35. #  強制加入アクターの指定方法が変更されたので注意。
  36. #
  37. # 2006.2.5 柳柳修正
  38. #  直接放入了add_actor
  39. #  如果需要把战斗图改为行走图,本脚本找到draw_actor_battler(actor,x,y)替换为:draw_actor_graphic(actor, x+40, y + 80)
  40. #  增加exp描绘

  41. class Game_Party
  42. attr_accessor :party_max
  43. attr_accessor :party_min
  44. attr_accessor :must_actors
  45. alias party_select_initialize initialize
  46. def initialize
  47.    party_select_initialize
  48.    @party_max = 4
  49.    @party_min = 1
  50.    @must_actors = [2]
  51. end
  52. def must_actor_include?(actor)
  53.    return @must_actors.include?(actor.id)
  54. end
  55. def add_actor(actor_id)
  56.    # 获取角色
  57.    actor = $game_actors[actor_id]
  58.    # 同伴人数未满 4 人、本角色不在队伍中的情况下
  59.    if @actors.size < @party_max and not @actors.include?(actor)
  60.      # 添加角色
  61.      @actors.push(actor)
  62.      # 还原主角
  63.      $game_player.refresh
  64.    end
  65. end
  66. end

  67. class Window_Party_Select < Window_Selectable
  68. #--------------------------------------------------------------------------
  69. # ● オブジェクト初期化
  70. #--------------------------------------------------------------------------
  71. def initialize
  72.    super(0, 96, 640, 384)
  73.    @party_in_ok_menber = party_in_menber
  74.    @item_max = party_in_menber.size
  75.    @column_max = 4
  76.    self.contents = Bitmap.new(width - 32, row_max * 176)
  77.    self.index = 0
  78.    refresh
  79. end
  80. #--------------------------------------------------------------------------
  81. # ● アクターの取得
  82. #--------------------------------------------------------------------------
  83. def menber
  84.    return @party_in_ok_menber[self.index]
  85. end
  86. #--------------------------------------------------------------------------
  87. # ● パーティーin可能なメンバー取得
  88. #--------------------------------------------------------------------------
  89. def party_in_menber
  90.    menber = []
  91.    menber.push($game_actors[1])  if $game_switches[2]
  92.    menber.push($game_actors[2])
  93.    menber.push($game_actors[3])
  94.    menber.push($game_actors[4])
  95.    menber.push($game_actors[5])
  96.    menber.push($game_actors[6])  
  97.    menber.push($game_actors[9])  
  98.    menber.push($game_actors[10])  
  99.    menber.push($game_actors[11])  
  100.    menber.push($game_actors[12])  
  101.    return menber
  102. end
  103. #--------------------------------------------------------------------------
  104. # ● リフレッシュ
  105. #--------------------------------------------------------------------------
  106. def refresh
  107.    self.contents.clear
  108.    for i in 0...@party_in_ok_menber.size
  109.      draw_menber(i)
  110.    end
  111. end
  112. #--------------------------------------------------------------------------
  113. # ● アクター描画
  114. #--------------------------------------------------------------------------
  115. def draw_menber(index)
  116.    actor = @party_in_ok_menber[index]
  117.    x = 4 + index % @column_max * (640 / @column_max)
  118.    y = index / @column_max * 88
  119.    if $game_party.must_actor_include?(actor)
  120.      color = text_color(3)
  121.      opacity = 255
  122.    elsif $game_party.actors.include?(actor)
  123.      color = normal_color
  124.      opacity = 255
  125.    else
  126.      color = disabled_color
  127.      opacity = 128
  128.    end
  129.    self.contents.font.color = color
  130.    draw_actor_graphic(actor, x+40, y + 80)
  131.    #draw_actor_graphic(actor, x+40, y + 80)
  132.    self.contents.draw_text(x, y, 120, 32, actor.name)
  133. end
  134. def draw_actor_battler(act,x,y)
  135.    bitmap = RPG::Cache.battler(act.battler_name, act.battler_hue)
  136.    cw = bitmap.width
  137.    ch = bitmap.height
  138.    src_rect = Rect.new(0, 0, cw, ch)
  139.    self.contents.blt(x, y, bitmap, src_rect, opacity)
  140. end
  141. #--------------------------------------------------------------------------
  142. # ● 行数の取得
  143. #--------------------------------------------------------------------------
  144. def row_max
  145.    # 項目数と列数から行数を算出
  146.    return (@item_max + @column_max - 1) / @column_max
  147. end
  148. #--------------------------------------------------------------------------
  149. # ● 先頭の行の取得
  150. #--------------------------------------------------------------------------
  151. def top_row
  152.    # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る
  153.    return self.oy / 88
  154. end
  155. #--------------------------------------------------------------------------
  156. # ● 先頭の行の設定
  157. #     row : 先頭に表示する行
  158. #--------------------------------------------------------------------------
  159. def top_row=(row)
  160.    # row が 0 未満の場合は 0 に修正
  161.    if row < 0
  162.      row = 0
  163.    end
  164.    # row が row_max - 1 超の場合は row_max - 1 に修正
  165.    if row > row_max - 1
  166.      row = row_max - 1
  167.      if row < 0
  168.        row = 0
  169.      end
  170.    end
  171.    # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする
  172.    self.oy = row * 88
  173. end
  174. #--------------------------------------------------------------------------
  175. # ● 1 ページに表示できる行数の取得
  176. #--------------------------------------------------------------------------
  177. def page_row_max
  178.    # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る
  179.    return (self.height - 32) / 88
  180. end
  181. #--------------------------------------------------------------------------
  182. # ● カーソルの矩形更新
  183. #--------------------------------------------------------------------------
  184. def update_cursor_rect
  185.    if @index < 0
  186.      self.cursor_rect.empty
  187.      return
  188.    end
  189.    # 現在の行を取得
  190.    row = @index / @column_max
  191.    # 現在の行が、表示されている先頭の行より前の場合
  192.    if row < self.top_row
  193.      # 現在の行が先頭になるようにスクロール
  194.      self.top_row = row
  195.    end
  196.    # 現在の行が、表示されている最後尾の行より後ろの場合
  197.    if row > self.top_row + (self.page_row_max - 1)
  198.      # 現在の行が最後尾になるようにスクロール
  199.      self.top_row = row - (self.page_row_max - 1)
  200.    end
  201.    # カーソルの幅を計算
  202.    cursor_width = 512 / @column_max
  203.    # カーソルの座標を計算
  204.    x = @index % @column_max * (cursor_width + 32)#(640 / @column_max)
  205.    y = @index / @column_max * 88 - self.oy
  206.    # カーソルの矩形を更新
  207.    self.cursor_rect.set(x, y, cursor_width, 32)
  208. end
  209. end

  210. class Window_Party_Select_Menber < Window_Base
  211. #--------------------------------------------------------------------------
  212. # ● オブジェクト初期化
  213. #--------------------------------------------------------------------------
  214. def initialize
  215.    super(0, 0, 640, 96)
  216.    self.contents = Bitmap.new(width - 32, height - 32)
  217.    refresh
  218. end
  219. #--------------------------------------------------------------------------
  220. # ● リフレッシュ
  221. #--------------------------------------------------------------------------
  222. def refresh
  223.    self.contents.clear
  224.    for i in 0...$game_party.actors.size
  225.      draw_menber(i)
  226.    end
  227. end
  228. #--------------------------------------------------------------------------
  229. # ● アクター描画
  230. #--------------------------------------------------------------------------
  231. def draw_menber(index)
  232.    actor = $game_party.actors[index]
  233.    x = 4 + index * (640 / $game_party.party_max)
  234.    y = 0
  235.    draw_actor_graphic(actor, x+32, y+48+8)
  236. end
  237. end

  238. class Window_Party_Select_Menber_Status < Window_Base
  239. #--------------------------------------------------------------------------
  240. # ● オブジェクト初期化
  241. #--------------------------------------------------------------------------
  242. def initialize
  243.    super(0, 288, 640, 192)
  244.    self.contents = Bitmap.new(width - 32, height - 32)
  245. end
  246. #--------------------------------------------------------------------------
  247. # ● リフレッシュ
  248. #--------------------------------------------------------------------------
  249. def refresh(actor)
  250.    self.contents.clear
  251.    draw_actor_name(actor, 4, 0)
  252.    draw_actor_class(actor, 4 + 144, 0)
  253.    draw_actor_level(actor, 4, 32)
  254.    draw_actor_state(actor, 4 + 72, 32)
  255.    draw_actor_hp(actor, 4, 64, 172)
  256.    draw_actor_sp(actor, 4, 96, 172)
  257.    draw_actor_exp(actor, 4, 128)
  258.    draw_actor_parameter(actor, 218, 32, 0)
  259.    draw_actor_parameter(actor, 218, 64, 1)
  260.    draw_actor_parameter(actor, 218, 96, 2)
  261.    draw_actor_parameter(actor, 430, 32, 3)
  262.    draw_actor_parameter(actor, 430, 64, 4)
  263.    draw_actor_parameter(actor, 430, 96, 5)
  264.    draw_actor_parameter(actor, 430, 128, 6)
  265.    
  266. end
  267. end

  268. class Scene_Party_in
  269. #--------------------------------------------------------------------------
  270. # ● メイン処理
  271. #--------------------------------------------------------------------------
  272. def main
  273.    @main_window = Window_Party_Select.new
  274.    @menber_window = Window_Party_Select_Menber.new
  275.    @status_window = Window_Party_Select_Menber_Status.new
  276.    @status_window.opacity = 192
  277.    @status_window.z += 10
  278.    @show_index = 0
  279.    status_window_position
  280.    @status_window.refresh(@main_window.menber)
  281.    @status_window.visible = true
  282.    @show_index = @main_window.index
  283.    # トランジション実行
  284.    Graphics.transition
  285.    # メインループ
  286.    loop do
  287.      # ゲーム画面を更新
  288.      Graphics.update
  289.      # 入力情報を更新
  290.      Input.update
  291.      # フレーム更新
  292.      update
  293.      # 画面が切り替わったらループを中断
  294.      if $scene != self
  295.        break
  296.      end
  297.    end
  298.    # トランジション準備
  299.    Graphics.freeze
  300.    # ウィンドウを解放
  301.    @main_window.dispose
  302.    @menber_window.dispose
  303.    @status_window.dispose
  304. end
  305. #--------------------------------------------------------------------------
  306. # ● フレーム更新
  307. #--------------------------------------------------------------------------
  308. def update
  309.    # コマンドウィンドウを更新
  310.    @main_window.update
  311.    if @status_window.visible and @show_index != @main_window.index
  312.      status_window_position
  313.      @status_window.refresh(@main_window.menber)
  314.      @show_index = @main_window.index
  315.    end
  316.    # B ボタンが押された場合
  317.    if Input.trigger?(Input::B)
  318.      if $game_party.actors.size < $game_party.party_min
  319.        # ブザー SE を演奏
  320.        $game_system.se_play($data_system.buzzer_se)
  321.        return
  322.      end
  323.      # キャンセル SE を演奏
  324.      $game_system.se_play($data_system.cancel_se)
  325.      # メニュー画面に切り替え
  326.      $scene = Scene_Menu.new(7)
  327.      return
  328.    end
  329.    # C ボタンが押された場合
  330.    if Input.trigger?(Input::C)
  331.      # 選択したアクターが強制加入アクターの場合入れ替え不可
  332.      if $game_party.must_actor_include?(@main_window.menber)
  333.        # ブザー SE を演奏
  334.        $game_system.se_play($data_system.buzzer_se)
  335.        return
  336.      end
  337.      if $game_party.actors.include?(@main_window.menber)
  338.        $game_party.remove_actor(@main_window.menber.id)
  339.      else
  340.        if $game_party.actors.size == $game_party.party_max
  341.          # ブザー SE を演奏
  342.          $game_system.se_play($data_system.buzzer_se)
  343.          return
  344.        end
  345.        $game_party.add_actor(@main_window.menber.id)
  346.      end
  347.      # 決定 SE を演奏
  348.      $game_system.se_play($data_system.decision_se)
  349.      @main_window.refresh
  350.      @menber_window.refresh
  351.      return
  352.    end
  353.    # A ボタンが押された場合
  354.    #if Input.trigger?(Input::A)
  355.      # 決定 SE を演奏
  356.      #$game_system.se_play($data_system.decision_se)
  357.      #if @status_window.visible
  358.         #@status_window.visible = false

  359.      #else
  360.         #status_window_position
  361.         #@status_window.refresh(@main_window.menber)
  362.         #@status_window.visible = true
  363.         #@show_index = @main_window.index
  364.      #end
  365.      #return
  366.    #end
  367. end
  368. def status_window_position
  369.    if @main_window.cursor_rect.y < 176
  370.      @status_window.y = 288
  371.    else
  372.      @status_window.y = 96
  373.    end
  374. end
  375. end
复制代码
你试试这个,怀疑你那个缺少东西,我这边测试很正常……
其实我是个三流的画师  ←_←
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
284 小时
注册时间
2012-9-9
帖子
24
 楼主| 发表于 2013-6-14 11:54:43 | 显示全部楼层
本帖最后由 陌鸢 于 2013-6-14 12:34 编辑
512195574 发表于 2013-6-14 11:42
你试试这个,怀疑你那个缺少东西,我这边测试很正常……


刚刚那个冲突解决了……不过还是原来的问题……汗……我直接上截图吧表示我在测试菜单的时候,刚刚从标题画面进入地图……人物就给全了……这个怎么调……能写下具体指令吗~我估计我自己弄的指令很有问题……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
192 小时
注册时间
2010-8-23
帖子
161
发表于 2013-6-14 12:05:59 | 显示全部楼层
你大概改了窗口了,不知道脚本的定义部分你改没改,如果没改,按照原版的话就是从62行开始

   menber.push($game_actors[1])  if $game_switches[2]
   menber.push($game_actors[2])
   menber.push($game_actors[3])
   menber.push($game_actors[4])
   menber.push($game_actors[5])
   menber.push($game_actors[6])  
   menber.push($game_actors[9])  
   menber.push($game_actors[10])  
   menber.push($game_actors[11])  
   menber.push($game_actors[12])  

全部改成
   menber.push($game_actors[1])  if $game_switches[901]

   menber.push($game_actors[2])  if $game_switches[902]

   menber.push($game_actors[3])  if $game_switches[903]

   menber.push($game_actors[4])  if $game_switches[904]

   menber.push($game_actors[5])  if $game_switches[905]

   menber.push($game_actors[6])  if $game_switches[906]

   menber.push($game_actors[7])  if $game_switches[907]

   menber.push($game_actors[8])  if $game_switches[908]

   menber.push($game_actors[9])  if $game_switches[909]

   menber.push($game_actors[10])  if $game_switches[910]

   menber.push($game_actors[11])  if $game_switches[911]

   menber.push($game_actors[12])  if $game_switches[912]

   menber.push($game_actors[13])  if $game_switches[913]

   menber.push($game_actors[14])  if $game_switches[914]

就可以了,这样需要第N号角色可以加入时,第900+n号开关开了就可以了
其实我是个三流的画师  ←_←
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
284 小时
注册时间
2012-9-9
帖子
24
 楼主| 发表于 2013-6-14 12:21:23 | 显示全部楼层
512195574 发表于 2013-6-14 12:05
你大概改了窗口了,不知道脚本的定义部分你改没改,如果没改,按照原版的话就是从62行开始

   menber.push ...

非常感谢……终于解决……如果要加入特定人物直接在事件里插入脚本这指令可以吗~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
192 小时
注册时间
2010-8-23
帖子
161
发表于 2013-6-14 12:35:01 | 显示全部楼层
陌鸢 发表于 2013-6-14 12:21
非常感谢……终于解决……如果要加入特定人物直接在事件里插入脚本这指令可以吗~ ...

加入特定人物直接用事件-替换角色不就行了= =
没事了的话去http://rpg.blue/thread-244080-1-1.html结贴吧

点评

结贴了……  发表于 2013-6-14 12:37

评分

参与人数 2星屑 +140 收起 理由
明特·布兰马修 + 80 认可答案
hcm + 60 认可答案

查看全部评分

其实我是个三流的画师  ←_←
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 00:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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