Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Sideview Battle System Tankentai XP - Version 2.2xp

Status
Not open for further replies.

Atoa

Member

No idea.
My first priority now is the ACBS.
So only after i relase the ACBS full (or at last ACBS RC1 xD) i will work on the Tankentai again.
 
Atoa":cqlrtdjk said:
No idea.
My first priority now is the ACBS.
So only after i relase the ACBS full (or at last ACBS RC1 xD) i will work on the Tankentai again.


thank you for your reply Atao.
Well i must worth even less than a brainless monkey then, i guess, but i have been unable to extract only
the 2 hands - dual weapon add-on from the AAS and use it alone in a new script.

i will wait for your work, thank you.
 

Atoa

Member

mageone":3qsrbw5w said:
thank you for your reply Atao.
Well i must worth even less than a brainless monkey then, i guess, but i have been unable to extract only
the 2 hands - dual weapon add-on from the AAS and use it alone in a new script.

i will wait for your work, thank you.
lol, the signature has nothing with what you said...
 
Hello Atoa,
I am using your script. It nice script.
but when I used your script with multiattack script
(KGC's Script), my game was error.
errornd.jpg


This is KGC script:
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#_/    ◆ 多段攻撃 - KGC_MultiAttack ◆

#_/    ◇ Last update : 2007/12/19 ◇

#_/----------------------------------------------------------------------------

#_/  複数回効果を適用する行動を作成します。

#_/============================================================================

#_/  ≪ダメージ数値改造[DamageAlter]≫より下

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 

#==============================================================================

# ★ カスタマイズ項目 ★

#==============================================================================

 

module KGC

  # ◆攻撃判定用SEファイル名

  #  (大文字・小文字は問わない。拡張子不要)

  MATK_HIT_SE = "_multi_attack"

  # ◆多段攻撃時、1Hitごとにステータスウィンドウを再描画

  #  (無駄に重いので、高速化ACB以外では使用しない方が無難)

  MATK_HIT_REFRESH = false

  # ◆ダメージ表示が終わるまで待つ

  #  true にすると、ダメージ表示が終わるまで次のバトラーが行動しない。

  MATK_WAIT_DAMAGE_EFFECT = false

 

  # ◆合計ダメージ表示

  #  合計ダメージを逐次表示。

  MATK_SHOW_TOTAL_DMG = true

  # ◆前のダメージ表示を消去

  #  前回のダメージを消去してから次のダメージ表示を出す。

  MATK_DELETE_PREV_DMG = false

 

  # ◆ダメージ表示をずらす

  #  前回のダメージ表示から少しずれた位置に次のダメージ表示を出す。

  MATK_SHIFT_DMG_POS = true

  # ◆ダメージ表示のずれの大きさ

  #  正にすると下方向、負にすると上方向にずれる。

  MATK_SHIFT_DMG_POS_AMT = -4

 

  # ◆ヒット数表示

  MATK_SHOW_HIT_COUNT = true

  # ◆ヒット数の表示位置 [x, y]

  #  ダメージ表示の位置からの相対座標。

  MATK_HIT_COUNT_POS = [0, -48]

  # ◆ヒット数の書式

  #  【{n}…ヒット数】

  MATK_HIT_COUNT_FORMAT = "{n} Hits"

  # ◆ヒット数の文字色

  MATK_HIT_COUNT_COLOR = Color.new(0, 200, 255)

  # ◆ヒット数のフォント

  MATK_HIT_COUNT_FONT_NAME   = ["EucrosiaUPC"]  # フォント名

  MATK_HIT_COUNT_FONT_SIZE   = 40    # サイズ

  MATK_HIT_COUNT_FONT_BOLD   = true  # 太字

  MATK_HIT_COUNT_FONT_ITALIC = false  # 斜体

end

 

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

 

$imported = {} if $imported == nil

$imported["MultiAttack"] = true

 

#==============================================================================

# ■ Game_Battler (分割定義 1)

#==============================================================================

 

class Game_Battler

  attr_accessor :prev_hp, :prev_sp

  #--------------------------------------------------------------------------

  # ● オブジェクト初期化

  #--------------------------------------------------------------------------

  alias initialize_KGC_MultiAttack initialize

  def initialize

    initialize_KGC_MultiAttack

 

    @prev_hp = nil

    @prev_sp = nil

  end

end

 

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

 

#==============================================================================

# ■ Sprite_Battler

#==============================================================================

 

class Sprite_Battler < RPG::Sprite

  #--------------------------------------------------------------------------

  # ● オブジェクト初期化

  #--------------------------------------------------------------------------

  alias initialize_KGC_MultiAttack initialize

  def initialize(viewport, battler = nil)

    initialize_KGC_MultiAttack(viewport, battler)

 

    @_damage_sprite_array = []

    @_damage_duration_array = []

    @_damage_direct_type_array = []

    @_latest_damage_sprite = nil

    @_hit_count_sprite = RPG::Sprite.new

    @_hit_count_sprite.bitmap =

      Bitmap.new(160, KGC::MATK_HIT_COUNT_FONT_SIZE * 3 / 2)

    reset_hit_count

  end

  #--------------------------------------------------------------------------

  # ● 解放

  #--------------------------------------------------------------------------

  alias dispose_KGC_MultiAttack dispose

  def dispose

    @_damage_sprite_array.each_index { |i| dispose_damage(i) }

    @_hit_count_sprite.bitmap.dispose

    @_hit_count_sprite.dispose

 

    dispose_KGC_MultiAttack

  end

  #--------------------------------------------------------------------------

  # ● 多段ヒット判定

  #--------------------------------------------------------------------------

  def multi_attack?

    if @_multi_attack

      @_multi_attack = false

      return true

    end

    return false

  end

  #--------------------------------------------------------------------------

  # ● ヒットカウント加算

  #--------------------------------------------------------------------------

  def add_hit_count

    @_hit_count += 1

    if KGC::MATK_SHOW_HIT_COUNT

      refresh_hit_count_sprite

    end

  end

  #--------------------------------------------------------------------------

  # ● ヒットカウント初期化

  #--------------------------------------------------------------------------

  def reset_hit_count

    @_hit_count = 0

    if KGC::MATK_SHOW_HIT_COUNT

      refresh_hit_count_sprite

    end

  end

  #------------------------------------------------------------------------

  # ● ダメージスプライト作成

  #------------------------------------------------------------------------

  def damage(value, critical)

    @_damage_sprite_array.compact!

    @_damage_duration_array.compact!

    @_damage_direct_type_array.compact!

    super

    sprite = RPG::Sprite.new

    sprite.bitmap = @_damage_sprite.bitmap.dup

    sprite.ox = @_damage_sprite.ox

    sprite.oy = @_damage_sprite.oy

    sprite.x = @_damage_sprite.x

    sprite.y = @_damage_sprite.y

    if KGC::MATK_SHIFT_DMG_POS

      sprite.y += @_damage_sprite_array.size * KGC::MATK_SHIFT_DMG_POS_AMT

    end

    sprite.z = @_damage_sprite.z

    @_damage_sprite_array.unshift(sprite)

    @_damage_duration_array.unshift(40)

    @_damage_direct_type_array.unshift(@_damage_direct_type)

    @_latest_damage_sprite = sprite

    dispose_damage

  end

  #--------------------------------------------------------------------------

  # ● ダメージスプライト破棄

  #--------------------------------------------------------------------------

  def dispose_damage(index = -1)

    if index >= 0 && @_damage_sprite_array[index] != nil

      if @_latest_damage_sprite == @_damage_sprite_array[index]

        @_latest_damage_sprite = nil

      end

      @_damage_sprite_array[index].bitmap.dispose

      @_damage_sprite_array[index].dispose

      @_damage_sprite_array[index] = nil

      @_damage_duration_array[index] = nil

      @_damage_direct_type_array[index] = nil

    else

      super()

    end

  end

  #--------------------------------------------------------------------------

  # ● ダメージスプライトクリア

  #--------------------------------------------------------------------------

  def clear_damage

    @_damage_sprite_array.each_index { |i|

      dispose_damage(i)

    }

    @_damage_sprite_array.compact!

    @_damage_duration_array.compact!

    @_damage_direct_type_array.compact!

  end

  #------------------------------------------------------------------------

  # ● ヒットカウントスプライト再描画

  #------------------------------------------------------------------------

  def refresh_hit_count_sprite

    img = @_hit_count_sprite.bitmap

    img.clear

    if @_hit_count > 1

      img.font.name = KGC::MATK_HIT_COUNT_FONT_NAME

      img.font.size = KGC::MATK_HIT_COUNT_FONT_SIZE

      img.font.bold = KGC::MATK_HIT_COUNT_FONT_BOLD

      img.font.italic = KGC::MATK_HIT_COUNT_FONT_ITALIC

      img.font.color = KGC::MATK_HIT_COUNT_COLOR

      format = KGC::MATK_HIT_COUNT_FORMAT.gsub(/{n}/i) {"#{@_hit_count}"}

      img.draw_frame_text(0, 0, img.width, img.height, format, 1)

    end

  end

  #--------------------------------------------------------------------------

  # ● アニメーション実行タイミング

  #--------------------------------------------------------------------------

  def animation_process_timing(timing, hit)

    if (timing.condition == 0) || (timing.condition == 1 && hit) ||

       (timing.condition == 2 && !hit)

      if timing.se.name != ""

        @_multi_attack |= (timing.se.name.upcase == KGC::MATK_HIT_SE.upcase)

      end

    end

    super

  end

  #--------------------------------------------------------------------------

  # ● エフェクト中判定

  #--------------------------------------------------------------------------

  if KGC::MATK_WAIT_DAMAGE_EFFECT

  unless defined?(INITIALIZED_MULTI_ATTACK)

    alias effect_KGC_MultiAttack? effect?

  end

  INITIALIZED_MULTI_ATTACK = true

  def effect?

    result = false

    @_damage_duration_array.each { |duration|

      result |= (duration > 0)

    }

    return result || effect_KGC_MultiAttack?

  end

  end

  #--------------------------------------------------------------------------

  # ● フレーム更新

  #--------------------------------------------------------------------------

  alias update_KGC_MultiAttack update

  def update

    @_multi_attack = false if Graphics.frame_count % 2 == 0

 

    update_KGC_MultiAttack

 

    if @_damage_sprite_array.size > 0

      @_damage_sprite_array.each_with_index { |sp, i|

        if sp == nil

          next

        end

        if @_damage_duration_array[i] == 0

          dispose_damage(i)

          next

        end

        @_damage_duration_array[i] -= 1

        sp.x = self.x

        if $imported["DamageAlter"]

          @_damage_direct_type = @_damage_direct_type_array[i]

          damage_direct(sp, @_damage_duration_array[i])

        else

          case @_damage_duration_array[i]

          when 38..39

            sp.y -= 4

          when 36..37

            sp.y -= 2

          when 34..35

            sp.y += 2

          when 28..33

            sp.y += 4

          end

          sp.opacity = 256 - (12 - @_damage_duration_array[i]) * 32

        end

      }

      if KGC::MATK_SHOW_HIT_COUNT && @_latest_damage_sprite != nil

        update_hit_count_sprite

      end

    end

    @_damage_sprite_array.compact!

    @_damage_duration_array.compact!

  end

  #------------------------------------------------------------------------

  # ● ヒットカウントスプライト更新

  #------------------------------------------------------------------------

  def update_hit_count_sprite

    sp = @_latest_damage_sprite

    sp2 = @_hit_count_sprite

    sp2.ox = sp.ox

    sp2.oy = sp.oy

    sp2.x = sp.x + KGC::MATK_HIT_COUNT_POS[0]

    sp2.y = sp.y + KGC::MATK_HIT_COUNT_POS[1]

    sp2.z = sp.z + 1

    sp2.opacity = sp.opacity

  end

end

 

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

 

#==============================================================================

# ■ Spriteset_Battle

#==============================================================================

 

class Spriteset_Battle

  #--------------------------------------------------------------------------

  # ● スプライト取得

  #--------------------------------------------------------------------------

  def sprites

    return (@enemy_sprites + @actor_sprites).compact

  end

end

 

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

 

#==============================================================================

# ■ Scene_Battle (分割定義 1)

#==============================================================================

 

class Scene_Battle

  #--------------------------------------------------------------------------

  # ● フレーム更新

  #--------------------------------------------------------------------------

  alias update_KGC_MultiAttack update

  def update

    update_multi_attack_effect

 

    update_KGC_MultiAttack

  end

  #--------------------------------------------------------------------------

  # ● 多段攻撃更新

  #--------------------------------------------------------------------------

  def update_multi_attack_effect

    attacker = ($imported["ActiveCountBattle"] ?

      @action_battler : @active_battler)

    if @phase4_step == 5 && @target_battlers != [] && attacker != nil

      # ステータスウィンドウ再描画

      if KGC::MATK_HIT_REFRESH

        @status_window.refresh

      end

      @spriteset.sprites.each { |sp|

        # 多段ヒット判定

        unless sp.multi_attack? && @target_battlers.include?(sp.battler)

          next

        end

        if KGC::MATK_DELETE_PREV_DMG

          sp.clear_damage

        end

 

        # 合計ダメージ更新

        if @_matk_total_damage[sp.battler] == nil

          @_matk_total_damage[sp.battler] = 0

        end

        if sp.battler.damage.is_a?(Numeric)

          @_matk_total_damage[sp.battler] += sp.battler.damage

        end

 

        if KGC::MATK_SHOW_TOTAL_DMG

          # 合計を表示

          sp.damage(@_matk_total_damage[sp.battler], sp.battler.critical)

        else

          # 逐次表示

          sp.damage(sp.battler.damage, sp.battler.critical)

        end

 

        # ヒット数更新

        if KGC::MATK_SHOW_HIT_COUNT && sp.battler.damage.is_a?(Numeric)

          sp.add_hit_count

        end

        # 効果を追加

        case attacker.current_action.kind

        when 0

          if attacker.current_action.basic == 0

            sp.battler.attack_effect(attacker)

          end

        when 1

          skill = $data_skills[attacker.current_action.skill_id]

          sp.battler.skill_effect(attacker, skill)

        when 2

          item = $data_skills[attacker.current_action.item_id]

          sp.battler.item_effect(item)

        end

        # 元のHP/SPを更新

        sp.battler.prev_hp = sp.battler.hp

        sp.battler.prev_sp = sp.battler.sp

      }

    end

  end

end

 

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

 

#==============================================================================

# ■ Scene_Battle (分割定義 4)

#==============================================================================

 

class Scene_Battle

  #--------------------------------------------------------------------------

  # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)

  #--------------------------------------------------------------------------

  alias update_phase4_step4_KGC_MultiAttack update_phase4_step4

  def update_phase4_step4

    @_matk_total_damage = {}

    if KGC::MATK_SHOW_HIT_COUNT

      @spriteset.sprites.each { |sp| sp.reset_hit_count }

    end

 

    update_phase4_step4_KGC_MultiAttack

  end

  #--------------------------------------------------------------------------

  # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)

  #--------------------------------------------------------------------------

  alias update_phase4_step5_KGC_MultiAttack update_phase4_step5

  def update_phase4_step5

    # 多段ダメージ更新処理

    @spriteset.sprites.each { |sp|

      if @target_battlers.include?(sp.battler) &&

          @_matk_total_damage[sp.battler] != nil &&

          sp.battler.damage.is_a?(Numeric)

        if KGC::MATK_SHOW_TOTAL_DMG

          sp.battler.damage = @_matk_total_damage[sp.battler] + sp.battler.damage

        end

        if KGC::MATK_SHOW_HIT_COUNT

          sp.add_hit_count

        end

      end

    }

 

    update_phase4_step5_KGC_MultiAttack

  end

end
Thank you very much :)
 

