Project1

标题: 给个45D战斗模式 [打印本页]

作者: E狂人    时间: 2009-10-24 09:58
提示: 作者被禁止或删除 内容自动屏蔽
作者: 悠悠炸弹    时间: 2009-10-24 10:08
我说,其实那有什么45D横D什么的.
其实动是动了坐标而已= =
仅供参考,坐标自己在Game_Actor调
  1. #--------------------------------------------------------------------------
  2.   # ● 取得战斗画面的 X 坐标
  3.   #--------------------------------------------------------------------------
  4.   def screen_x
  5.     case self.index
  6.     when 0
  7.       return 450
  8.     when 1
  9.       return 480
  10.     when 2
  11.       return 510
  12.     when 3
  13.       return 540
  14.     else
  15.       return 640
  16.     end
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 取得战斗画面的 Y 坐标
  20.   #--------------------------------------------------------------------------
  21.   def screen_y
  22.     case self.index
  23.     when 0
  24.       return 290
  25.     when 1
  26.       return 310
  27.     when 2
  28.       return 330
  29.     when 3
  30.       return 350
  31.     else
  32.       return 1000
  33.     end
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 取得战斗画面的 Z 坐标
  37.   #--------------------------------------------------------------------------
  38.   def screen_z
  39.     # 返回计算后的队伍 Z 坐标的排列顺序
  40.     case self.index
  41.     when 0
  42.       return 1
  43.     when 1
  44.       return 2
  45.     when 2
  46.       return 3
  47.     when 3
  48.       return 4
  49.     else
  50.       return 0
  51.     end
  52.   end
  53. end

复制代码

作者: 凡人1997    时间: 2009-10-24 10:10
提示: 作者被禁止或删除 内容自动屏蔽
作者: E狂人    时间: 2009-10-24 10:37
提示: 作者被禁止或删除 内容自动屏蔽
作者: 凡人1997    时间: 2009-10-24 10:40
提示: 作者被禁止或删除 内容自动屏蔽
作者: 悠悠炸弹    时间: 2009-10-24 10:42
我给出的是人物的坐标点
3L已经给出最完美的答案了
45D本来就只是坐标问题而已.窗口人什么的完全可以自己调
LZ你还想要什么.
作者: E狂人    时间: 2009-10-24 10:57
提示: 作者被禁止或删除 内容自动屏蔽
作者: 悠悠炸弹    时间: 2009-10-24 11:03
本帖最后由 悠悠炸弹 于 2009-10-24 11:05 编辑

我总算明白了...............
结论:  LZ没去看教程............
敌人的位置是在数据库里调的= =

至于没有人物,估计是你根本就没把人物战斗图导入..............
所以...............

作者: E狂人    时间: 2009-10-24 11:14
提示: 作者被禁止或删除 内容自动屏蔽
作者: 悠悠炸弹    时间: 2009-10-24 11:18
本帖最后由 悠悠炸弹 于 2009-10-24 13:34 编辑

