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

Project1

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

[已经解决] 怎么让其他人物跟着主角 怎么添加我自己的声音

[复制链接]

Lv1.梦旅人

梦石
0
星屑
260
在线时间
3 小时
注册时间
2012-1-6
帖子
3
跳转到指定楼层
1
发表于 2012-3-22 13:55:50 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
怎么让其他人物跟着主角  怎么添加我自己的声音
我想,人物说话显示字也同时说话
让其他人物跟着主角

Lv4.逐梦者 (版主)

职业の水客

梦石
0
星屑
13640
在线时间
7132 小时
注册时间
2010-6-16
帖子
3487

开拓者

2
发表于 2012-3-22 16:52:09 手机端发表。 | 只看该作者
1搜索人物跟随
2显示文字时播放bgm
一个看图的地方
群爆炸重建后状态:论坛老人最多(只剩下了活跃的老人),技术力很强(依旧不变)的编程灌水群:901540785
专门讨论RM相关的Q群:56875149
PS:第一个群不是专门讨论RM的,第二个才是哦。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
260
在线时间
3 小时
注册时间
2012-1-6
帖子
3
3
 楼主| 发表于 2012-3-22 16:59:43 | 只看该作者
寂静的夜里 发表于 2012-3-22 16:52
1搜索人物跟随
2显示文字时播放bgm

详细一点可以么?
回复

使用道具 举报

Lv3.寻梦者

灌水局大小姐

梦石
0
星屑
3810
在线时间
1690 小时
注册时间
2012-3-10
帖子
2469
4
发表于 2012-3-23 22:52:26 | 只看该作者
是NPC跟随人物?还是队友跟随?

如果是NPC跟随的话,这好办!
看图:
将事件人物的移动规则设置为“自定义”!
然后:

知道了吧 哈哈!很简单吧!其实你也想到了吧!




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

回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
312 小时
注册时间
2011-6-27
帖子
1316
5
发表于 2012-3-23 23:33:39 | 只看该作者

