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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
139 小时
注册时间
2010-12-27
帖子
62
跳转到指定楼层
1
发表于 2012-4-26 20:27:41 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
用行走图面向上的做角色战斗图.不用显示武器怎么做.想用SideView改不知道哪里下手.

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2188 小时
注册时间
2011-6-23
帖子
1044
2
发表于 2012-4-26 20:37:30 | 只看该作者
本帖最后由 lsu666666 于 2012-4-27 01:39 编辑

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




SCRIPT 代码复制
  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.  
  20. module Jet
  21.   module Sideview
  22.  
  23.         #===========================================================================
  24.         # ENEMY OPTIONS
  25.         #===========================================================================
  26.  
  27.         # These are the attack animations for enemies when they use a regular attack.
  28.         # It follows this format: enemy_id => animation_id
  29.         ENEMY_ATK_ANIMS = {
  30.  
  31.  
  32.         }
  33.  
  34.         # This is the default enemy attack animation, used when they do not have a
  35.         # specific attack animation above.
  36.         ENEMY_ATK_ANIMS.default = 1
  37.  
  38.         # This is a list of enemies whose portraits should be flipped in battle.
  39.         FLIPPED_ENEMIES = [2, 3, 4, 5, 8, 10, 12, 13, 14, 16, 17, 18, 19]
  40.  
  41.         #===========================================================================
  42.         # ACTOR OPTIONS
  43.         #===========================================================================
  44.  
  45.         # Should the player sprite have a shadow beneath them?
  46.         PLAYER_SHADOW = true
  47.  
  48.         # These are sprite changes depending on state infliction.
  49.         # It follows this format: state_id => "sprite_appention"
  50.         # This means if the state is inflicted, the sprite will look for a graphic
  51.         # that is the same name as the character's sprite, plus the appended option.
  52.         # EX: Ralph's sprite's name is $ralph. Ralph gets knocked-out. This means
  53.         # state 1 was inflicted, and my below config for 1 was: 1 => "_dead"
  54.         # Now, his shown sprite will be $ralph_dead. If the sprite does not exist,
  55.         # no change will be made.
  56.         # The sprite index will be the same as the actor's.
  57.         STATE_SPRITES = {
  58.  
  59.         1 => "_dead",
  60.         2 => "_poison",
  61.         3 => "_blind"
  62.  
  63.         }
  64.  
  65.         #===========================================================================
  66.         # GENERAL_OPTIONS
  67.         #===========================================================================
  68.  
  69.         # This is the animation displayed when a skill is about to be used.
  70.         SKILL_ANIMATION = 43
  71.  
  72.         # This is the animation displayed when an item is about to be used.
  73.         ITEM_ANIMATION = 43
  74.  
  75.         # These are the animations played when a state is inflicted.
  76.         # It follows this format: state_id => animation_id
  77.         STATE_ANIMATIONS = {
  78.  
  79.         1 => 56,
  80.         2 => 50,
  81.         3 => 51
  82.  
  83.         }
  84.  
  85.         #===========================================================================
  86.         # FIELD OPTIONS
  87.         #===========================================================================
  88.  
  89.         # This is where the line-up begins. [x, y]. The higher the x, the further
  90.         # right and the higher the y the further down.
  91.         FIELD_POS = [275, 280]
  92.  
  93.         # This is how far down, and to the right each player is from the previous
  94.         # actor. [x, y]. Same rules as above.
  95.         FIELD_SPACING = [50, 0]
  96.  
  97.   end
  98. end
  99.  
  100. #===============================================================================
  101. # DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
  102. #===============================================================================
  103.  
  104. ($imported ||= {})[:jet] ||= {}
  105. $imported[:jet][:Sideview] = true
  106.  
  107. class Game_Character
  108.  
  109.   attr_accessor :step_anime
  110.  
  111.   %w[screen_x screen_y].each {|a|
  112.         aStr = %Q{
  113.           alias jet6372_#{a} #{a}
  114.           def #{a}(*args, &block)
  115.                 $BTEST ? 0 : jet6372_#{a}(*args, &block)
  116.           end
  117.         }
  118.         module_eval(aStr)
  119.   }
  120. end
  121.  
  122. class Game_Actor
  123.  
  124.   def animation_id=(t)
  125.         self.battle_sprite.start_animation($data_animations[t]) rescue nil
  126.   end
  127. end
  128.  
  129. class Game_Battler
  130.  
  131.   def battle_sprite
  132.         return nil unless SceneManager.scene_is?(Scene_Battle)
  133.         SceneManager.scene.spriteset.battler_sprites.each {|a|
  134.           return a if a.battler == self
  135.         }
  136.         return nil
  137.   end
  138. end
  139.  
  140. class Spriteset_Battle
  141.  
  142.   alias jet2847_create_enemies create_enemies
  143.   def create_enemies(*args, &block)
  144.         jet2847_create_enemies(*args, &block)
  145.         @enemy_sprites.each {|a|
  146.           a.mirror = Jet::Sideview::FLIPPED_ENEMIES.include?(a.battler.enemy.id)
  147.         }
  148.   end
  149.  
  150.   alias jet3835_create_actors create_actors
  151.   def create_actors(*args, &block)
  152.         jet3835_create_actors(*args, &block)
  153.         @jet_party = $game_party.members
  154.         @actor_sprites.each {|a|
  155.           a.dispose
  156.         }
  157.         @actor_sprites = []
  158.         $game_party.members.each {|a|
  159.           f = Game_Character.new
  160.           f.set_graphic(a.character_name, a.character_index)
  161.           f.step_anime = true
  162.           f.set_direction(8)
  163.           n = Sprite_Character.new(@viewport1, f)
  164.           n.jet_x = Jet::Sideview::FIELD_POS[0] + a.index * Jet::Sideview::FIELD_SPACING[0]
  165.           n.jet_y = Jet::Sideview::FIELD_POS[1] + a.index * Jet::Sideview::FIELD_SPACING[1]
  166.           n.battler = a
  167.           n.battle_sprite = true
  168.           if Jet::Sideview::PLAYER_SHADOW
  169.                 v = Sprite.new(nil)
  170.                 v.bitmap = Cache.system("Shadow")
  171.                 n.shadow_sprite = v
  172.           end
  173.           @actor_sprites.push(n)
  174.         }
  175.   end
  176.  
  177.   def update_actors
  178.         if @jet_party != $game_party.members
  179.           @actor_sprites.each {|a|
  180.                 a.dispose
  181.           }
  182.           @actor_sprites = []
  183.           create_actors
  184.         end
  185.         @actor_sprites.each {|a| a.update }
  186.   end
  187. end
  188.  
  189. class Sprite_Character
  190.  
  191.   attr_accessor :battle_sprite, :jet_x, :jet_y, :shadow_sprite, :battler
  192.  
  193.   alias jet4646_initialize initialize
  194.   def initialize(*args, &block)
  195.         @battle_sprite = false
  196.         jet4646_initialize(*args, &block)
  197.   end
  198.  
  199.   alias jet3645_update update
  200.   def update(*args, &block)
  201.         jet3645_update(*args, &block)
  202.         if @battle_sprite
  203.           @character.step_anime = [email protected]?
  204.           @character.update
  205.           self.x = @jet_x
  206.           self.y = @jet_y
  207.           if [email protected]?
  208.                 f = @battler.states.dup
  209.                 f.sort! {|a, b|
  210.                   a.priority <=> b.priority
  211.                 }.reverse!
  212.                 for i in 0...f.size
  213.                   a = Jet::Sideview::STATE_SPRITES[f[i].id]
  214.                   next if a.nil?
  215.                   b = (Cache.character(@character.character_name + a) rescue false)
  216.                   next unless b
  217.                   index = @character.character_index
  218.                   @character.set_graphic(@character.character_name + a, index)
  219.                   break
  220.                 end
  221.           end
  222.           if !@shadow_sprite.nil?
  223.                 @shadow_sprite.x = self.x - @shadow_sprite.width / 2
  224.                 @shadow_sprite.y = self.y - 28
  225.                 @shadow_sprite.visible = self.visible
  226.                 @shadow_sprite.viewport = self.viewport
  227.                 @shadow_sprite.z = self.z - 1
  228.           end
  229.         end
  230.   end
  231.  
  232.   alias jet5484_dispose dispose
  233.   def dispose(*args, &block)
  234.         @shadow_sprite.dispose if !@shadow_sprite.nil?
  235.         jet5484_dispose(*args, &block)
  236.   end
  237.  
  238.   def move_x(times, amount)
  239.         i = 0
  240.         until i == times
  241.           self.jet_y += amount
  242.           i += 1
  243.           [Graphics, SceneManager.scene.spriteset].each {|a| a.update }
  244.         end
  245.   end
  246.  
  247.   def effect?
  248.         false
  249.   end
  250. end
  251.  
  252. class Game_Enemy
  253.  
  254.   def atk_animation_id1
  255.         return Jet::Sideview::ENEMY_ATK_ANIMS[@enemy_id]
  256.   end
  257.  
  258.   def atk_animation_id2
  259.         return 0
  260.   end
  261. end
  262.  
  263. class Scene_Battle
  264.  
  265.   attr_reader :spriteset
  266.  
  267.   alias jet2711_use_item use_item
  268.   def use_item(*args, &block)
  269.         if @subject.is_a?(Game_Actor)
  270.           if [email protected]_action.guard?
  271.                 @subject.battle_sprite.move_x(11, -4)
  272.           end
  273.         end
  274.         if [email protected]_action.guard? && [email protected]_action.attack?
  275.           if @subject.current_action.item.is_a?(RPG::Item)
  276.                 n = $data_animations[Jet::Sideview::ITEM_ANIMATION]
  277.           else
  278.                 n = $data_animations[Jet::Sideview::SKILL_ANIMATION]
  279.           end
  280.           @subject.battle_sprite.start_animation(n)
  281.           wait_for_animation
  282.         end
  283.         jet2711_use_item(*args, &block)
  284.         if @subject.is_a?(Game_Actor)
  285.           if [email protected]_action.guard?
  286.                 @subject.battle_sprite.move_x(11, 4)
  287.           end
  288.         end
  289.   end
  290.  
  291.   def show_attack_animation(targets)
  292.         aid1 = @subject.atk_animation_id1
  293.         aid2 = @subject.atk_animation_id2
  294.         show_normal_animation(targets, aid1, false)
  295.         show_normal_animation(targets, aid2, true)
  296.   end
  297.  
  298.   %w[next prior].each {|a|
  299.         aStr = %Q{
  300.           alias jet3734_#{a}_command #{a}_command
  301.           def #{a}_command(*args, &block)
  302.                 f = BattleManager.actor
  303.                 f.battle_sprite.move_x(6, 4) if f.is_a?(Game_Actor)
  304.                 jet3734_#{a}_command(*args, &block)
  305.                 f = BattleManager.actor
  306.                 f.battle_sprite.move_x(6, -4) if f.is_a?(Game_Actor)
  307.           end
  308.         }
  309.         module_eval(aStr)
  310.   }
  311. end
  312.  
  313. class Game_Action
  314.  
  315.   def guard?
  316.         item == $data_skills[subject.guard_skill_id]
  317.   end
  318. end
  319.  
  320. if $imported[:jet][:BattlePopUps]
  321.   class Sprite_Character
  322.  
  323.         attr_accessor :popups
  324.  
  325.         alias jet4758_initialize initialize
  326.         def initialize(*args, &block)
  327.           @popups = []
  328.           @updating_sprites = []
  329.           @popup_wait = 0
  330.           jet4758_initialize(*args, &block)
  331.         end
  332.  
  333.         alias jet7467_update update
  334.         def update(*args, &block)
  335.           jet7467_update(*args, &block)
  336.           if @popup_wait == 0
  337.                 if [email protected]?
  338.                   @updating_sprites.push(@popups.pop)
  339.                   @popup_wait = 30
  340.                 end
  341.           else
  342.                 @popup_wait -= 1
  343.           end
  344.           @updating_sprites.each {|a|
  345.                 a.visible = true if !a.visible
  346.                 a.update
  347.                 @updating_sprites.delete(a) if a.disposed?
  348.           }
  349.         end
  350.  
  351.         alias jet5483_dispose dispose
  352.         def dispose(*args, &block)
  353.           (@updating_sprites + @popups).each {|a| a.dispose }
  354.           jet5483_dispose(*args, &block)
  355.         end
  356.  
  357.         alias jet3745_setup_new_effect setup_new_effect
  358.         def setup_new_effect(*args, &block)
  359.           jet3745_setup_new_effect(*args, &block)
  360.           do_sprite_popups
  361.         end
  362.  
  363.         def make_popup(text, color)
  364.           @popups.unshift(Sprite_JetPopup.new(text.to_s, color, self))
  365.         end
  366.  
  367.         def do_sprite_popups
  368.           return if @battler.nil?
  369.           if @battler_struct.nil?
  370.                 @battler_struct = Struct.new(:hp, :mp, :tp).new(0, 0, 0)
  371.                 @battler_struct.hp = @battler.hp
  372.                 @battler_struct.mp = @battler.mp
  373.                 @battler_struct.tp = @battler.tp
  374.           end
  375.           check_success_popup
  376.           check_hp_popup
  377.           check_mp_popup
  378.           check_tp_popup
  379.         end
  380.  
  381.         def check_success_popup
  382.           if @battler.result.success
  383.                 if @battler.result.critical
  384.                   make_popup(Jet::BattlePopUps::CRITICAL_TEXT, Jet::BattlePopUps::CRITICAL_COLOR)
  385.                 elsif @battler.result.missed
  386.                   make_popup(Jet::BattlePopUps::MISSED_TEXT, Jet::BattlePopUps::MISS_COLOR)
  387.                 elsif @battler.result.evaded
  388.                   make_popup(Jet::BattlePopUps::EVADED_TEXT, Jet::BattlePopUps::EVADE_COLOR)
  389.                 end
  390.                 @battler.result.clear_hit_flags
  391.           end
  392.         end
  393.  
  394.         def check_hp_popup
  395.           if @battler_struct.hp != @battler.hp
  396.                 f = @battler_struct.hp - @battler.hp
  397.                 if f > 0
  398.                   make_popup(Jet::BattlePopUps::HURT_TEXT + f.to_s, Jet::BattlePopUps::HURT_COLOR)
  399.                 elsif f < 0
  400.                   make_popup(Jet::BattlePopUps::HEAL_TEXT + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR)
  401.                 end
  402.                 @battler_struct.hp = @battler.hp
  403.           end
  404.         end
  405.  
  406.         def check_mp_popup
  407.           if @battler_struct.mp != @battler.mp
  408.                 f = @battler_struct.mp - @battler.mp
  409.                 if f > 0
  410.                   make_popup(Jet::BattlePopUps::HURT_TEXT_MP + f.to_s, Jet::BattlePopUps::HURT_COLOR_MP)
  411.                 elsif f < 0
  412.                   make_popup(Jet::BattlePopUps::HEAL_TEXT_MP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_MP)
  413.                 end
  414.                 @battler_struct.mp = @battler.mp
  415.           end
  416.         end
  417.  
  418.         def check_tp_popup
  419.           if @battler_struct.tp != @battler.tp
  420.                 f = (@battler_struct.tp - @battler.tp).round
  421.                 if f > 0
  422.                   make_popup(Jet::BattlePopUps::HURT_TEXT_TP + f.to_s, Jet::BattlePopUps::HURT_COLOR_TP)
  423.                 elsif f < 0
  424.                   make_popup(Jet::BattlePopUps::HEAL_TEXT_TP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_TP)
  425.                 end
  426.                 @battler_struct.tp = @battler.tp
  427.           end
  428.         end
  429.   end
  430. end