我晕死- -
你不会想到换一张大点的战斗背景吗= =
依然在数据库
图块里调
漏了点
在Spriteset_Battle里把19行改成
@viewport1 = Viewport.new(0, 0, 640, 480)
106行
@battleback_sprite.src_rect.set(0, 0, 640,480)
作者: 夏季冰川    时间: 2009-10-24 13:28
换张640*480的背景图片不就好了.
作者: enter9009    时间: 2009-10-24 15:31
请楼主认真看完教程再来发问。。。
作者: 凌辰    时间: 2009-10-24 18:10
楼主去下载个FlashFTP,然后进入http://rpg.blue/viewthread.php?tid=128518找到6R的FTP地址,再用FlashFXP登录,用户名为6rohter,密码自己看那个帖子里有,位置没记错的话是在教程-录像-零散录像,里面有自制横版或45度战斗的录像教程。
作者: 传说中di    时间: 2009-10-24 19:25
  1. #估计是战斗背景的问题,战斗背景是640X320所以把框去掉后会变成黑色~
  2. #解决方法:
  3. #在脚本:
  4. #spriteset_battle里把19行左右

  5. #@battleback_sprite.src_rect.set(0, 0, 640, 320)

  6. #和106行左右的

  7. #@viewport1 = Viewport.new(0, 0, 640, 320)

  8. #里的320改成480;然后换上一张大小为
  9. #640X480的战斗背景应该就可以了~


  10. # ————————————————————————————————————
  11. # 本脚本来自www.66rpg.com,转载请保留此信息
  12. # ————————————————————————————————————

  13. #==============================================================================
  14. # ■ Game_Actor
  15. #------------------------------------------------------------------------------
  16. #  处理角色的类。本类在 Game_Actors 类 ($game_actors)
  17. # 的内部使用、Game_Party 类请参考 ($game_party) 。
  18. #==============================================================================

  19. class Game_Actor < Game_Battler
  20. #--------------------------------------------------------------------------
  21. # ● 取得战斗画面的 X 坐标
  22. #--------------------------------------------------------------------------
  23. def screen_x
  24. case self.index
  25. when 0
  26.    return 350
  27. when 1
  28.    return 430
  29. when 2
  30.    return 510
  31. when 3
  32.    return 580
  33. else
  34.    return 600

  35.   end
  36. end
  37. #--------------------------------------------------------------------------
  38. # ● 取得战斗画面的 Y 坐标
  39. #--------------------------------------------------------------------------
  40. def screen_y
  41. case self.index
  42. when 0
  43.    return 430
  44. when 1
  45.    return 395
  46. when 2
  47.    return 360
  48. when 3
  49.    return 325
  50. else
  51.    return 1000
  52.   end
  53. end
  54. #--------------------------------------------------------------------------
  55. # ● 取得战斗画面的 Z 坐标
  56. #--------------------------------------------------------------------------
  57. def screen_z
  58. case self.index
  59. when 0
  60.    return 10
  61. when 1
  62.    return 9
  63. when 2
  64.    return 8
  65. when 3
  66.    return 7
  67. else
  68.    return 0
  69.    end
  70. end
  71. end


  72. #==============================================================================
  73. # ■ Window_Base
  74. #------------------------------------------------------------------------------
  75. #  游戏中全部窗口的超级类。
  76. #==============================================================================

  77. class Window_Base < Window
  78. #--------------------------------------------------------------------------
  79. # ● 描绘 HP
  80. #     actor : 角色
  81. #     x     : 描画目标 X 坐标
  82. #     y     : 描画目标 Y 坐标
  83. #     width : 描画目标的宽
  84. #--------------------------------------------------------------------------
  85. def draw_actor_hp1(actor, x, y, width = 72)
  86.    # 描绘字符串 "HP"
  87.    self.contents.font.color = system_color
  88.    self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
  89.    # 计算描绘 MaxHP 所需的空间
  90.    if width - 24 >= 32
  91.      hp_x = x + 32# + width - 24
  92.    end
  93.    # 描绘 HP
  94.    self.contents.font.color = actor.hp == 0 ? knockout_color :
  95.      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  96.    self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
  97. end
  98. #--------------------------------------------------------------------------
  99. # ● 描绘 SP
  100. #     actor : 角色
  101. #     x     : 描画目标 X 坐标
  102. #     y     : 描画目标 Y 坐标
  103. #     width : 描画目标的宽
  104. #--------------------------------------------------------------------------
  105. def draw_actor_sp1(actor, x, y, width = 72)
  106.    # 描绘字符串 "SP"
  107.    self.contents.font.color = system_color
  108.    self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
  109.    # 计算描绘 MaxSP 所需的空间
  110.    if width - 24 >= 32
  111.      sp_x = x + 32# + width - 24
  112.    end
  113.    # 描绘 SP
  114.    self.contents.font.color = actor.sp == 0 ? knockout_color :
  115.      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  116.    self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
  117. end
  118. end





  119. #==============================================================================
  120. # ■ Window_BattleStatus
  121. #------------------------------------------------------------------------------
  122. #  显示战斗画面同伴状态的窗口。
  123. #==============================================================================

  124. class Window_BattleStatus < Window_Base
  125. #--------------------------------------------------------------------------
  126. # ● 初始化对像
  127. #--------------------------------------------------------------------------
  128. #$data_system_level_up_me = "Audio/ME/升级音乐"
  129. def initialize
  130.    super(0, 0, 640, 480)
  131.    self.contents = Bitmap.new(width - 10, height - 32)
  132.    self.opacity = 0
  133.    @level_up_flags = [false, false, false, false]
  134.    refresh
  135. end
  136. #--------------------------------------------------------------------------
  137. # ● 释放
  138. #--------------------------------------------------------------------------
  139. def dispose
  140.    super
  141. end
  142. #--------------------------------------------------------------------------
  143. # ● 设置升级标志
  144. #     actor_index : 角色索引
  145. #--------------------------------------------------------------------------
  146. def level_up(actor_index)
  147.    @level_up_flags[actor_index] = true
  148. end
  149. #--------------------------------------------------------------------------
  150. # ● 刷新
  151. #--------------------------------------------------------------------------
  152. def refresh
  153.    self.contents.clear
  154.    @item_max = $game_party.actors.size
  155.     for i in 0...$game_party.actors.size
  156.      actor = $game_party.actors[i]
  157.      case i
  158.        when 0
  159.         x = 310
  160.         y = 390
  161.        when 1
  162.         x = 390
  163.         y = 340
  164.        when 2
  165.         x = 480
  166.         y = 300
  167.        when 3
  168.         x = 550
  169.         y = 270
  170.       end
  171.      if @level_up_flags[i]
  172.        self.contents.font.color = normal_color
  173.        self.contents.draw_text(x, y, 80, 24, "LEVEL UP!")
  174.        Audio.me_stop
  175. #        Audio.me_play($data_system_level_up_me)
  176.      else
  177.      draw_actor_hp1(actor, x-15, y-15, 80)
  178.      draw_actor_sp1(actor, x-15, y+5, 80)
  179.     end
  180.    end
  181. end

  182. #--------------------------------------------------------------------------
  183.   # ● 刷新画面
  184.   #--------------------------------------------------------------------------
  185.   def update
  186.     super
  187.     # 主界面的不透明度下降
  188.     if $game_temp.battle_main_phase
  189.       self.contents_opacity -= 4 if self.contents_opacity > 191
  190.     else
  191.       self.contents_opacity += 4 if self.contents_opacity < 255
  192.     end
  193.   end
  194. end





  195. #==============================================================================
  196. # ■ Window_BattleStatus
  197. #==============================================================================
  198. class Window_BattleStatus < Window_Base
  199. #--------------------------------------------------------------------------
  200. # ● 初始化
  201. #--------------------------------------------------------------------------
  202. alias xrxs_bp2_refresh refresh
  203. def refresh
  204.    xrxs_bp2_refresh
  205.    @item_max = $game_party.actors.size
  206.     for i in 0...$game_party.actors.size
  207.      actor = $game_party.actors[i]
  208.      case i
  209.        when 0
  210.         x = 310
  211.         y = 390
  212.        when 1
  213.         x = 390
  214.         y = 340
  215.        when 2
  216.         x = 480
  217.         y = 300
  218.        when 3
  219.         x = 550
  220.         y = 270
  221.       end
  222.      draw_actor_hp_meter(actor, x, y, 50)
  223.      draw_actor_sp_meter(actor, x, y + 8, 50)
  224.    end
  225. end
  226. end
  227. #==============================================================================
  228. # ■ Window_Base
  229. #==============================================================================
  230. class Window_Base < Window
  231. #--------------------------------------------------------------------------
  232. # ● HP描画
  233. #--------------------------------------------------------------------------
  234. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  235.    if type == 1 and actor.hp == 0
  236.      return
  237.    end
  238.    self.contents.font.color = system_color
  239.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  240.    w = width * actor.hp / actor.maxhp
  241.    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  242.    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  243.    self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  244.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  245.    
  246.    end
  247. #--------------------------------------------------------------------------
  248. # ● SP描画
  249. #--------------------------------------------------------------------------
  250. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  251.    if type == 1 and actor.hp == 0
  252.      return
  253.    end
  254.    self.contents.font.color = system_color
  255.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  256.    w = width * actor.sp / actor.maxsp
  257.    self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  258.    self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  259.    self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  260.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  261. end
  262. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1