查看: 2364|回复: 5

[已经解决] 求教。我想设置角色001始终在队伍第一位不能动怎么弄

[复制链接]
梦石
0
星屑
466
在线时间
345 小时
注册时间
2015-10-19
回帖
63
发表于 2015-11-16 16:43:29 | 显示全部楼层 |阅读模式

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

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

×
可以离队,离队后归队还是在队伍第一个
梦石
0
星屑
50
在线时间
37 小时
注册时间
2015-10-12
回帖
51
发表于 2015-11-16 19:23:39 | 显示全部楼层
我只会笨办法,,a归队时把bcd离队,然后再让abcd入队 = =
_
回复

使用道具 举报

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

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

发表于 2015-11-16 21:03:17 | 显示全部楼层
本帖最后由 cinderelmini 于 2015-11-16 21:11 编辑

因为MenuStatus是两用的,
所以没想到什么好的办法让选框不能移动到第一个角色的位置,
只能在整队的时候让第一个位置不能选……
然后就是要加入领队角色的话,不要用事件里的队伍管理,
用事件的【脚本】填上“加入领队(角色数据库ID)”就好了。

脚本在Main前Insert就好……
~这个是队伍第一位置的角色不能换位置的版本~

  1. ######################################
  2. # 主角归队排在第一
  3. ######################################
  4. class Game_Interpreter
  5.   def 加入领队(actor_id)
  6.     $game_party.add_leader(actor_id)
  7.   end
  8. end

  9. class Game_Party < Game_Unit
  10.   #--------------------------------------------------------------------------
  11.   # ● 角色入队
  12.   #--------------------------------------------------------------------------
  13.   def add_leader(actor_id)
  14.     @actors.insert(0, actor_id) unless @actors.include?(actor_id)
  15.     $game_player.refresh
  16.     $game_map.need_refresh = true
  17.   end
  18. end


  19. ######################################
  20. # 整队操作不能更换领队(排在第一的角色)
  21. ######################################

  22. class Window_MenuStatus < Window_Selectable
  23.   attr_accessor :on_formation
  24.   #--------------------------------------------------------------------------
  25.   # ● 按下确定键时的处理
  26.   #--------------------------------------------------------------------------
  27.   alias t_151116_process_ok process_ok
  28.   def process_ok
  29.     if @on_formation && self.index == 0
  30.       Sound.play_buzzer
  31.       return
  32.     end
  33.     t_151116_process_ok
  34.   end
  35. end

  36. class Scene_Menu < Scene_MenuBase
  37.   #--------------------------------------------------------------------------
  38.   # ● 指令“整队”
  39.   #--------------------------------------------------------------------------
  40.   alias t_151116_command_formation command_formation
  41.   def command_formation
  42.     @status_window.on_formation = true
  43.     t_151116_command_formation
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 整队“确定”
  47.   #--------------------------------------------------------------------------
  48.   alias t_151116_on_formation_ok on_formation_ok
  49.   def on_formation_ok
  50.     return if @status_window.index == 0
  51.     t_151116_on_formation_ok
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 整队“取消”
  55.   #--------------------------------------------------------------------------
  56.   alias t_151116_on_formation_cancel on_formation_cancel
  57.   def on_formation_cancel
  58.     @status_window.on_formation = false
  59.     t_151116_on_formation_cancel
  60.   end
  61. end
复制代码




稍微修改了一下,如果是按位置来的话有点坑……
下面这个是改成了按照角色ID来决定是不是可以换位置的:
~这个是数据库一号角色不能换位置版本~

  1. ######################################
  2. # 主角归队排在第一
  3. ######################################
  4. class Game_Interpreter
  5.   def 加入领队(actor_id)
  6.     $game_party.add_leader(actor_id)
  7.   end
  8. end

  9. class Game_Party < Game_Unit
  10.   #--------------------------------------------------------------------------
  11.   # ● 角色入队
  12.   #--------------------------------------------------------------------------
  13.   def add_leader(actor_id)
  14.     @actors.insert(0, actor_id) unless @actors.include?(actor_id)
  15.     $game_player.refresh
  16.     $game_map.need_refresh = true
  17.   end
  18. end


  19. ######################################
  20. # 整队操作不能更换领队(排在第一的角色)
  21. ######################################

  22. class Window_MenuStatus < Window_Selectable
  23.   attr_accessor :on_formation
  24.   #--------------------------------------------------------------------------
  25.   # ● 按下确定键时的处理
  26.   #--------------------------------------------------------------------------
  27.   alias t_151116_process_ok process_ok
  28.   def process_ok
  29. #~     if @on_formation && self.index == 0
  30.     if @on_formation && actor_now.id == 1
  31.       Sound.play_buzzer
  32.       return
  33.     end
  34.     t_151116_process_ok
  35.   end
  36.   
  37.   def actor_now
  38.     return $game_party.members[self.index]
  39.   end
  40. end

  41. class Scene_Menu < Scene_MenuBase
  42.   #--------------------------------------------------------------------------
  43.   # ● 指令“整队”
  44.   #--------------------------------------------------------------------------
  45.   alias t_151116_command_formation command_formation
  46.   def command_formation
  47.     @status_window.on_formation = true
  48.     t_151116_command_formation
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ● 整队“确定”
  52.   #--------------------------------------------------------------------------
  53.   alias t_151116_on_formation_ok on_formation_ok
  54.   def on_formation_ok
  55. #~     return if @status_window.index == 0
  56.     return if @status_window.actor_now.id == 1
  57.     t_151116_on_formation_ok
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 整队“取消”
  61.   #--------------------------------------------------------------------------
  62.   alias t_151116_on_formation_cancel on_formation_cancel
  63.   def on_formation_cancel
  64.     @status_window.on_formation = false
  65.     t_151116_on_formation_cancel
  66.   end
  67. end
复制代码

点评

没有作用的样子。。新建工程也不行  发表于 2015-11-16 22:50

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
466
在线时间
345 小时
注册时间
2015-10-19
回帖
63
 楼主| 发表于 2015-11-16 23:17:26 | 显示全部楼层
cinderelmini 发表于 2015-11-16 21:03
因为MenuStatus是两用的,
所以没想到什么好的办法让选框不能移动到第一个角色的位置,
只能在整队的时候让 ...

就像这样

或者都变成这样了

或者都变成这样了
2.PNG

点评

没有作用是指整队功能还是队长加入功能,后者的话并不是填“加入领队(actor_1)”而是直接填“加入领队(1)”。。。  发表于 2015-11-17 11:44
回复

使用道具 举报

无限の剣制

梦石
0
星屑
10445
在线时间
5019 小时
注册时间
2013-2-28
回帖
4942

开拓者贵宾

发表于 2015-11-16 23:35:33 | 显示全部楼层
队长加入队伍时调用事件脚本
  1. id = $game_actors[1].index
  2. $game_party.swap_order(0,id)
复制代码
回复

使用道具 举报

梦石
0
星屑
466
在线时间
345 小时
注册时间
2015-10-19
回帖
63
 楼主| 发表于 2015-11-17 12:48:27 | 显示全部楼层
约约v看看 发表于 2015-11-16 23:17
就像这样

我也是脚本盲来着

2.zip

1.43 MB, 下载次数: 63

还是原来的错误怎么破啊,是不是还需要改哪些地方

点评

O(∩_∩)O谢谢,终于解决了这枚疑难杂症  发表于 2015-11-17 17:18
加入领队(1) ←括弧是半角的不是全角的……(切换到英文输入后再打括弧。  发表于 2015-11-17 16:35
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部