Atoa

Member

@ninemaruay
Sadly this script has one of the worst compatibility with other battle scripts.

But it have many features that replaces other scripts.
If an script don't work with the Tankentai, and you don't know about scripting, forget.

I suppose there's no one willing to fix these incompatibilities.
 

Atoa

Member

In fact, there's no option for that by default.

Since in the default code the item/skill window stay below, and not on the center, i forget do add an option to hide the ctb window. .-.

My bad ;D

This will be fixed on the (i don't know when) update.

But, this can be relased before the Tankentai overall update, because i'm revising te code of all ACBS add-ons to make them compatible with ACBS, Tankentai and default system without needing any canges.
 

bigace

Member

another question

Rajaat99(2)":jgnqhkeo said:
Ok, first off, I'm must be stupid.
That being said, whenever I set a skill animation as 001:Special Move, it shows 002:Cast Magic animation instead.
I've looked through the code and I know I must be missing it. Can anyone help me, please?

Is there tutorial somewhere or something on this because I'm really confused about this part. I mean where do you change it in the script where certain moves won't use Cast Magic but something else that you set.
 

Atoa

Member

@bigace
The skill animation are set on the action sequence.

So you would need to make different Ations Sequence and assign them to the skills, what is quite advanced.
 
hi atoa,i have 2 question about your script
1. about the atb meter
2. about the error "uninitialized constant Scene_Battle" line 902
thank you before ^_^
m0zew.jpg

2mx31pv.jpg
 

Atoa

Member

@Mizuki
1. about the atb meter
It's you that must set the postion of the atb meter.
The bar is not automatically set to the same position as actor status display.

You should check *all* options of an add-on before ask, because there's one to set the position of the bar.

2. about the error "uninitialized constant Scene_Battle" line 902
Are you using Individual Battle Commands? If so you should put it above the ATB Script
 

XaineC

Member

Hey i have an issue. Im trying to use the advanced stats script but everytime open the game, i get a syntax error on line 205. Help?

Heres the code line;

syntax.png
 

Atoa

Member

@XaineC
You forget to close one of the Keys....

In your code it is:
Extra_Equips_ID = {6 => []

The correct is:
Extra_Equips_ID = {6 => []}

Also adding tow differents "Extra_Equips_ID" lines don't have any effect.

Isntead you must add all setings on one key, separated by coma.

Wrong:
Extra_Equips_ID = {5 => []}
Extra_Equips_ID = {6 => []}

Right:
Extra_Equips_ID = {5 => [], 6 => []}
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top