Project1

标题: 关于初期伙伴人数问题 [打印本页]

作者: 路冠sama    时间: 2015-2-15 20:07
标题: 关于初期伙伴人数问题
就是这个好像默认的只有四个人,怎么增加或者用脚本啊之类的

Baidu IME_2015-2-15_20-6-45.jpg (96.76 KB, 下载次数: 6)

Baidu IME_2015-2-15_20-6-45.jpg

作者: huajinyu123    时间: 2015-2-15 20:17
在脚本里把最大人数改掉
作者: 路冠sama    时间: 2015-2-16 13:20
huajinyu123 发表于 2015-2-15 20:17
在脚本里把最大人数改掉

那个脚本啊QAQ我看不懂啊
作者: 芯☆淡茹水    时间: 2015-2-16 15:34
这个不只是机械的改动 队伍添加的人数限制 就行了的。
如果增加了人数,要改的地方很多:
菜单角色排版;使用对象窗口的排版;战斗图排版(大于4个的人站哪儿?);战斗状态窗口的排版,,,,等。
作者: 573932914    时间: 2015-2-24 09:53
如果要加入战斗就请搜索5人队伍什么的脚本吧
人越多越麻烦越卡- -
作者: 邪月长啸    时间: 2015-2-28 21:52
  1. #==============================================================================
  2. # ■ Game_Party
  3. #------------------------------------------------------------------------------
  4. #  处理同伴的类。包含金钱以及物品的信息。本类的实例
  5. # 请参考 $game_party。
  6. #==============================================================================
  7. class Game_Party
  8. #--------------------------------------------------------------------------
  9. # ● 加入同伴
  10. #     actor_id : 角色 ID
  11. #--------------------------------------------------------------------------
  12. def add_actor(actor_id)
  13.    # 获取角色
  14.    actor = $game_actors[actor_id]
  15.    # 同伴人数未满 5 人、本角色不在队伍中的情况下
  16.    if @actors.size < 5 and not @actors.include?(actor)
  17.      # 添加角色
  18.      @actors.push(actor)
  19.      # 还原主角
  20.      $game_player.refresh
  21.    end
  22. end
  23. end






  24. #==============================================================================
  25. # ■ Window_MenuStatus
  26. #------------------------------------------------------------------------------
  27. #  显示菜单画面和同伴状态的窗口。
  28. #==============================================================================
  29. class Window_MenuStatus
  30. #--------------------------------------------------------------------------
  31. # ● 刷新
  32. #--------------------------------------------------------------------------
  33. def refresh
  34.    self.contents.clear
  35.    @item_max = $game_party.actors.size
  36.    for i in 0...$game_party.actors.size
  37.      x = 64
  38.      y = i * 86
  39.      actor = $game_party.actors[i]
  40.      draw_actor_graphic(actor, x - 40, y + 70)
  41.      draw_actor_name(actor, x, y)
  42.      draw_actor_class(actor, x + 144, y)
  43.      draw_actor_level(actor, x, y + 24)
  44.      draw_actor_state(actor, x + 90, y + 24)
  45.      draw_actor_exp(actor, x, y + 48)
  46.      draw_actor_hp(actor, x + 236, y + 24)
  47.      draw_actor_sp(actor, x + 236, y + 48)
  48.    end
  49. end
  50. #--------------------------------------------------------------------------
  51. # ● 刷新光标矩形
  52. #--------------------------------------------------------------------------
  53. def update_cursor_rect
  54.    if @index < 0
  55.      self.cursor_rect.empty
  56.    else
  57.      self.cursor_rect.set(0, @index * 86, self.width - 32, 76)
  58.    end
  59. end
  60. end







  61. #==============================================================================
  62. # ■ Window_BattleStatus
  63. #------------------------------------------------------------------------------
  64. #  显示战斗画面同伴状态的窗口。
  65. #==============================================================================
  66. class Window_BattleStatus < Window_Base
  67. #--------------------------------------------------------------------------
  68. # ● 刷新
  69. #--------------------------------------------------------------------------
  70. def refresh
  71.    self.contents.clear
  72.    @item_max = $game_party.actors.size
  73.    for i in 0...$game_party.actors.size
  74.      actor = $game_party.actors[i]
  75.      actor_x = i * 120 + 4
  76.      draw_actor_name(actor, actor_x, 0)
  77.      draw_actor_hp(actor, actor_x, 32, 120)
  78.      draw_actor_sp(actor, actor_x, 64, 120)
  79.      if @level_up_flags[i]
  80.        self.contents.font.color = normal_color
  81.        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  82.      else
  83.        draw_actor_state(actor, actor_x, 96)
  84.      end
  85.    end
  86. end
  87. end







  88. #==============================================================================
  89. # ■ Scene_Battle
  90. #------------------------------------------------------------------------------
  91. #  处理战斗画面的类。
  92. #==============================================================================
  93. class Scene_Battle
  94. #--------------------------------------------------------------------------
  95. # ● 设置角色指令窗口
  96. #--------------------------------------------------------------------------
  97. def phase3_setup_command_window
  98.    # 同伴指令窗口无效化
  99.    @party_command_window.active = false
  100.    @party_command_window.visible = false
  101.    # 角色指令窗口无效化
  102.    @actor_command_window.active = true
  103.    @actor_command_window.visible = true
  104.    # 设置角色指令窗口的位置
  105.    @actor_command_window.x = @actor_index * 120
  106.    # 设置索引为 0
  107.    @actor_command_window.index = 0
  108. end
  109. end





  110. #==============================================================================
  111. # ■ Game_Actor
  112. #------------------------------------------------------------------------------
  113. #  处理角色的类。本类在 Game_Actors 类 ($game_actors)
  114. # 的内部使用、Game_Party 类请参考 ($game_party) 。
  115. #==============================================================================
  116. class Game_Actor < Game_Battler
  117. #--------------------------------------------------------------------------
  118. # ● 取得战斗画面的 X 坐标
  119. #--------------------------------------------------------------------------
  120. def screen_x
  121.    # 返回计算后的队伍 X 坐标的排列顺序
  122.    if self.index != nil
  123.      return self.index * 120 + 80
  124.    else
  125.      return 0
  126.    end
  127. end
  128. end





  129. #==============================================================================
  130. # ■ Sprite_Battler
  131. #------------------------------------------------------------------------------
  132. #  战斗显示用活动块。Game_Battler 类的实例监视、
  133. # 活动块的状态的监视。
  134. #==============================================================================
  135. class Spriteset_Battle
  136. #--------------------------------------------------------------------------
  137. # ● 初始化变量
  138. #--------------------------------------------------------------------------
  139. def initialize
  140.    # 生成显示端口
  141.    @viewport1 = Viewport.new(0, 0, 640, 320)
  142.    @viewport2 = Viewport.new(0, 0, 640, 480)
  143.    @viewport3 = Viewport.new(0, 0, 640, 480)
  144.    @viewport4 = Viewport.new(0, 0, 640, 480)
  145.    @viewport2.z = 101
  146.    @viewport3.z = 200
  147.    @viewport4.z = 5000
  148.    # 生成战斗背景活动块
  149.    @battleback_sprite = Sprite.new(@viewport1)
  150.    # 生成敌人活动块
  151.    @enemy_sprites = []
  152.    for enemy in $game_troop.enemies.reverse
  153.      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  154.    end
  155.    # 生成敌人活动块 ★★修改了这里
  156.    @actor_sprites = []
  157.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  158.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  159.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  160.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  161.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  162.    # 生成天候
  163.    @weather = RPG::Weather.new(@viewport1)
  164.    # 生成图片活动块
  165.    @picture_sprites = []
  166.    for i in 51..100
  167.      @picture_sprites.push(Sprite_Picture.new(@viewport3,
  168.        $game_screen.pictures[i]))
  169.    end
  170.    # 生成计时器块
  171.    @timer_sprite = Sprite_Timer.new
  172.    # 刷新画面
  173.    update
  174. end
  175.    #--------------------------------------------------------------------------
  176. # ● 刷新画面
  177. #--------------------------------------------------------------------------
  178. def update
  179.    # 刷新角色的活动块 (对应角色的替换) ★修改了这里
  180.    @actor_sprites[0].battler = $game_party.actors[0]
  181.    @actor_sprites[1].battler = $game_party.actors[1]
  182.    @actor_sprites[2].battler = $game_party.actors[2]
  183.    @actor_sprites[3].battler = $game_party.actors[3]
  184.    @actor_sprites[4].battler = $game_party.actors[4]
  185.    # 战斗背景的文件名与现在情况有差异的情况下
  186.    if @battleback_name != $game_temp.battleback_name
  187.      @battleback_name = $game_temp.battleback_name
  188.      if @battleback_sprite.bitmap != nil
  189.        @battleback_sprite.bitmap.dispose
  190.      end
  191.      @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  192.      @battleback_sprite.src_rect.set(0, 0, 640, 320)
  193.    end
  194.    # 刷新战斗者的活动块
  195.    for sprite in @enemy_sprites + @actor_sprites
  196.      sprite.update
  197.    end
  198.    # 刷新天气图形
  199.    @weather.type = $game_screen.weather_type
  200.    @weather.max = $game_screen.weather_max
  201.    @weather.update
  202.    # 刷新图片活动块
  203.    for sprite in @picture_sprites
  204.      sprite.update
  205.    end
  206.    # 刷新计时器活动块
  207.    @timer_sprite.update
  208.    # 设置画面的色调与震动位置
  209.    @viewport1.tone = $game_screen.tone
  210.    @viewport1.ox = $game_screen.shake
  211.    # 设置画面的闪烁色
  212.    @viewport4.color = $game_screen.flash_color
  213.    # 刷新显示端口
  214.    @viewport1.update
  215.    @viewport2.update
  216.    @viewport4.update
  217. end
  218. end
