幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1171|回复: 6

[RM2K&2K3] [求助]呐呐,请问一下有没有办法把所有队员都显示出来的?

[复制链接]

1

主题

5

帖子

785

积分

⑤进阶

十字刺客

积分
785
发表于 2006-1-29 22:40:13 | 显示全部楼层 |阅读模式
很多RPG里,主角队伍里有多少人,身后就会跟着多少人的嘛~~
FOR EXAMPLE 天之痕~~~~~
RMXP里怎么实现捏??

我尝试滴方法是做个事件,然后设置路线不断靠近主角,
但是这样问题很多~~比如换地图了就很麻烦....
初始位置不知道应该放在哪里...
[s:8]
请教拉~~~~
最好是不要碰RGSS或者脚本什么的...这方面偶很弱...
估计也不会有什么关系的~~~
.....才60字节,写什么好捏
回复

使用道具 举报

218

主题

1万

帖子

10万

积分

⑧专业

赋予你第五自由

积分
108021
发表于 2006-1-29 22:57:19 | 显示全部楼层
使用事件的话...很麻烦,这里建议使用脚本

(注释会是乱码,不用理会)

来源:
http://www4.big.or.jp/~fukuyama/
作者E-MAIL:
fukuyama@alles.or.jp
  1. # ▼▲▼ XRXS13. Train_Actor ▼▲▼
  2. # by fukuyama
  3. # ●透明状態用スイッチ設定
  4. # true だとスイッチ制御を行う
  5. # TRAIN_ACTOR_TRANSPARENT_SWITCH = true
  6. TRAIN_ACTOR_TRANSPARENT_SWITCH = false
  7. # ●透明状態用スイッチ番号
  8. # この番号のスイッチがONだと透明になる
  9. TRAIN_ACTOR_TRANSPARENT_SWITCHES_INDEX = 20
  10. # ●アクターの最大数
  11. # 将来的に多人数パーティが出来るようになったら…
  12. TRAIN_ACTOR_SIZE_MAX = 4
  13. # 定数
  14. #InputDOWN = 2 # この辺はちゃんと定数あった…
  15. #InputLEFT = 4
  16. #InputRIGHT = 6
  17. #InputUP = 8
  18. DOWN_LEFT = 1
  19. DOWN_RIGHT = 3
  20. UP_LEFT = 7
  21. UP_RIGHT = 9
  22. JUMP = 5
  23. class Game_Party_Actor Game_Character
  24. def initialize
  25. super()
  26. @through = true
  27. end
  28. def setup(actor)
  29. # キャラクターのファイル名と色相を設定
  30. if actor != nil
  31. @character_name = actor.character_name
  32. @character_hue = actor.character_hue
  33. else
  34. @character_name =
  35. @character_hue = 0
  36. end
  37. # 不透明度と合成方法を初期化
  38. @opacity = 255
  39. @blend_type = 0
  40. end
  41. def screen_z(height = 0)
  42. if $game_player.x == @x and $game_player.y == @y
  43. return $game_player.screen_z(height) - 1
  44. end
  45. super(height)
  46. end
  47. #--------------------------------------------------------------------------
  48. # ● 下に移動
  49. # turn_enabled その場での向き変更を許可するフラグ
  50. #--------------------------------------------------------------------------
  51. def move_down(turn_enabled = true)
  52. # 下を向く
  53. if turn_enabled
  54. turn_down
  55. end
  56. # 通行可能な場合
  57. if passable(@x, @y, InputDOWN)
  58. # 下を向く
  59. turn_down
  60. # 座標を更新
  61. @y += 1
  62. end
  63. end
  64. #--------------------------------------------------------------------------
  65. # ● 左に移動
  66. # turn_enabled その場での向き変更を許可するフラグ
  67. #--------------------------------------------------------------------------
  68. def move_left(turn_enabled = true)
  69. # 左を向く
  70. if turn_enabled
  71. turn_left
  72. end
  73. # 通行可能な場合
  74. if passable(@x, @y, InputLEFT)
  75. # 左を向く
  76. turn_left
  77. # 座標を更新
  78. @x -= 1
  79. end
  80. end
  81. #--------------------------------------------------------------------------
  82. # ● 右に移動
  83. # turn_enabled その場での向き変更を許可するフラグ
  84. #--------------------------------------------------------------------------
  85. def move_right(turn_enabled = true)
  86. # 右を向く
  87. if turn_enabled
  88. turn_right
  89. end
  90. # 通行可能な場合
  91. if passable(@x, @y, InputRIGHT)
  92. # 右を向く
  93. turn_right
  94. # 座標を更新
  95. @x += 1
  96. end
  97. end
  98. #--------------------------------------------------------------------------
  99. # ● 上に移動
  100. # turn_enabled その場での向き変更を許可するフラグ
  101. #--------------------------------------------------------------------------
  102. def move_up(turn_enabled = true)
  103. # 上を向く
  104. if turn_enabled
  105. turn_up
  106. end
  107. # 通行可能な場合
  108. if passable(@x, @y, InputUP)
  109. # 上を向く
  110. turn_up
  111. # 座標を更新
  112. @y -= 1
  113. end
  114. end
  115. #--------------------------------------------------------------------------
  116. # ● 左下に移動
  117. #--------------------------------------------------------------------------
  118. def move_lower_left
  119. # 向き固定でない場合
  120. unless @direction_fix
  121. # 右向きだった場合は左を、上向きだった場合は下を向く
  122. @direction = (@direction == InputRIGHT InputLEFT @direction == InputUP InputDOWN @direction)
  123. end
  124. # 下→左、左→下 のどちらかのコースが通行可能な場合
  125. if (passable(@x, @y, InputDOWN) and passable(@x, @y + 1, InputLEFT)) or
  126. (passable(@x, @y, InputLEFT) and passable(@x - 1, @y, InputDOWN))
  127. # 座標を更新
  128. @x -= 1
  129. @y += 1
  130. end
  131. end
  132. #--------------------------------------------------------------------------
  133. # ● 右下に移動
  134. #--------------------------------------------------------------------------
  135. def move_lower_right
  136. # 向き固定でない場合
  137. unless @direction_fix
  138. # 左向きだった場合は右を、上向きだった場合は下を向く
  139. @direction = (@direction == InputLEFT InputRIGHT @direction == InputUP InputDOWN @direction)
  140. end
  141. # 下→右、右→下 のどちらかのコースが通行可能な場合
  142. if (passable(@x, @y, InputDOWN) and passable(@x, @y + 1, InputRIGHT)) or
  143. (passable(@x, @y, InputRIGHT) and passable(@x + 1, @y, InputDOWN))
  144. # 座標を更新
  145. @x += 1
  146. @y += 1
  147. end
  148. end
  149. #--------------------------------------------------------------------------
  150. # ● 左上に移動
  151. #--------------------------------------------------------------------------
  152. def move_upper_left
  153. # 向き固定でない場合
  154. unless @direction_fix
  155. # 右向きだった場合は左を、下向きだった場合は上を向く
  156. @direction = (@direction == InputRIGHT InputLEFT @direction == InputDOWN InputUP @direction)
  157. end
  158. # 上→左、左→上 のどちらかのコースが通行可能な場合
  159. if (passable(@x, @y, InputUP) and passable(@x, @y - 1, InputLEFT)) or
  160. (passable(@x, @y, InputLEFT) and passable(@x - 1, @y, InputUP))
  161. # 座標を更新
  162. @x -= 1
  163. @y -= 1
  164. end
  165. end
  166. #--------------------------------------------------------------------------
  167. # ● 右上に移動
  168. #--------------------------------------------------------------------------
  169. def move_upper_right
  170. # 向き固定でない場合
  171. unless @direction_fix
  172. # 左向きだった場合は右を、下向きだった場合は上を向く
  173. @direction = (@direction == InputLEFT InputRIGHT @direction == InputDOWN InputUP @direction)
  174. end
  175. # 上→右、右→上 のどちらかのコースが通行可能な場合
  176. if (passable(@x, @y, InputUP) and passable(@x, @y - 1, InputRIGHT)) or
  177. (passable(@x, @y, InputRIGHT) and passable(@x + 1, @y, InputUP))
  178. # 座標を更新
  179. @x += 1
  180. @y -= 1
  181. end
  182. end
  183.   attr_writer :move_speed
  184. end
  185. module Train_Actor_Spriteset_Map_Module
  186.   def setup_actor_character_sprites?
  187.     return @setup_actor_character_sprites_flag != nil
  188.   end
  189.   def setup_actor_character_sprites(characters)
  190.     if !setup_actor_character_sprites?
  191.       index_game_player = 0
  192.       @character_sprites.each_index do |i|
  193.         if @character_sprites[i].character.instance_of?(Game_Player)
  194.           index_game_player = i
  195.           break
  196.         end
  197.       end
  198.       for character in characters.reverse
  199.         @character_sprites.unshift(
  200.           Sprite_Character.new(@viewport1, character)
  201.         )
  202.       end
  203.       @setup_actor_character_sprites_flag = true
  204.     end
  205.   end
  206. end
  207. module Train_Actor_Scene_Map_Module
  208.   def setup_actor_character_sprites(characters)
  209.     @spriteset.setup_actor_character_sprites(characters)
  210.   end
  211. end
  212. module Train_Actor_Game_Party_Module
  213.   def set_transparent_actors(transparent)
  214.     @transparent = transparent
  215.   end
  216.   def setup_actor_character_sprites
  217.     if @characters == nil
  218.       @characters = []
  219.       for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  220.         @characters.push(Game_Party_Actor.new)
  221.       end
  222.     end
  223.     for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  224.       @characters[i - 1].setup(actors[i])
  225.     end
  226.     if $scene.instance_of?(Scene_Map)
  227.       $scene.setup_actor_character_sprites(@characters)
  228.     end
  229.   end
  230.   def update_party_actors
  231.     setup_actor_character_sprites
  232.     transparent = $game_player.transparent
  233.     if transparent == false
  234.       if TRAIN_ACTOR_TRANSPARENT_SWITCH
  235.         transparent = $game_switches[TRAIN_ACTOR_TRANSPARENT_SWITCHES_INDEX]
  236.       end
  237.     end
  238.     for character in @characters
  239.       character.transparent = transparent
  240.       character.move_speed = $game_player.move_speed
  241.       character.update
  242.     end
  243.   end
  244.   def moveto_party_actors( x, y )
  245.     setup_actor_character_sprites
  246.     for character in @characters
  247.       character.moveto( x, y )
  248.     end
  249.     if @move_list == nil
  250.       @move_list = []
  251.     end
  252.     move_list_setup
  253.   end
  254.   def move_party_actors
  255.     if @move_list == nil
  256.       @move_list = []
  257.       move_list_setup
  258.     end
  259.     @move_list.each_index do |i|
  260.       if @characters[i] != nil
  261.         case @move_list[i].type
  262.           when Input::DOWN
  263.             @characters[i].move_down(@move_list[i].args[0])
  264.           when Input::LEFT
  265.             @characters[i].move_left(@move_list[i].args[0])
  266.           when Input::RIGHT
  267.             @characters[i].move_right(@move_list[i].args[0])
  268.           when Input::UP
  269.             @characters[i].move_up(@move_list[i].args[0])
  270.           when DOWN_LEFT
  271.             @characters[i].move_lower_left
  272.           when DOWN_RIGHT
  273.             @characters[i].move_lower_right
  274.           when UP_LEFT
  275.             @characters[i].move_upper_left
  276.           when UP_RIGHT
  277.             @characters[i].move_upper_right
  278.           when JUMP
  279.             @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
  280.         end
  281.       end
  282.     end
  283.   end
  284.   class Train_Actor_Move_List_Element
  285.     def initialize(type,args)
  286.       @type = type
  287.       @args = args
  288.     end
  289.     def type() return @type end
  290.     def args() return @args end
  291.   end
  292.   def move_list_setup
  293.     for i in 0 .. TRAIN_ACTOR_SIZE_MAX
  294.       @move_list[i] = nil
  295.     end
  296.   end
  297.   def add_move_list(type,*args)
  298.     @move_list.unshift(Train_Actor_Move_List_Element.new(type,args)).pop
  299.   end
  300.   def move_down_party_actors(turn_enabled = true)
  301.     move_party_actors
  302.     add_move_list(Input::DOWN,turn_enabled)
  303.   end
  304.   def move_left_party_actors(turn_enabled = true)
  305.     move_party_actors
  306.     add_move_list(Input::LEFT,turn_enabled)
  307.   end
  308.   def move_right_party_actors(turn_enabled = true)
  309.     move_party_actors
  310.     add_move_list(Input::RIGHT,turn_enabled)
  311.   end
  312.   def move_up_party_actors(turn_enabled = true)
  313.     move_party_actors
  314.     add_move_list(Input::UP,turn_enabled)
  315.   end
  316.   def move_lower_left_party_actors
  317.     move_party_actors
  318.     add_move_list(DOWN_LEFT)
  319.   end
  320.   def move_lower_right_party_actors
  321.     move_party_actors
  322.     add_move_list(DOWN_RIGHT)
  323.   end
  324.   def move_upper_left_party_actors
  325.     move_party_actors
  326.     add_move_list(UP_LEFT)
  327.   end
  328.   def move_upper_right_party_actors
  329.     move_party_actors
  330.     add_move_list(UP_RIGHT)
  331.   end
  332.   def jump_party_actors(x_plus, y_plus)
  333.     move_party_actors
  334.     add_move_list(JUMP,x_plus, y_plus)
  335.   end
  336. end
  337. module Train_Actor_Game_Player_Module
  338.   def update
  339.     $game_party.update_party_actors
  340.     super
  341.   end
  342.   def moveto( x, y )
  343.     $game_party.moveto_party_actors( x, y )
  344.     super( x, y )
  345.   end
  346.   def move_down(turn_enabled = true)
  347.     if passable?(@x, @y, Input::DOWN)
  348.       $game_party.move_down_party_actors(turn_enabled)
  349.     end
  350.     super(turn_enabled)
  351.   end
  352.   def move_left(turn_enabled = true)
  353.     if passable?(@x, @y, Input::LEFT)
  354.       $game_party.move_left_party_actors(turn_enabled)
  355.     end
  356.     super(turn_enabled)
  357.   end
  358.   def move_right(turn_enabled = true)
  359.     if passable?(@x, @y, Input::RIGHT)
  360.       $game_party.move_right_party_actors(turn_enabled)
  361.     end
  362.     super(turn_enabled)
  363.   end
  364.   def move_up(turn_enabled = true)
  365.     if passable?(@x, @y, Input::UP)
  366.       $game_party.move_up_party_actors(turn_enabled)
  367.     end
  368.     super(turn_enabled)
  369.   end
  370.   def move_lower_left
  371.     # 壓仺嵍丄嵍仺壓 偺偳偪傜偐偺僐乕僗偑捠峴壜擻側応崌\\n    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  372.        (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  373.       $game_party.move_lower_left_party_actors
  374.     end
  375.     super
  376.   end
  377.   def move_lower_right
  378.     # 壓仺塃丄塃仺壓 偺偳偪傜偐偺僐乕僗偑捠峴壜擻側応崌\\n    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  379.        (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  380.       $game_party.move_lower_right_party_actors
  381.     end
  382.     super
  383.   end
  384.   def move_upper_left
  385.     # 忋仺嵍丄嵍仺忋 偺偳偪傜偐偺僐乕僗偑捠峴壜擻側応崌\\n    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  386.        (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  387.       $game_party.move_upper_left_party_actors
  388.     end
  389.     super
  390.   end
  391.   def move_upper_right
  392.     # 忋仺塃丄塃仺忋 偺偳偪傜偐偺僐乕僗偑捠峴壜擻側応崌\\n    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  393.        (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  394.       $game_party.move_upper_right_party_actors
  395.     end
  396.     super
  397.   end
  398.   def jump(x_plus, y_plus)
  399.     # 怴偟偄嵗昗傪寁嶼
  400.     new_x = @x + x_plus
  401.     new_y = @y + y_plus
  402.     # 壛嶼抣偑 (0,0) 偺応崌偐丄僕儍儞僾愭偑捠峴壜擻側応崌\\n    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  403.       $game_party.jump_party_actors(x_plus, y_plus)
  404.     end
  405.     super(x_plus, y_plus)
  406.   end
  407.   
  408.   # -----------------------------------------------
  409.   # move_speed 傪奜偐傜尒傟傞傛偆偵
  410.   # -----------------------------------------------
  411.   attr_reader :move_speed
  412. end
  413. class Game_Party
  414.   include Train_Actor_Game_Party_Module
  415. end
  416. class Game_Player
  417.   include Train_Actor_Game_Player_Module
  418. end
  419. class Spriteset_Map
  420.   include Train_Actor_Spriteset_Map_Module
  421. end
  422. class Scene_Map
  423.   include Train_Actor_Scene_Map_Module
  424. end
  425. # Train_Actor
