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

Project1

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

[已经过期] 加入队员和使队员跟随在后面是怎么样制作的啊?

[复制链接]

Lv1.梦旅人

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

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

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

x
不会啊,求高手,谢谢,怎么可以使一件事情发生完以后时间就成为晚上,还有怎么可以使一件事件发生完之后,就一夜过去啊?
求帮助啊,俺真是菜鸟一只啊.

Lv1.梦旅人

尽头

梦石
0
星屑
119
在线时间
278 小时
注册时间
2010-6-20
帖子
1280
2
发表于 2010-8-7 19:02:19 | 只看该作者
回答1:列车移动脚本。
回答2:过一夜的话,更改画面色调为-255,-255,-255 n帧,等待n帧,更改画面色调0,0,0
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
3
发表于 2010-8-7 19:32:37 | 只看该作者
在main前面新建一个页插入下面脚本全部内容的说
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. # ————————————————————————————————————
  5. # ▼▲▼ XRXS13. パーティ列車移動 ver.1.02 ▼▲▼
  6. # by fukuyama
  7. #
  8. # Train_Actor
  9. #
  10. # [email protected]
  11. # http://www4.big.or.jp/~fukuyama/rgss/Train_Actor.txt
  12. #
  13. module Train_Actor
  14. #是否使用停止跟随的方法,也就是说,这里false改为true的时候,如果TRANSPARENT_SWITCHES_INDEX
  15. #开关打开,跟随的人物就消失了(其实只是变成透明而已)
  16. TRANSPARENT_SWITCH = true
  17. TRANSPARENT_SWITCHES_INDEX = 20
  18. #举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。
  19. #跟随人数的最大数目,可以更改为2、3什么的。
  20. TRAIN_ACTOR_SIZE_MAX = 5
  21. # 定数
  22. #Input::DOWN = 2
  23. #Input::LEFT = 4
  24. #Input::RIGHT = 6
  25. #Input::UP = 6
  26. DOWN_LEFT = 1
  27. DOWN_RIGHT = 3
  28. UP_LEFT = 7
  29. UP_RIGHT = 9
  30. JUMP = 5
  31. class Game_Party_Actor < Game_Character
  32. def initialize
  33. super()
  34. @through = true
  35. end
  36. def setup(actor)
  37. # キャラクターのファイル名と色相を設定
  38. if actor != nil
  39. @character_name = actor.character_name
  40. @character_hue = actor.character_hue
  41. else
  42. @character_name = ""
  43. @character_hue = 0
  44. end
  45. # 不透明度と合成方法を初期化
  46. @opacity = 255
  47. @blend_type = 0
  48. end
  49. def screen_z(height = 0)
  50. if $game_player.x == @x and $game_player.y == @y
  51. return $game_player.screen_z(height) - 1
  52. end
  53. super(height)
  54. end
  55. #--------------------------------------------------------------------------
  56. # ● 下に移動
  57. # turn_enabled : その場での向き変更を許可するフラグ
  58. #--------------------------------------------------------------------------
  59. def move_down(turn_enabled = true)
  60. # 下を向く
  61. if turn_enabled
  62. turn_down
  63. end
  64. # 通行可能な場合
  65. if passable?(@x, @y, Input::DOWN)
  66. # 下を向く
  67. turn_down
  68. # 座標を更新
  69. @y += 1
  70. end
  71. end
  72. #--------------------------------------------------------------------------
  73. # ● 左に移動
  74. # turn_enabled : その場での向き変更を許可するフラグ
  75. #--------------------------------------------------------------------------
  76. def move_left(turn_enabled = true)
  77. # 左を向く
  78. if turn_enabled
  79. turn_left
  80. end
  81. # 通行可能な場合
  82. if passable?(@x, @y, Input::LEFT)
  83. # 左を向く
  84. turn_left
  85. # 座標を更新
  86. @x -= 1
  87. end
  88. end
  89. #--------------------------------------------------------------------------
  90. # ● 右に移動
  91. # turn_enabled : その場での向き変更を許可するフラグ
  92. #--------------------------------------------------------------------------
  93. def move_right(turn_enabled = true)
  94. # 右を向く
  95. if turn_enabled
  96. turn_right
  97. end
  98. # 通行可能な場合
  99. if passable?(@x, @y, Input::RIGHT)
  100. # 右を向く
  101. turn_right
  102. # 座標を更新
  103. @x += 1
  104. end
  105. end
  106. #--------------------------------------------------------------------------
  107. # ● 上に移動
  108. # turn_enabled : その場での向き変更を許可するフラグ
  109. #--------------------------------------------------------------------------
  110. def move_up(turn_enabled = true)
  111. # 上を向く
  112. if turn_enabled
  113. turn_up
  114. end
  115. # 通行可能な場合
  116. if passable?(@x, @y, Input::UP)
  117. # 上を向く
  118. turn_up
  119. # 座標を更新
  120. @y -= 1
  121. end
  122. end
  123. #--------------------------------------------------------------------------
  124. # ● 左下に移動
  125. #--------------------------------------------------------------------------
  126. def move_lower_left
  127. # 向き固定でない場合
  128. unless @direction_fix
  129. # 右向きだった場合は左を、上向きだった場合は下を向く
  130. @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
  131. end
  132. # 下→左、左→下 のどちらかのコースが通行可能な場合
  133. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  134. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  135. # 座標を更新
  136. @x -= 1
  137. @y += 1
  138. end
  139. end
  140. #--------------------------------------------------------------------------
  141. # ● 右下に移動
  142. #--------------------------------------------------------------------------
  143. def move_lower_right
  144. # 向き固定でない場合
  145. unless @direction_fix
  146. # 左向きだった場合は右を、上向きだった場合は下を向く
  147. @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
  148. end
  149. # 下→右、右→下 のどちらかのコースが通行可能な場合
  150. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  151. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  152. # 座標を更新
  153. @x += 1
  154. @y += 1
  155. end
  156. end
  157. #--------------------------------------------------------------------------
  158. # ● 左上に移動
  159. #--------------------------------------------------------------------------
  160. def move_upper_left
  161. # 向き固定でない場合
  162. unless @direction_fix
  163. # 右向きだった場合は左を、下向きだった場合は上を向く
  164. @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
  165. end
  166. # 上→左、左→上 のどちらかのコースが通行可能な場合
  167. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  168. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  169. # 座標を更新
  170. @x -= 1
  171. @y -= 1
  172. end
  173. end
  174. #--------------------------------------------------------------------------
  175. # ● 右上に移動
  176. #--------------------------------------------------------------------------
  177. def move_upper_right
  178. # 向き固定でない場合
  179. unless @direction_fix
  180. # 左向きだった場合は右を、下向きだった場合は上を向く
  181. @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
  182. end
  183. # 上→右、右→上 のどちらかのコースが通行可能な場合
  184. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  185. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  186. # 座標を更新
  187. @x += 1
  188. @y -= 1
  189. end
  190. end
  191. attr_writer :move_speed
  192. attr_writer :step_anime
  193. end
  194. module Spriteset_Map_Module
  195. def setup_actor_character_sprites?
  196. return @setup_actor_character_sprites_flag != nil
  197. end
  198. def setup_actor_character_sprites(characters)
  199. if !setup_actor_character_sprites?
  200. index_game_player = 0
  201. @character_sprites.each_index do |i|
  202. if @character_sprites[i].character.instance_of?(Game_Player)
  203. index_game_player = i
  204. break
  205. end
  206. end
  207. for character in characters.reverse
  208. @character_sprites.unshift(
  209. Sprite_Character.new(@viewport1, character)
  210. )
  211. end
  212. @setup_actor_character_sprites_flag = true
  213. end
  214. end
  215. end
  216. module Scene_Map_Module
  217. def setup_actor_character_sprites(characters)
  218. @spriteset.setup_actor_character_sprites(characters)
  219. end
  220. end
  221. module Game_Party_Module
  222. def return_char(i)
  223. return @characters[i]
  224. end
  225. def set_transparent_actors(transparent)
  226. @transparent = transparent
  227. end
  228. def setup_actor_character_sprites
  229. if @characters == nil
  230. @characters = []
  231. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  232. @characters.push(Game_Party_Actor.new)
  233. end
  234. end
  235. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  236. @characters[i - 1].setup(actors[i])
  237. end
  238. if $scene.class.method_defined?('setup_actor_character_sprites')
  239. $scene.setup_actor_character_sprites(@characters)
  240. end
  241. end
  242. def update_party_actors
  243. setup_actor_character_sprites
  244. transparent = $game_player.transparent
  245. if transparent == false
  246. if TRANSPARENT_SWITCH
  247. transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
  248. end
  249. end
  250. for character in @characters
  251. character.transparent = transparent
  252. character.move_speed = $game_player.move_speed
  253. character.step_anime = $game_player.step_anime
  254. character.update
  255. end
  256. end
  257. def moveto_party_actors( x, y )
  258. setup_actor_character_sprites
  259. for character in @characters
  260. character.moveto( x, y )
  261. end
  262. if @move_list == nil
  263. @move_list = []
  264. end
  265. move_list_setup
  266. end
  267. def move_party_actors
  268. if @move_list == nil
  269. @move_list = []
  270. move_list_setup
  271. end
  272. @move_list.each_index do |i|
  273. if @characters[i] != nil
  274. case @move_list[i].type
  275. when Input::DOWN
  276. @characters[i].move_down(@move_list[i].args[0])
  277. when Input::LEFT
  278. @characters[i].move_left(@move_list[i].args[0])
  279. when Input::RIGHT
  280. @characters[i].move_right(@move_list[i].args[0])
  281. when Input::UP
  282. @characters[i].move_up(@move_list[i].args[0])
  283. when DOWN_LEFT
  284. @characters[i].move_lower_left
  285. when DOWN_RIGHT
  286. @characters[i].move_lower_right
  287. when UP_LEFT
  288. @characters[i].move_upper_left
  289. when UP_RIGHT
  290. @characters[i].move_upper_right
  291. when JUMP
  292. @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
  293. end
  294. end
  295. end
  296. end
  297. class Move_List_Element
  298. def initialize(type,args)
  299. @type = type
  300. @args = args
  301. end
  302. def type() return @type end
  303. def args() return @args end
  304. end
  305. def move_list_setup
  306. for i in 0 .. TRAIN_ACTOR_SIZE_MAX
  307. @move_list[i] = nil
  308. end
  309. end
  310. def add_move_list(type,*args)
  311. @move_list.unshift(Move_List_Element.new(type,args)).pop
  312. end
  313. def move_down_party_actors(turn_enabled = true)
  314. move_party_actors
  315. add_move_list(Input::DOWN,turn_enabled)
  316. end
  317. def move_left_party_actors(turn_enabled = true)
  318. move_party_actors
  319. add_move_list(Input::LEFT,turn_enabled)
  320. end
  321. def move_right_party_actors(turn_enabled = true)
  322. move_party_actors
  323. add_move_list(Input::RIGHT,turn_enabled)
  324. end
  325. def move_up_party_actors(turn_enabled = true)
  326. move_party_actors
  327. add_move_list(Input::UP,turn_enabled)
  328. end
  329. def move_lower_left_party_actors
  330. move_party_actors
  331. add_move_list(DOWN_LEFT)
  332. end
  333. def move_lower_right_party_actors
  334. move_party_actors
  335. add_move_list(DOWN_RIGHT)
  336. end
  337. def move_upper_left_party_actors
  338. move_party_actors
  339. add_move_list(UP_LEFT)
  340. end
  341. def move_upper_right_party_actors
  342. move_party_actors
  343. add_move_list(UP_RIGHT)
  344. end
  345. def jump_party_actors(x_plus, y_plus)
  346. move_party_actors
  347. add_move_list(JUMP,x_plus, y_plus)
  348. end
  349. end
  350. module Game_Player_Module
  351. def update
  352. $game_party.update_party_actors
  353. super
  354. end
  355. def moveto( x, y )
  356. $game_party.moveto_party_actors( x, y )
  357. super( x, y )
  358. end
  359. def move_down(turn_enabled = true)
  360. if passable?(@x, @y, Input::DOWN)
  361. $game_party.move_down_party_actors(turn_enabled)
  362. end
  363. super(turn_enabled)
  364. end
  365. def move_left(turn_enabled = true)
  366. if passable?(@x, @y, Input::LEFT)
  367. $game_party.move_left_party_actors(turn_enabled)
  368. end
  369. super(turn_enabled)
  370. end
  371. def move_right(turn_enabled = true)
  372. if passable?(@x, @y, Input::RIGHT)
  373. $game_party.move_right_party_actors(turn_enabled)
  374. end
  375. super(turn_enabled)
  376. end
  377. def move_up(turn_enabled = true)
  378. if passable?(@x, @y, Input::UP)
  379. $game_party.move_up_party_actors(turn_enabled)
  380. end
  381. super(turn_enabled)
  382. end
  383. def move_lower_left
  384. # 下→左、左→下 のどちらかのコースが通行可能な場合
  385. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  386. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  387. $game_party.move_lower_left_party_actors
  388. end
  389. super
  390. end
  391. def move_lower_right
  392. # 下→右、右→下 のどちらかのコースが通行可能な場合
  393. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  394. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  395. $game_party.move_lower_right_party_actors
  396. end
  397. super
  398. end
  399. def move_upper_left
  400. # 上→左、左→上 のどちらかのコースが通行可能な場合
  401. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  402. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  403. $game_party.move_upper_left_party_actors
  404. end
  405. super
  406. end
  407. def move_upper_right
  408. # 上→右、右→上 のどちらかのコースが通行可能な場合
  409. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  410. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  411. $game_party.move_upper_right_party_actors
  412. end
  413. super
  414. end
  415. def jump(x_plus, y_plus)
  416. # 新しい座標を計算
  417. new_x = @x + x_plus
  418. new_y = @y + y_plus
  419. # 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
  420. if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  421. $game_party.jump_party_actors(x_plus, y_plus)
  422. end
  423. super(x_plus, y_plus)
  424. end
  425. attr_reader :move_speed
  426. attr_reader :step_anime
  427. end
  428. end # module Train_Actor
  429. class Game_Party
  430. include Train_Actor::Game_Party_Module
  431. end
  432. class Game_Player
  433. include Train_Actor::Game_Player_Module
  434. end
  435. class Spriteset_Map
  436. include Train_Actor::Spriteset_Map_Module
  437. end
  438. class Scene_Map
  439. include Train_Actor::Scene_Map_Module
  440. end
  441. #==============================================================================
  442. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  443. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