复制代码
坐标修改
  1. # ————————————————————————————————————
  2. # 本脚本来自http://www.66rpg.com/,转载请保留此信息
  3. # ————————————————————————————————————
  4. #==============================================================================
  5. # ■ Game_Actor
  6. #------------------------------------------------------------------------------
  7. #  处理角色的类。本类在 Game_Actors 类 ($game_actors)
  8. # 的内部使用、Game_Party 类请参考 ($game_party) 。
  9. #==============================================================================
  10. class Game_Actor < Game_Battler
  11. #--------------------------------------------------------------------------
  12. # ● 取得战斗画面的 X 坐标
  13. #--------------------------------------------------------------------------
  14. def screen_x
  15. case self.index
  16. when 0
  17.    return 370
  18. when 1
  19.    return 430
  20. when 2
  21.    return 520
  22. when 3
  23.    return 580
  24. when 4
  25.    return 540
  26.   end
  27. end
  28. #--------------------------------------------------------------------------
  29. # ● 取得战斗画面的 Y 坐标
  30. #--------------------------------------------------------------------------
  31. def screen_y
  32. case self.index
  33. when 0
  34.    return 450
  35. when 1
  36.    return 390
  37. when 2
  38.    return 350
  39. when 3
  40.    return 320
  41. when 4
  42.    return 460
  43.   end
  44. end
  45. #--------------------------------------------------------------------------
  46. # ● 取得战斗画面的 Z 坐标
  47. #--------------------------------------------------------------------------
  48. def screen_z
  49. case self.index
  50. when 0
  51.    return 0
  52. when 1
  53.    return 0
  54. when 2
  55.    return 0
  56. when 3
  57.    return 0
  58. when 4
  59.    return 0
  60.    end
  61. end
  62. end

  63. #==============================================================================
  64. # ■ Window_Base
  65. #------------------------------------------------------------------------------
  66. #  游戏中全部窗口的超级类。
  67. #==============================================================================
  68. class Window_Base < Window
  69. #--------------------------------------------------------------------------
  70. # ● 描绘 HP
  71. #     actor : 角色
  72. #     x     : 描画目标 X 坐标
  73. #     y     : 描画目标 Y 坐标
  74. #     width : 描画目标的宽
  75. #--------------------------------------------------------------------------
  76. def draw_actor_hp1(actor, x, y, width = 72)
  77.    # 描绘字符串 "HP"
  78.    self.contents.font.color = system_color
  79.    self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
  80.    # 计算描绘 MaxHP 所需的空间
  81.    if width - 24 >= 32
  82.      hp_x = x + 32# + width - 24
  83.    end
  84.    # 描绘 HP
  85.    self.contents.font.color = actor.hp == 0 ? knockout_color :
  86.      actor.hp <= actor.maxhp / 5 ? crisis_color : normal_color
  87.    self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
  88. end
  89. #--------------------------------------------------------------------------
  90. # ● 描绘 SP
  91. #     actor : 角色
  92. #     x     : 描画目标 X 坐标
  93. #     y     : 描画目标 Y 坐标
  94. #     width : 描画目标的宽
  95. #--------------------------------------------------------------------------
  96. def draw_actor_sp1(actor, x, y, width = 72)
  97.    # 描绘字符串 "SP"
  98.    self.contents.font.color = system_color
  99.    self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
  100.    # 计算描绘 MaxSP 所需的空间
  101.    if width - 24 >= 32
  102.      sp_x = x + 32# + width - 24
  103.    end
  104.    # 描绘 SP
  105.    self.contents.font.color = actor.sp == 0 ? knockout_color :
  106.      actor.sp <= actor.maxsp / 5 ? crisis_color : normal_color
  107.    self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
  108. end
  109. end



  110. #==============================================================================
  111. # ■ Window_BattleStatus
  112. #------------------------------------------------------------------------------
  113. #  显示战斗画面同伴状态的窗口。
  114. #==============================================================================
  115. class Window_BattleStatus < Window_Base
  116. #--------------------------------------------------------------------------
  117. # ● 初始化对像
  118. #--------------------------------------------------------------------------
  119. #$data_system_level_up_me = "Audio/ME/升级音乐"
  120. def initialize
  121.    super(0, 0, 640, 480)
  122.    self.contents = Bitmap.new(width - 10, height - 32)
  123.    self.opacity = 0
  124.    @level_up_flags = [false, false, false, false]
  125.    refresh
  126. end
  127. #--------------------------------------------------------------------------
  128. # ● 释放
  129. #--------------------------------------------------------------------------
  130. def dispose
  131.    super
  132. end
  133. #--------------------------------------------------------------------------
  134. # ● 设置升级标志
  135. #     actor_index : 角色索引
  136. #--------------------------------------------------------------------------
  137. def level_up(actor_index)
  138.    @level_up_flags[actor_index] = true
  139. end
  140. #--------------------------------------------------------------------------
  141. # ● 刷新
  142. #--------------------------------------------------------------------------
  143. def refresh
  144.    self.contents.clear
  145.    @item_max = $game_party.actors.size
  146.     for i in 0...$game_party.actors.size
  147.      actor = $game_party.actors[i]
  148.      case i
  149.        when 0
  150.         x = 310
  151.         y = 390
  152.        when 1
  153.         x = 390
  154.         y = 340
  155.        when 2
  156.         x = 480
  157.         y = 300
  158.        when 3
  159.         x = 550
  160.         y = 270
  161.         when 4
  162.         x = 550
  163.         y = 500
  164.         when 5
  165.         x = 550
  166.         y = 500
  167.       end
  168.      if @level_up_flags[i]
  169.        self.contents.font.color = normal_color
  170.        self.contents.draw_text(x, y, 80, 24, "         ")
  171.        Audio.me_stop
  172. #        Audio.me_play($data_system_level_up_me)
  173.      else
  174.      draw_actor_hp1(actor, x-15, y-15, 80)
  175.      draw_actor_sp1(actor, x-15, y+5, 80)
  176.     end
  177.    end
  178. end
  179. #--------------------------------------------------------------------------
  180. # ● 刷新画面
  181. #--------------------------------------------------------------------------
  182. def update
  183.    super
  184.    # 主界面的不透明度下降
  185.    if $game_temp.battle_main_phase
  186.      self.contents_opacity -= 50 if self.contents_opacity > 1
  187.    else
  188.      self.contents_opacity += 50 if self.contents_opacity < 255
  189.    end
  190. end
  191. end


  192. #==============================================================================
  193. # ■ Window_BattleStatus
  194. #==============================================================================
  195. class Window_BattleStatus < Window_Base
  196. #--------------------------------------------------------------------------
  197. # ● 初始化
  198. #--------------------------------------------------------------------------
  199. alias xrxs_bp2_refresh refresh
  200. def refresh
  201.    xrxs_bp2_refresh
  202.    @item_max = $game_party.actors.size
  203.     for i in 0...$game_party.actors.size
  204.      actor = $game_party.actors[i]
  205.      case i
  206.        when 0
  207.         x = 310
  208.         y = 390
  209.        when 1
  210.         x = 390
  211.         y = 340
  212.        when 2
  213.         x = 480
  214.         y = 300
  215.        when 3
  216.         x = 550
  217.         y = 270
  218.        when 4
  219.         x = 550
  220.         y = 500
  221.        when 5
  222.         x = 550
  223.         y = 500
  224.       end
  225.      draw_actor_hp_meter(actor, x, y, 50)
  226.      draw_actor_sp_meter(actor, x, y + 8, 50)
  227.    end
  228. end
  229. end
  230. #==============================================================================
  231. # ■ Window_Base
  232. #==============================================================================
  233. class Window_Base < Window
  234. #--------------------------------------------------------------------------
  235. # ● HP描画
  236. #--------------------------------------------------------------------------
  237. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  238.    if type == 1 and actor.hp == 0
  239.      return
  240.    end
  241.    self.contents.font.color = system_color
  242.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  243.    w = width * actor.hp / actor.maxhp
  244.    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  245.    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  246.    self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  247.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  248.    self.contents.fill_rect(x, y+32, w,1, Color.new(0, 0, 0, 255))
  249.    
  250.    end
  251. #--------------------------------------------------------------------------
  252. # ● SP描画
  253. #--------------------------------------------------------------------------
  254. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  255.    if type == 1 and actor.hp == 0
  256.      return
  257.    end
  258.    self.contents.font.color = system_color
  259.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  260.    w = width * actor.sp / actor.maxsp
  261.    self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  262.    self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  263.    self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  264.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  265.    self.contents.fill_rect(x, y+32, w,1, Color.new(0, 128, 128, 255))
  266.    
  267.    end
  268. end
复制代码

作者: chd114    时间: 2015-2-28 23:29
首先你需要AV修改game_party那部分让角色上限从4个变成更多,然后你可以在开始游戏后进入游戏前用添加队友的指令添加新队友···




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1