查看: 5439|回复: 6

[已经解决] VA怎么做竖版战斗?

[复制链接]
梦石
0
星屑
50
在线时间
139 小时
注册时间
2010-12-27
回帖
52
发表于 2012-4-26 20:27:41 | 显示全部楼层 |阅读模式

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

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

×
用行走图面向上的做角色战斗图.不用显示武器怎么做.想用SideView改不知道哪里下手.
梦石
0
星屑
50
在线时间
2188 小时
注册时间
2011-6-23
回帖
1011
发表于 2012-4-26 20:37:30 | 显示全部楼层
本帖最后由 lsu666666 于 2012-4-27 01:39 编辑

不知道是不是這種的呢?
{:2_273:}要调整人物的座标需要自行修改对应的X座标 , Y座标的值!!
1. Data.rar (207.76 KB, 下载次数: 312)   可以直接下载这个复制到工程
2. Walking Figure battle.rar (3.38 KB, 下载次数: 178)   也可以下载这个原代码文件(没做过变更的)
3.或是直接複製代碼框的代碼 (如果复制代码框出错的 ,可以尝试下载第二个源代码文件没做过修改的)
1.JPG



  1. #===============================================================================
  2. # Side-View Battle System(Patch Behind)
  3. # By Jet10985 (Jet)
  4. #===============================================================================
  5. # This script will allow you to have battle where all the actor's sprites are
  6. # display on the behind of the characters.
  7. # This script has: 10 customization options.
  8. #===============================================================================
  9. # Overwritten Methods:
  10. # Scene_Battle: show_attack_animation
  11. # Spriteset_Battle: update_actors
  12. #-------------------------------------------------------------------------------
  13. # Aliased methods:
  14. # Spriteset_Battle: create_actors, create_enemies
  15. # Sprite_Character: initialize, update, dispose, start_new_effect
  16. # Scene_Battle: use_item, next_command, prior_command
  17. # Game_Character: screen_x, screen_y
  18. #===============================================================================

  19. module Jet
  20.   module Sideview

  21.         #===========================================================================
  22.         # ENEMY OPTIONS
  23.         #===========================================================================

  24.         # These are the attack animations for enemies when they use a regular attack.
  25.         # It follows this format: enemy_id => animation_id
  26.         ENEMY_ATK_ANIMS = {


  27.         }

  28.         # This is the default enemy attack animation, used when they do not have a
  29.         # specific attack animation above.
  30.         ENEMY_ATK_ANIMS.default = 1

  31.         # This is a list of enemies whose portraits should be flipped in battle.
  32.         FLIPPED_ENEMIES = [2, 3, 4, 5, 8, 10, 12, 13, 14, 16, 17, 18, 19]

  33.         #===========================================================================
  34.         # ACTOR OPTIONS
  35.         #===========================================================================

  36.         # Should the player sprite have a shadow beneath them?
  37.         PLAYER_SHADOW = true

  38.         # These are sprite changes depending on state infliction.
  39.         # It follows this format: state_id => "sprite_appention"
  40.         # This means if the state is inflicted, the sprite will look for a graphic
  41.         # that is the same name as the character's sprite, plus the appended option.
  42.         # EX: Ralph's sprite's name is $ralph. Ralph gets knocked-out. This means
  43.         # state 1 was inflicted, and my below config for 1 was: 1 => "_dead"
  44.         # Now, his shown sprite will be $ralph_dead. If the sprite does not exist,
  45.         # no change will be made.
  46.         # The sprite index will be the same as the actor's.
  47.         STATE_SPRITES = {

  48.         1 => "_dead",
  49.         2 => "_poison",
  50.         3 => "_blind"

  51.         }

  52.         #===========================================================================
  53.         # GENERAL_OPTIONS
  54.         #===========================================================================

  55.         # This is the animation displayed when a skill is about to be used.
  56.         SKILL_ANIMATION = 43

  57.         # This is the animation displayed when an item is about to be used.
  58.         ITEM_ANIMATION = 43

  59.         # These are the animations played when a state is inflicted.
  60.         # It follows this format: state_id => animation_id
  61.         STATE_ANIMATIONS = {

  62.         1 => 56,
  63.         2 => 50,
  64.         3 => 51

  65.         }

  66.         #===========================================================================
  67.         # FIELD OPTIONS
  68.         #===========================================================================

  69.         # This is where the line-up begins. [x, y]. The higher the x, the further
  70.         # right and the higher the y the further down.
  71.         FIELD_POS = [275, 280]

  72.         # This is how far down, and to the right each player is from the previous
  73.         # actor. [x, y]. Same rules as above.
  74.         FIELD_SPACING = [50, 0]

  75.   end
  76. end

  77. #===============================================================================
  78. # DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
  79. #===============================================================================

  80. ($imported ||= {})[:jet] ||= {}
  81. $imported[:jet][:Sideview] = true

  82. class Game_Character

  83.   attr_accessor :step_anime

  84.   %w[screen_x screen_y].each {|a|
  85.         aStr = %Q{
  86.           alias jet6372_#{a} #{a}
  87.           def #{a}(*args, &block)
  88.                 $BTEST ? 0 : jet6372_#{a}(*args, &block)
  89.           end
  90.         }
  91.         module_eval(aStr)
  92.   }
  93. end

  94. class Game_Actor

  95.   def animation_id=(t)
  96.         self.battle_sprite.start_animation($data_animations[t]) rescue nil
  97.   end
  98. end

  99. class Game_Battler

  100.   def battle_sprite
  101.         return nil unless SceneManager.scene_is?(Scene_Battle)
  102.         SceneManager.scene.spriteset.battler_sprites.each {|a|
  103.           return a if a.battler == self
  104.         }
  105.         return nil
  106.   end
  107. end

  108. class Spriteset_Battle

  109.   alias jet2847_create_enemies create_enemies
  110.   def create_enemies(*args, &block)
  111.         jet2847_create_enemies(*args, &block)
  112.         @enemy_sprites.each {|a|
  113.           a.mirror = Jet::Sideview::FLIPPED_ENEMIES.include?(a.battler.enemy.id)
  114.         }
  115.   end

  116.   alias jet3835_create_actors create_actors
  117.   def create_actors(*args, &block)
  118.         jet3835_create_actors(*args, &block)
  119.         @jet_party = $game_party.members
  120.         @actor_sprites.each {|a|
  121.           a.dispose
  122.         }
  123.         @actor_sprites = []
  124.         $game_party.members.each {|a|
  125.           f = Game_Character.new
  126.           f.set_graphic(a.character_name, a.character_index)
  127.           f.step_anime = true
  128.           f.set_direction(8)
  129.           n = Sprite_Character.new(@viewport1, f)
  130.           n.jet_x = Jet::Sideview::FIELD_POS[0] + a.index * Jet::Sideview::FIELD_SPACING[0]
  131.           n.jet_y = Jet::Sideview::FIELD_POS[1] + a.index * Jet::Sideview::FIELD_SPACING[1]
  132.           n.battler = a
  133.           n.battle_sprite = true
  134.           if Jet::Sideview::PLAYER_SHADOW
  135.                 v = Sprite.new(nil)
  136.                 v.bitmap = Cache.system("Shadow")
  137.                 n.shadow_sprite = v
  138.           end
  139.           @actor_sprites.push(n)
  140.         }
  141.   end

  142.   def update_actors
  143.         if @jet_party != $game_party.members
  144.           @actor_sprites.each {|a|
  145.                 a.dispose
  146.           }
  147.           @actor_sprites = []
  148.           create_actors
  149.         end
  150.         @actor_sprites.each {|a| a.update }
  151.   end
  152. end

  153. class Sprite_Character

  154.   attr_accessor :battle_sprite, :jet_x, :jet_y, :shadow_sprite, :battler

  155.   alias jet4646_initialize initialize
  156.   def initialize(*args, &block)
  157.         @battle_sprite = false
  158.         jet4646_initialize(*args, &block)
  159.   end

  160.   alias jet3645_update update
  161.   def update(*args, &block)
  162.         jet3645_update(*args, &block)
  163.         if @battle_sprite
  164.           @character.step_anime = !@battler.dead?
  165.           @character.update
  166.           self.x = @jet_x
  167.           self.y = @jet_y
  168.           if !@battler.nil?
  169.                 f = @battler.states.dup
  170.                 f.sort! {|a, b|
  171.                   a.priority <=> b.priority
  172.                 }.reverse!
  173.                 for i in 0...f.size
  174.                   a = Jet::Sideview::STATE_SPRITES[f[i].id]
  175.                   next if a.nil?
  176.                   b = (Cache.character(@character.character_name + a) rescue false)
  177.                   next unless b
  178.                   index = @character.character_index
  179.                   @character.set_graphic(@character.character_name + a, index)
  180.                   break
  181.                 end
  182.           end
  183.           if !@shadow_sprite.nil?
  184.                 @shadow_sprite.x = self.x - @shadow_sprite.width / 2
  185.                 @shadow_sprite.y = self.y - 28
  186.                 @shadow_sprite.visible = self.visible
  187.                 @shadow_sprite.viewport = self.viewport
  188.                 @shadow_sprite.z = self.z - 1
  189.           end
  190.         end
  191.   end

  192.   alias jet5484_dispose dispose
  193.   def dispose(*args, &block)
  194.         @shadow_sprite.dispose if !@shadow_sprite.nil?
  195.         jet5484_dispose(*args, &block)
  196.   end

  197.   def move_x(times, amount)
  198.         i = 0
  199.         until i == times
  200.           self.jet_y += amount
  201.           i += 1
  202.           [Graphics, SceneManager.scene.spriteset].each {|a| a.update }
  203.         end
  204.   end

  205.   def effect?
  206.         false
  207.   end
  208. end

  209. class Game_Enemy

  210.   def atk_animation_id1
  211.         return Jet::Sideview::ENEMY_ATK_ANIMS[@enemy_id]
  212.   end

  213.   def atk_animation_id2
  214.         return 0
  215.   end
  216. end

  217. class Scene_Battle

  218.   attr_reader :spriteset

  219.   alias jet2711_use_item use_item
  220.   def use_item(*args, &block)
  221.         if @subject.is_a?(Game_Actor)
  222.           if !@subject.current_action.guard?
  223.                 @subject.battle_sprite.move_x(11, -4)
  224.           end
  225.         end
  226.         if !@subject.current_action.guard? && !@subject.current_action.attack?
  227.           if @subject.current_action.item.is_a?(RPG::Item)
  228.                 n = $data_animations[Jet::Sideview::ITEM_ANIMATION]
  229.           else
  230.                 n = $data_animations[Jet::Sideview::SKILL_ANIMATION]
  231.           end
  232.           @subject.battle_sprite.start_animation(n)
  233.           wait_for_animation
  234.         end
  235.         jet2711_use_item(*args, &block)
  236.         if @subject.is_a?(Game_Actor)
  237.           if !@subject.current_action.guard?
  238.                 @subject.battle_sprite.move_x(11, 4)
  239.           end
  240.         end
  241.   end

  242.   def show_attack_animation(targets)
  243.         aid1 = @subject.atk_animation_id1
  244.         aid2 = @subject.atk_animation_id2
  245.         show_normal_animation(targets, aid1, false)
  246.         show_normal_animation(targets, aid2, true)
  247.   end

  248.   %w[next prior].each {|a|
  249.         aStr = %Q{
  250.           alias jet3734_#{a}_command #{a}_command
  251.           def #{a}_command(*args, &block)
  252.                 f = BattleManager.actor
  253.                 f.battle_sprite.move_x(6, 4) if f.is_a?(Game_Actor)
  254.                 jet3734_#{a}_command(*args, &block)
  255.                 f = BattleManager.actor
  256.                 f.battle_sprite.move_x(6, -4) if f.is_a?(Game_Actor)
  257.           end
  258.         }
  259.         module_eval(aStr)
  260.   }
  261. end

  262. class Game_Action

  263.   def guard?
  264.         item == $data_skills[subject.guard_skill_id]
  265.   end
  266. end

  267. if $imported[:jet][:BattlePopUps]
  268.   class Sprite_Character

  269.         attr_accessor :popups

  270.         alias jet4758_initialize initialize
  271.         def initialize(*args, &block)
  272.           @popups = []
  273.           @updating_sprites = []
  274.           @popup_wait = 0
  275.           jet4758_initialize(*args, &block)
  276.         end

  277.         alias jet7467_update update
  278.         def update(*args, &block)
  279.           jet7467_update(*args, &block)
  280.           if @popup_wait == 0
  281.                 if !@popups.empty?
  282.                   @updating_sprites.push(@popups.pop)
  283.                   @popup_wait = 30
  284.                 end
  285.           else
  286.                 @popup_wait -= 1
  287.           end
  288.           @updating_sprites.each {|a|
  289.                 a.visible = true if !a.visible
  290.                 a.update
  291.                 @updating_sprites.delete(a) if a.disposed?
  292.           }
  293.         end

  294.         alias jet5483_dispose dispose
  295.         def dispose(*args, &block)
  296.           (@updating_sprites + @popups).each {|a| a.dispose }
  297.           jet5483_dispose(*args, &block)
  298.         end

  299.         alias jet3745_setup_new_effect setup_new_effect
  300.         def setup_new_effect(*args, &block)
  301.           jet3745_setup_new_effect(*args, &block)
  302.           do_sprite_popups
  303.         end

  304.         def make_popup(text, color)
  305.           @popups.unshift(Sprite_JetPopup.new(text.to_s, color, self))
  306.         end

  307.         def do_sprite_popups
  308.           return if @battler.nil?
  309.           if @battler_struct.nil?
  310.                 @battler_struct = Struct.new(:hp, :mp, :tp).new(0, 0, 0)
  311.                 @battler_struct.hp = @battler.hp
  312.                 @battler_struct.mp = @battler.mp
  313.                 @battler_struct.tp = @battler.tp
  314.           end
  315.           check_success_popup
  316.           check_hp_popup
  317.           check_mp_popup
  318.           check_tp_popup
  319.         end

  320.         def check_success_popup
  321.           if @battler.result.success
  322.                 if @battler.result.critical
  323.                   make_popup(Jet::BattlePopUps::CRITICAL_TEXT, Jet::BattlePopUps::CRITICAL_COLOR)
  324.                 elsif @battler.result.missed
  325.                   make_popup(Jet::BattlePopUps::MISSED_TEXT, Jet::BattlePopUps::MISS_COLOR)
  326.                 elsif @battler.result.evaded
  327.                   make_popup(Jet::BattlePopUps::EVADED_TEXT, Jet::BattlePopUps::EVADE_COLOR)
  328.                 end
  329.                 @battler.result.clear_hit_flags
  330.           end
  331.         end

  332.         def check_hp_popup
  333.           if @battler_struct.hp != @battler.hp
  334.                 f = @battler_struct.hp - @battler.hp
  335.                 if f > 0
  336.                   make_popup(Jet::BattlePopUps::HURT_TEXT + f.to_s, Jet::BattlePopUps::HURT_COLOR)
  337.                 elsif f < 0
  338.                   make_popup(Jet::BattlePopUps::HEAL_TEXT + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR)
  339.                 end
  340.                 @battler_struct.hp = @battler.hp
  341.           end
  342.         end

  343.         def check_mp_popup
  344.           if @battler_struct.mp != @battler.mp
  345.                 f = @battler_struct.mp - @battler.mp
  346.                 if f > 0
  347.                   make_popup(Jet::BattlePopUps::HURT_TEXT_MP + f.to_s, Jet::BattlePopUps::HURT_COLOR_MP)
  348.                 elsif f < 0
  349.                   make_popup(Jet::BattlePopUps::HEAL_TEXT_MP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_MP)
  350.                 end
  351.                 @battler_struct.mp = @battler.mp
  352.           end
  353.         end

  354.         def check_tp_popup
  355.           if @battler_struct.tp != @battler.tp
  356.                 f = (@battler_struct.tp - @battler.tp).round
  357.                 if f > 0
  358.                   make_popup(Jet::BattlePopUps::HURT_TEXT_TP + f.to_s, Jet::BattlePopUps::HURT_COLOR_TP)
  359.                 elsif f < 0
  360.                   make_popup(Jet::BattlePopUps::HEAL_TEXT_TP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_TP)
  361.                 end
  362.                 @battler_struct.tp = @battler.tp
  363.           end
  364.         end
  365.   end
  366. end