点评

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

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv4.逐梦者 (超级版主)

嗜谎者

梦石
2
星屑
16607
在线时间
3893 小时
注册时间
2010-9-12
帖子
9635

极短24评委极短23评委极短22评委极短21评委开拓者

3
发表于 2012-4-26 21:01:45 | 只看该作者
又见楼上触。。。明明是脚本帝。。。QAQ。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-3-5
帖子
228
4
发表于 2012-4-26 21:59:32 | 只看该作者
这种风格不错啊~可惜我复制了报错不能用~

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2188 小时
注册时间
2011-6-23
帖子
1044
5
发表于 2012-4-27 01:04:40 | 只看该作者
布兰度西特 发表于 2012-4-26 21:59
这种风格不错啊~可惜我复制了报错不能用~


按這裡可以複製代碼{:2_273:}
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-3-5
帖子
228
6
发表于 2012-4-27 11:07:20 | 只看该作者
lsu666666 发表于 2012-4-27 01:04
按這裡可以複製代碼

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


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

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
17 小时
注册时间
2009-1-1
帖子
73
7
发表于 2012-4-27 16:43:16 | 只看该作者
请问前辈,那个战斗背景图的黑边怎么去掉,怎样变成没有黑边的啊?请前辈赐教!谢谢!

点评

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-10 23:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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