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

Project1

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

[已经解决] 关于战斗时队伍位置的问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
336 小时
注册时间
2010-8-26
帖子
428
跳转到指定楼层
1
发表于 2011-5-19 10:07:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 巧克力猫咪 于 2011-5-24 17:34 编辑

一直在想以前玩过的最终幻想系列的RPG,那里面的队伍,如果是前卫的话在最前面,中卫的话人物会在中间的位置,而后卫通常是在队伍的最后面,在战斗中例如:怪物 ★                  前卫       ★
                                                                                  ★                 中卫           ★
                                                                                  ★                 后卫              ★
这样的需要怎么实现啊?

点评

=。= 没认可答案结贴貌似要被扣分的 虽然我也忘了认可答案那个按钮在哪里- - 找一下吧  发表于 2011-5-24 17:35
[

Lv1.梦旅人

梦石
0
星屑
50
在线时间
466 小时
注册时间
2006-2-25
帖子
1863
2
发表于 2011-5-19 12:44:34 | 只看该作者
本帖最后由 诡异の猫 于 2011-5-19 12:50 编辑

话说我目前在填坑的游戏也用到这个的说- -
VX内置就有设置职业的位置:前卫、中卫&后卫
受到敌人攻击的机率 前卫>中卫>后卫

不过VX内置脚本没有我方角色的战斗图,所以如果没加其他外来战斗脚本的话修改这个是没意义的说- -
如果楼主想实现角色战斗图按前中后卫 前后排列的话
只要修改角色战斗图Sprite的坐标就行了

楼主如果是用了外来的战斗脚本
可以发上来我帮你改改
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1239
在线时间
668 小时
注册时间
2009-11-11
帖子
2787
3
发表于 2011-5-19 12:49:11 | 只看该作者
改横版战斗的那个设置

[一人目]   [二人目]   [三人目]   [四人目]
(坐标)   (坐标)    (坐标)    (坐标)

脚本里面,根据你这个排列你是用横版的把

嘿。嘿。嘿
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1071 小时
注册时间
2011-5-12
帖子
2317

贵宾

4
发表于 2011-5-19 13:12:11 | 只看该作者
变更角色位置的脚本我倒有
  1. #==============================================================================
  2. # Row Changer
  3. #==============================================================================
  4. # Author  : OriginalWij
  5. # Version : 1.3comp
  6. #==============================================================================

  7. #==============================================================================
  8. # To call: $scene = Scene_Row.new
  9. #==============================================================================

  10. #==============================================================================
  11. # Config
  12. #==============================================================================

  13. module ROW
  14.   # Maximum party size (range = 4 to 8)
  15.   ROW_SIZE = 8
  16.   # Row text
  17.   ROW_TEXT = '队形: '
  18.   # Row title texts
  19.   REAR_TEXT = '后排'
  20.   MIDL_TEXT = '中心'
  21.   FRNT_TEXT = '前线'
  22.   # 'Row" text location in Scene_Status (X & Y)
  23.   STATUS_X = 288
  24.   STATUS_Y = 0
  25.   # Row colors
  26.   COLOR = [] # <== Do NOT Modify
  27.   COLOR[0] = Color.new(  0, 255,   0) # Rear
  28.   COLOR[1] = Color.new(255, 255,   0) # Middle
  29.   COLOR[2] = Color.new(255,   0,   0) # Front
  30.   # Background color
  31.   BACK_COLOR = Color.new(0,0,0)
  32.   # Border color
  33.   BORDER_COLOR = Color.new(255,255,255)
  34.   # Class title text
  35.   CLASS = '职业:'
  36.   # Row window back opacity
  37.   OPACITY = 175
  38. end

  39. #==============================================================================
  40. # Game_Actor
  41. #==============================================================================

  42. class Game_Actor < Game_Battler
  43.   #--------------------------------------------------------------------------
  44.   # Initialize
  45.   #--------------------------------------------------------------------------
  46.   alias rc_game_actor_initialize initialize unless $@
  47.   def initialize(actor_id)
  48.     rc_game_actor_initialize(actor_id)
  49.     @row = self.class.position
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # Get Row (New)
  53.   #--------------------------------------------------------------------------
  54.   def row
  55.     return @row
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # Set Row (New)
  59.   #--------------------------------------------------------------------------
  60.   def row=(new_row)
  61.     @row = new_row
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # Get Ease of Hitting (Overwrite)
  65.   #--------------------------------------------------------------------------
  66.   def odds
  67.     return 8 - self.row * 3 # make rows more effective
  68.   end
  69. end

  70. #==============================================================================
  71. # Window_Status
  72. #==============================================================================

  73. class Window_Status < Window_Base
  74.   #--------------------------------------------------------------------------
  75.   # Variables (Added)
  76.   #--------------------------------------------------------------------------
  77.   Row_Text  = ROW::ROW_TEXT
  78.   Row = []
  79.   Row[0] = ROW::FRNT_TEXT
  80.   Row[1] = ROW::MIDL_TEXT
  81.   Row[2] = ROW::REAR_TEXT
  82.   Row_X = ROW::STATUS_X
  83.   Row_Y = ROW::STATUS_Y
  84.   #--------------------------------------------------------------------------
  85.   # Draw Basic Information (Mod)
  86.   #--------------------------------------------------------------------------
  87.   alias rc_window_status_draw_basic_info draw_basic_info unless $@
  88.   def draw_basic_info(x, y)
  89.     rw = self.contents.text_size(Row_Text).width
  90.     self.contents.font.color = system_color
  91.     self.contents.draw_text(Row_X, Row_Y, 100, WLH, Row_Text)
  92.     self.contents.font.color = ROW::COLOR[2 - @actor.row]
  93.     self.contents.draw_text(Row_X + rw, Row_Y, 100, WLH, Row[@actor.row])
  94.     self.contents.font.color = normal_color
  95.     rc_window_status_draw_basic_info(x, y)
  96.   end
  97. end

  98. #==============================================================================
  99. # Row_Window (New)
  100. #==============================================================================

  101. class Row_Window < Window_Base
  102.   #--------------------------------------------------------------------------
  103.   # Initialize
  104.   #--------------------------------------------------------------------------
  105.   def initialize
  106.     super(0, 0, Graphics.width, 160)                                  # res
  107.     self.back_opacity = ROW::OPACITY
  108.     @horiz_size = $game_party.members.size - 1
  109.     @max_size = ROW::ROW_SIZE - 1
  110.     @max_size = 3 if @max_size < 3
  111.     @max_size = 7 if @max_size > 7
  112.     @offset = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
  113.     @offset += 21 if @max_size % 2 == 0
  114.     refresh
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # Update
  118.   #--------------------------------------------------------------------------
  119.   def update
  120.     super
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # Refresh
  124.   #--------------------------------------------------------------------------
  125.   def refresh
  126.     self.contents.clear
  127.     x1 = (7 - @max_size) * 18
  128.     x2 = Graphics.width - 122 - (7 - @max_size) * 18 # res
  129.     self.contents.draw_text(x1,  8, 90, WLH, ROW::REAR_TEXT, 1)
  130.     self.contents.draw_text(x1, 50, 90, WLH, ROW::MIDL_TEXT, 1)
  131.     self.contents.draw_text(x1, 92, 90, WLH, ROW::FRNT_TEXT, 1)
  132.     self.contents.draw_text(x2,  8, 90, WLH, ROW::REAR_TEXT, 1)
  133.     self.contents.draw_text(x2, 50, 90, WLH, ROW::MIDL_TEXT, 1)
  134.     self.contents.draw_text(x2, 92, 90, WLH, ROW::FRNT_TEXT, 1)
  135.     for x in 0..@horiz_size
  136.       for y in 0..2
  137.         @x = x * 42 + @offset
  138.         @y = y * 42
  139.         self.contents.fill_rect(@x, @y, 40, 40, ROW::COLOR[y])
  140.         self.contents.fill_rect(@x + 2, @y + 2, 36, 36, ROW::BACK_COLOR)
  141.       end
  142.     end
  143.     if (@max_size - @horiz_size) > 0
  144.       fill = @horiz_size + 1
  145.       for x in fill..@max_size
  146.         for y in 0..2
  147.           @x = x * 42 + @offset
  148.           @y = y * 42
  149.           self.contents.fill_rect(@x, @y, 40, 40, Color.new(128,128,128))
  150.           self.contents.fill_rect(@x + 2, @y + 2, 36, 36, ROW::BACK_COLOR)
  151.         end
  152.       end
  153.     end
  154.     for x in 0..@horiz_size
  155.       actor = $game_party.members[x]
  156.       a_pos = actor.row
  157.       draw_actor_graphic(actor, x * 42 + 20 + @offset, (2 - a_pos) * 42 + 36)
  158.     end
  159.   end
  160. end

  161. #==============================================================================
  162. # Row_Status (New)
  163. #==============================================================================

  164. class Row_Status < Window_Base
  165.   #--------------------------------------------------------------------------
  166.   # Initialize
  167.   #--------------------------------------------------------------------------
  168.   def initialize(actor)
  169.     super(0, 160, Graphics.width, Graphics.height - 160) # res
  170.     @actor = actor
  171.     self.back_opacity = ROW::OPACITY
  172.     refresh
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # New Actor
  176.   #--------------------------------------------------------------------------
  177.   def new_actor=(actor)
  178.     @actor = actor
  179.     refresh
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # Refresh
  183.   #--------------------------------------------------------------------------
  184.   def refresh
  185.     self.contents.clear
  186.     draw_actor_name(@actor, 4, 0)
  187.     self.contents.font.color = system_color
  188.     self.contents.draw_text(160, 0, 60, WLH, ROW::CLASS)
  189.     self.contents.font.color = normal_color
  190.     draw_actor_class(@actor, 188, 0)
  191.     draw_actor_face(@actor, 6, 40)
  192.     draw_actor_graphic(@actor, 56, 200)
  193.     draw_basic_info(160, 32)
  194.     draw_equipments(160, 104)
  195.     draw_parameters(self.contents.width - 208, 0) # res
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # Draw Basic Information
  199.   #--------------------------------------------------------------------------
  200.   def draw_basic_info(x, y)
  201.     draw_actor_level(@actor, x, y - 4)
  202.     draw_actor_state(@actor, x, y + WLH)
  203.     draw_actor_hp(@actor, x, y + WLH)
  204.     draw_actor_mp(@actor, x, y + WLH * 2)
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # Draw Parameters
  208.   #--------------------------------------------------------------------------
  209.   def draw_parameters(x, y)
  210.       for i in 0..10
  211.         draw_actor_parameter(@actor, x, y + 26 * i,i )
  212.       end
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # Draw Experience Information
  216.   #--------------------------------------------------------------------------
  217.   def draw_exp_info(x, y)
  218.     s1 = @actor.exp_s
  219.     s2 = @actor.next_rest_exp_s
  220.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  221.     self.contents.font.color = system_color
  222.     self.contents.draw_text(x, y, 180, WLH, Vocab::ExpTotal)
  223.     self.contents.draw_text(x, y + 40, 180, WLH, s_next)
  224.     self.contents.font.color = normal_color
  225.     self.contents.draw_text(x, y + 20, 180, WLH, s1, 2)
  226.     self.contents.draw_text(x, y + 60, 180, WLH, s2, 2)
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # Draw equipments
  230.   #--------------------------------------------------------------------------
  231.   def draw_equipments(x, y)
  232.     self.contents.font.color = system_color
  233.     self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
  234.     self.contents.font.color = normal_color
  235.     self.contents.font.size = 16
  236.     item_number = @actor.equips.size
  237.     item_number.times { |i|
  238.       if [email protected][i]
  239.         if i ==1 and @actor.two_hands_legal?
  240.           draw_item_name(@actor.equips[i - 1], x , y +  WLH * (i + 1), false)
  241.         else
  242.           text = "-  EMPTY  -"
  243.           self.contents.draw_text(x + 24, y +  WLH * (i + 1), 120, WLH, text)
  244.         end
  245.       else
  246.         draw_item_name(@actor.equips[i], x , y +  WLH * (i + 1))
  247.       end}
  248.     self.contents.font.size = Font.default_size
  249.   end
  250. end

  251. #==============================================================================
  252. # Row_Cursor_Window (New)
  253. #==============================================================================

  254. class Row_Cursor_Window < Window_Selectable
  255.   #--------------------------------------------------------------------------
  256.   # Initialize
  257.   #--------------------------------------------------------------------------
  258.   def initialize
  259.     @max_size = ROW::ROW_SIZE - 1
  260.     @max_size = 3 if @max_size < 3
  261.     @max_size = 7 if @max_size > 7
  262.     x = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
  263.     x += 21 if @max_size % 2 == 0
  264.     super(x, 0, 80, 160)
  265.     @column_max = 1
  266.     @item_max = 3
  267.     self.index = 0
  268.     self.opacity = 0
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # Update Cursor
  272.   #--------------------------------------------------------------------------
  273.   def update_cursor
  274.     if @index < 0               # No cursor
  275.       self.cursor_rect.empty
  276.     elsif @index < @item_max    # Normal
  277.       self.cursor_rect.set(0, @index * 42, 40, 40)
  278.     elsif @index >= 100         # Self
  279.       self.cursor_rect.set(0, (@index - 100) * 42, 40, 40)
  280.     else                        # All
  281.       self.cursor_rect.set(0, 0, 40, @item_max * 40)
  282.     end
  283.   end
  284. end

  285. #==============================================================================
  286. # Column_Cursor_Window (New)
  287. #==============================================================================

  288. class Column_Cursor_Window < Window_Selectable
  289.   #--------------------------------------------------------------------------
  290.   # Initialize
  291.   #--------------------------------------------------------------------------
  292.   def initialize
  293.     @max_size = ROW::ROW_SIZE - 1
  294.     @max_size = 3 if @max_size < 3
  295.     @max_size = 7 if @max_size > 7
  296.     x = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
  297.     x += 21 if @max_size % 2 == 0
  298.     super(x, 0, $game_party.members.size * 42 + 32, 160, 2)
  299.     @column_max = $game_party.members.size
  300.     @item_max = $game_party.members.size
  301.     self.index = 0
  302.     self.opacity = 0
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # Update Cursor
  306.   #--------------------------------------------------------------------------
  307.   def update_cursor
  308.     if @index < 0               # No cursor
  309.       self.cursor_rect.empty
  310.     elsif @index < @item_max    # Normal
  311.       self.cursor_rect.set(@index * 42, 0, 40, 124)
  312.     elsif @index >= 100         # Self
  313.       self.cursor_rect.set((@index - 100) * 42, 0, 40, 124)
  314.     else                        # All
  315.       self.cursor_rect.set(0, 0, 40, @item_max * 124)
  316.     end
  317.   end
  318. end
  319.   
  320. #==============================================================================
  321. # Scene_Row (New)
  322. #==============================================================================

  323. class Scene_Row < Scene_Base
  324.   #--------------------------------------------------------------------------
  325.   # Initialize
  326.   #--------------------------------------------------------------------------
  327.   def initialize
  328.     @horiz_size = $game_party.members.size - 1
  329.     @max_size = ROW::ROW_SIZE - 1
  330.     @max_size = 3 if @max_size < 3
  331.     @max_size = 7 if @max_size > 7
  332.     @x = ((7 - @max_size) / 2) * 42 + (Graphics.width - 364) / 2 # res
  333.     @x += 21 if @max_size % 2 == 0
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # Start
  337.   #--------------------------------------------------------------------------
  338.   def start
  339.     super
  340.     create_menu_background
  341.     @row_window = Row_Window.new
  342.     @row_status = Row_Status.new($game_party.members[0])
  343.     @row_cursor_window = Row_Cursor_Window.new
  344.     @column_cursor_window = Column_Cursor_Window.new
  345.     @row_cursor_window.visible = false
  346.     @row_cursor_window.active = false
  347.     @column_cursor_window.active = true
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # Terminate
  351.   #--------------------------------------------------------------------------
  352.   def terminate
  353.     super
  354.     dispose_menu_background
  355.     @column_cursor_window.dispose
  356.     @row_cursor_window.dispose
  357.     @row_window.dispose
  358.     @row_status.dispose
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # Update
  362.   #--------------------------------------------------------------------------
  363.   def update
  364.     super
  365.     update_menu_background
  366.     @row_window.update
  367.     @row_status.update
  368.     @column_cursor_window.update
  369.     @row_cursor_window.update
  370.     if @column_cursor_window.active
  371.       update_column_selection
  372.     elsif @row_cursor_window.active
  373.       update_row_selection
  374.     end
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # Update Column Selection
  378.   #--------------------------------------------------------------------------
  379.   def update_column_selection
  380.     if Input.trigger?(Input::B)
  381.       Sound.play_cancel
  382.       $scene = Scene_Menu.new(4)
  383.     elsif Input.trigger?(Input::C)
  384.       Sound.play_decision
  385.       @actor_selected = $game_party.members[@column_cursor_window.index].id
  386.       @row_cursor_window.x = @x + @column_cursor_window.index * 42
  387.       ga_pos = $game_actors[@actor_selected].row
  388.       @row_cursor_window.index = (2 - ga_pos)
  389.       @column_cursor_window.active = @column_cursor_window.visible = false
  390.       @row_cursor_window.active = @row_cursor_window.visible = true
  391.       @row_status.new_actor = $game_party.members[@column_cursor_window.index]
  392.     elsif Input.repeat?(Input::LEFT) or Input.repeat?(Input::RIGHT)
  393.       @row_status.new_actor = $game_party.members[@column_cursor_window.index]
  394.     end
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # Update Row Selection
  398.   #--------------------------------------------------------------------------
  399.   def update_row_selection
  400.     if Input.trigger?(Input::B)
  401.       Sound.play_cancel
  402.       @row_cursor_window.active = @row_cursor_window.visible = false
  403.       @column_cursor_window.active = @column_cursor_window.visible = true
  404.     elsif Input.trigger?(Input::C)
  405.       Sound.play_decision
  406.       rcw_i =  @row_cursor_window.index
  407.       $game_actors[@actor_selected].row = (2 - rcw_i)
  408.       @row_window.refresh
  409.       @row_cursor_window.active = @row_cursor_window.visible = false
  410.       @column_cursor_window.active = @column_cursor_window.visible = true
  411.       @row_status.new_actor = $game_party.members[@column_cursor_window.index]
  412.     end
  413.   end
  414. end
复制代码
配合这个再修改横版脚本里
class Game_Actor < Game_Battler的def base_position为
  1.   def base_position
  2.     base = N01::ACTOR_POSITION[self.index]
  3.     @base_position_x = base[0] + self.row * 24
  4.     @base_position_y = base[1]
  5.     # バックアタック時はX軸を逆に
  6.     @base_position_x = Graphics.width - base[0] if $back_attack && N01::BACK_ATTACK
  7.   end
复制代码
这就行了~
找我请找芙蕾娅
顺带一提,完全看得懂我头像请捡起你自己的节操哟(自重
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
2 小时
注册时间
2011-5-4
帖子
9
5
发表于 2011-5-19 16:38:37 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
336 小时
注册时间
2010-8-26
帖子
428
6
 楼主| 发表于 2011-5-23 19:21:13 | 只看该作者
诡异の猫 发表于 2011-5-19 12:44
话说我目前在填坑的游戏也用到这个的说- -
VX内置就有设置职业的位置:前卫、中卫&后卫
受到敌人攻击的机率 ...

Data.rar (710.8 KB, 下载次数: 387)

点评

好久没上了,谢谢啊  发表于 2011-5-23 19:22
[
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
466 小时
注册时间
2006-2-25
帖子
1863
7
发表于 2011-5-24 09:54:00 | 只看该作者
巧克力猫咪 发表于 2011-5-23 19:21

打开你脚本的Sideview2
把第1988行开始base_position方法替换为
def base_position
    x = 415 + self.class.position * 24
    @base_position_x = x
    @base_position_y = 110 + self.index * 36
    # バックアタック時はX軸を逆に
    @base_position_x = Graphics.width - x if $back_attack && N01::BACK_ATTACK
end
就可以了
标红的24就是如果你想让前锋 中锋 后卫间前后的距离变大一点的话就把这个数改大一点就好了

点评

有这点评就是认可答案了吧,汗,我想版主们应该懂这意思的吧,我认可了  发表于 2011-5-24 18:24

评分

参与人数 1星屑 +14 收起 理由
巧克力猫咪 + 14 谢谢!分数不大不过也代表了心意,谢谢帮忙.

查看全部评分

回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
49
在线时间
1 小时
注册时间
2011-5-17
帖子
15
8
发表于 2011-6-13 09:08:25 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 15:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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