人物跟随就用跟随脚本,如下:
  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 = 4
  18. #举例:第一个为true,第二个为20,则打开20号开关,后面的人都没了。

  19. #跟随人数的最大数目,可以更改为2、3什么的。
  20. TRAIN_ACTOR_SIZE_MAX = 4





  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.   
  223.   def return_char(i)
  224.     return @characters[i]
  225.   end
  226.   
  227. def set_transparent_actors(transparent)
  228. @transparent = transparent
  229. end
  230. def setup_actor_character_sprites
  231. if @characters == nil
  232. @characters = []
  233. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  234. @characters.push(Game_Party_Actor.new)
  235. end
  236. end
  237. for i in 1 ... TRAIN_ACTOR_SIZE_MAX
  238. @characters[i - 1].setup(actors[i])
  239. end
  240. if $scene.class.method_defined?('setup_actor_character_sprites')
  241. $scene.setup_actor_character_sprites(@characters)
  242. end
  243. end
  244. def update_party_actors
  245. setup_actor_character_sprites
  246. transparent = $game_player.transparent
  247. if transparent == false
  248. if TRANSPARENT_SWITCH
  249. transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
  250. end
  251. end
  252. for character in @characters
  253. character.transparent = transparent
  254. character.move_speed = $game_player.move_speed
  255. character.step_anime = $game_player.step_anime
  256. character.update
  257. end
  258. end
  259. def moveto_party_actors( x, y )
  260. setup_actor_character_sprites
  261. for character in @characters
  262. character.moveto( x, y )
  263. end
  264. if @move_list == nil
  265. @move_list = []
  266. end
  267. move_list_setup
  268. end
  269. def move_party_actors
  270. if @move_list == nil
  271. @move_list = []
  272. move_list_setup
  273. end
  274. @move_list.each_index do |i|
  275. if @characters[i] != nil
  276. case @move_list[i].type
  277. when Input::DOWN
  278. @characters[i].move_down(@move_list[i].args[0])
  279. when Input::LEFT
  280. @characters[i].move_left(@move_list[i].args[0])
  281. when Input::RIGHT
  282. @characters[i].move_right(@move_list[i].args[0])
  283. when Input::UP
  284. @characters[i].move_up(@move_list[i].args[0])
  285. when DOWN_LEFT
  286. @characters[i].move_lower_left
  287. when DOWN_RIGHT
  288. @characters[i].move_lower_right
  289. when UP_LEFT
  290. @characters[i].move_upper_left
  291. when UP_RIGHT
  292. @characters[i].move_upper_right
  293. when JUMP
  294. @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
  295. end
  296. end
  297. end
  298. end
  299. class Move_List_Element
  300. def initialize(type,args)
  301. @type = type
  302. @args = args
  303. end
  304. def type() return @type end
  305. def args() return @args end
  306. end
  307. def move_list_setup
  308. for i in 0 .. TRAIN_ACTOR_SIZE_MAX
  309. @move_list[i] = nil
  310. end
  311. end
  312. def add_move_list(type,*args)
  313. @move_list.unshift(Move_List_Element.new(type,args)).pop
  314. end
  315. def move_down_party_actors(turn_enabled = true)
  316. move_party_actors
  317. add_move_list(Input::DOWN,turn_enabled)
  318. end
  319. def move_left_party_actors(turn_enabled = true)
  320. move_party_actors
  321. add_move_list(Input::LEFT,turn_enabled)
  322. end
  323. def move_right_party_actors(turn_enabled = true)
  324. move_party_actors
  325. add_move_list(Input::RIGHT,turn_enabled)
  326. end
  327. def move_up_party_actors(turn_enabled = true)
  328. move_party_actors
  329. add_move_list(Input::UP,turn_enabled)
  330. end
  331. def move_lower_left_party_actors
  332. move_party_actors
  333. add_move_list(DOWN_LEFT)
  334. end
  335. def move_lower_right_party_actors
  336. move_party_actors
  337. add_move_list(DOWN_RIGHT)
  338. end
  339. def move_upper_left_party_actors
  340. move_party_actors
  341. add_move_list(UP_LEFT)
  342. end
  343. def move_upper_right_party_actors
  344. move_party_actors
  345. add_move_list(UP_RIGHT)
  346. end
  347. def jump_party_actors(x_plus, y_plus)
  348. move_party_actors
  349. add_move_list(JUMP,x_plus, y_plus)
  350. end
  351. end
  352. module Game_Player_Module
  353. def update
  354. $game_party.update_party_actors
  355. super
  356. end
  357. def moveto( x, y )
  358. $game_party.moveto_party_actors( x, y )
  359. super( x, y )
  360. end
  361. def move_down(turn_enabled = true)
  362. if passable?(@x, @y, Input::DOWN)
  363. $game_party.move_down_party_actors(turn_enabled)
  364. end
  365. super(turn_enabled)
  366. end
  367. def move_left(turn_enabled = true)
  368. if passable?(@x, @y, Input::LEFT)
  369. $game_party.move_left_party_actors(turn_enabled)
  370. end
  371. super(turn_enabled)
  372. end
  373. def move_right(turn_enabled = true)
  374. if passable?(@x, @y, Input::RIGHT)
  375. $game_party.move_right_party_actors(turn_enabled)
  376. end
  377. super(turn_enabled)
  378. end
  379. def move_up(turn_enabled = true)
  380. if passable?(@x, @y, Input::UP)
  381. $game_party.move_up_party_actors(turn_enabled)
  382. end
  383. super(turn_enabled)
  384. end
  385. def move_lower_left
  386. # 下→左、左→下 のどちらかのコースが通行可能な場合
  387. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
  388. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
  389. $game_party.move_lower_left_party_actors
  390. end
  391. super
  392. end
  393. def move_lower_right
  394. # 下→右、右→下 のどちらかのコースが通行可能な場合
  395. if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
  396. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
  397. $game_party.move_lower_right_party_actors
  398. end
  399. super
  400. end
  401. def move_upper_left
  402. # 上→左、左→上 のどちらかのコースが通行可能な場合
  403. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
  404. (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
  405. $game_party.move_upper_left_party_actors
  406. end
  407. super
  408. end
  409. def move_upper_right
  410. # 上→右、右→上 のどちらかのコースが通行可能な場合
  411. if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
  412. (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
  413. $game_party.move_upper_right_party_actors
  414. end
  415. super
  416. end
  417. def jump(x_plus, y_plus)
  418. # 新しい座標を計算
  419. new_x = @x + x_plus
  420. new_y = @y + y_plus
  421. # 加算値が (0,0) の場合か、ジャンプ先が通行可能な場合
  422. if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  423. $game_party.jump_party_actors(x_plus, y_plus)
  424. end
  425. super(x_plus, y_plus)
  426. end
  427. attr_reader :move_speed
  428. attr_reader :step_anime
  429. end
  430. end # module Train_Actor
  431. class Game_Party
  432. include Train_Actor::Game_Party_Module
  433. end
  434. class Game_Player
  435. include Train_Actor::Game_Player_Module
  436. end
  437. class Spriteset_Map
  438. include Train_Actor::Spriteset_Map_Module
  439. end
  440. class Scene_Map
  441. include Train_Actor::Scene_Map_Module
  442. end

  443. #==============================================================================
  444. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  445. #==============================================================================
复制代码
要使用声音就使用66加强对话框Fuki对话框整合+附送功能这个脚本

评分

参与人数 1星屑 +200 梦石 +2 收起 理由
「旅」 + 200 + 2 认可答案,恭喜你获得由66RPG提供的精美好.

查看全部评分

回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
64
在线时间
294 小时
注册时间
2011-7-31
帖子
687
6
发表于 2012-3-24 14:15:57 | 只看该作者
声音自己录下来= =然后变音……这样文件会很大,最好不要用
如果繁华被摧毁,让我好好地睡.....
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
260
在线时间
3 小时
注册时间
2012-1-6
帖子
3
7
 楼主| 发表于 2012-3-25 11:37:33 | 只看该作者
人物跟随我已经动了,不知道第二个问题谁会?
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3764
在线时间
2260 小时
注册时间
2008-1-28
帖子
3193

开拓者

8
发表于 2012-3-25 22:06:49 | 只看该作者
本帖最后由 飞3a 于 2012-3-25 22:08 编辑

第二个问题- -~
先找个软件把自己的声音录进去存成wma格式,然后对话出来的时候演奏bgm/bgs,对话结束了淡出bgm/bgs
如果用了bgm,背景音乐就不用了,用了bgs,音效就不能用了(可以把音乐音效放在一个文件夹里解决这个问题)
难点:1控制好播放的时间(没控制好的话就会变成一段话重复演奏)
2:强大的配音演员整容- -(除非你想恶搞或者特别有才一个人弄n个声音或者找个音频软件变声)
[pmshow=23,31925]阿柏蛇[/pmshow]
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 16:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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