复制代码

第 五 自 由 -   5th  Freedom   -

回复 支持 反对

使用道具 举报

1

主题

5

帖子

785

积分

⑤进阶

十字刺客

积分
785
 楼主| 发表于 2006-1-29 23:05:30 | 显示全部楼层
没有注释的脚本.....它根本就是大学六级英语阅读的弟弟啊!
谢谢了~~~~我努力下看看...
.....才60字节,写什么好捏
回复 支持 反对

使用道具 举报

218

主题

1万

帖子

10万

积分

⑧专业

赋予你第五自由

积分
108021
发表于 2006-1-29 23:11:02 | 显示全部楼层
不是没有注释,而是部分注释会是乱码...不过也没关系的...

PS:使用脚本需谨慎,可能会冲突的..

第 五 自 由 -   5th  Freedom   -

回复 支持 反对

使用道具 举报

墮天使路 该用户已被删除
发表于 2006-1-31 19:07:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

218

主题

1万

帖子

10万

积分

⑧专业

赋予你第五自由

积分
108021
发表于 2006-1-31 19:08:48 | 显示全部楼层
下面是引用EEQP于2006-01-31 19:07发表的:
傳說在某網站有中文的.................
- -也就是注释是中文的...楼主不会是用来研究吧..?这样是否中文都没问题了..(因为这个脚本根本不需要调整..)

第 五 自 由 -   5th  Freedom   -

回复 支持 反对

使用道具 举报

1

主题

5

帖子

785

积分

⑤进阶

十字刺客

积分
785
 楼主| 发表于 2006-2-1 03:56:30 | 显示全部楼层
....多谢,我已经放弃这个无聊的念头了....
.....才60字节,写什么好捏
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-26 05:11 , Processed in 0.012637 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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