复制代码







点评

是地.但脚本不能复制怎么办??还是要谢谢你了.来小妞捏下脸摸摸头乖~  发表于 2012-4-26 21:10

评分

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

查看全部评分

回复

使用道具 举报

嗜谎者

梦石
4
星屑
19382
在线时间
4015 小时
注册时间
2010-9-12
回帖
9252

超评测评委极短28评委极短27评委MZ评测员极短26评委极短25评委极短24评委极短23评委极短22评委极短21评委开拓者

发表于 2012-4-26 21:01:45 | 显示全部楼层
又见楼上触。。。明明是脚本帝。。。QAQ。。。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-3-5
回帖
206
发表于 2012-4-26 21:59:32 | 显示全部楼层
这种风格不错啊~可惜我复制了报错不能用~

点评

正常是不會報錯 那就是跟其他腳本衝突的說  发表于 2012-4-27 01:05
回复

使用道具 举报

梦石
0
星屑
50
在线时间
2188 小时
注册时间
2011-6-23
回帖
1011
发表于 2012-4-27 01:04:40 | 显示全部楼层
布兰度西特 发表于 2012-4-26 21:59
这种风格不错啊~可惜我复制了报错不能用~


按這裡可以複製代碼{:2_273:}
1.JPG
回复

使用道具 举报

梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-3-5
回帖
206
发表于 2012-4-27 11:07:20 | 显示全部楼层
lsu666666 发表于 2012-4-27 01:04
按這裡可以複製代碼

下载了工程,可以使用。不知道修改人物的坐标是哪个指令呢?我是英文盲~


‘‘──布兰度西特于2012-4-27 13:18补充以下内容

这个脚本人物在使用技能的时候会先有一个默认技能动画结束后才会放出技能,要怎么关闭呢?谢谢。
’’
回复

使用道具 举报

梦石
0
星屑
50
在线时间
17 小时
注册时间
2009-1-1
回帖
42
发表于 2012-4-27 16:43:16 | 显示全部楼层
请问前辈,那个战斗背景图的黑边怎么去掉,怎样变成没有黑边的啊?请前辈赐教!谢谢!

点评

把戰鬥背景放大至你工程的解析度  发表于 2012-5-2 16:17
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部