120
在线时间
92 小时
注册时间
2009-8-1
帖子
438
4
发表于 2010-8-7 20:08:22 | 只看该作者
搜索“人物跟随”,可以找到挺多脚本。
哎呦,好像快要能发布一款游戏了,这次一定要低调!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2010-8-3
帖子
10
5
 楼主| 发表于 2010-8-8 07:44:32 | 只看该作者
我复制了以后制作的是人物一开始就跟随主角了,那如果我想和他对话之后加入呢?


   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
帖子
1305
6
发表于 2010-8-8 08:44:00 | 只看该作者
回复 lihehai 的帖子系统里可以删除多余的初期队员,加入队员用事件里的替换角色。


   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2010-8-3
帖子
10
7
 楼主| 发表于 2010-8-8 09:02:33 | 只看该作者
回复 zhangbanxian 的帖子


应该怎么设置啊,我只设置了替换队员:[]加入,初始化这一行字,为什么队员站着不动啊,俺真的太愚笨了,5555~~   
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
4 小时
注册时间
2010-8-8
帖子
19
8
发表于 2010-8-8 10:43:07 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2010-8-3
帖子
10
9
 楼主| 发表于 2010-8-8 12:24:05 | 只看该作者
回复 流年Vs残月 的帖子

啊,把事件结束啊,什么意思啊,不懂的说,5555~~俺真的很笨的,事件中的人物说话俺知道怎么设置,可是自己控制的角色回答,俺都不知道怎么设置,泪蹦了.
   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
10
发表于 2010-8-8 16:15:05 | 只看该作者
回复 lihehai 的帖子
。。。20号开关可以控制显示后面跟随的角色:
20号开关=ON时不显示后面的角色。。。
反之则显示

   
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-27 04:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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