Multi Attack & Combo Display
#1
Hello! First of all, I'm glad to have joined this forum. It looks like a friendly and active place. I've posted here because I'm having a problem of campatibility between 2 scripts.

I'm using KGC_MultiAttack script to make an attack or skill have multiple hits and MOG XP - Combo Display V1.0, which shows a combo hit count during the battle. The problem that I'm having is that the combo hit count does not display the multi hit attacks, it just counts the first hit.

Is there anyone who knows scripting to help modify the Combo Display to make it count the multiple hits or know of any other solution? I'm wanting to make these two work because I'm planning on adding achievements and one of them would be achieving a high number of hits or high max damage.

Thanks for your attention!

Code:
#==============================================================================
# +++ MOG XP - Combo Display V1.0 +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# ■ Apresenta a quantidade de acertos no alvo e o dano maximo.
# ---------------------------------------------------------------------------
# É necessário ter os arquivos imagens na pasta Graphics/Windoskins.
# Combo_Damage.png
# Combo_Hud.png
# Combo_Number.png
#==============================================================================
module MOG_COMBO_DISPLAY
 #Ativar tempo para fazer combo.
 TIME_COUNT = true
 # Tempo para fazer um combo. (40 = 1s)
 COMBO_TIME = 40
 # Cancelar a contagem de Combo caso o inimigo acertar o herói.
 ENEMY_CANCEL_COMBO = true
 # Posição geral das imagens. X Y
 COMBO_POSITION = [440,60]
 # Posição do número de HITS. X Y
 HIT_POSITION = [15,20]
 # Posição do número de dano. X Y
 TOTAL_POSITION = [60,-20]
 # Prioridade das imagens.
 PRIORITY_Z = 50
end

#===============================================================================
# ■ Game_Temp
#===============================================================================
class Game_Temp
  attr_accessor :combo_hit
  attr_accessor :max_damage  
  attr_accessor :combo_time  
 #--------------------------------------------------------------------------
 # ● initialize
 #--------------------------------------------------------------------------  
  alias mog_combo_display_initialize initialize
  def initialize
      @combo_hit = 0
      @max_damage = 0  
      @combo_time = 0    
      mog_combo_display_initialize
  end
end

#===============================================================================
# ■ Combo_Sprite_Hud
#===============================================================================
class Combo_Sprite_Hud < Sprite
  attr_accessor :combo_wait
  include MOG_COMBO_DISPLAY
 
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------
 def initialize
    super  
    @combo_wait = false
    $game_temp.combo_time = 0
    $game_temp.combo_hit = 0
    $game_temp.max_damage = 0    
    @combo_hit_old = 0
    @animation_speed = 0
    @pos_x = COMBO_POSITION[0]
    @pos_x_fix = 0
    @pos_y = COMBO_POSITION[1]
    create_combo_sprite
    create_total_damage_sprite    
    create_hud_sprite    
  end      

 #--------------------------------------------------------------------------
 # ● Create Hud Sprite  
 #--------------------------------------------------------------------------
 def create_hud_sprite  
      @hud = Sprite.new
      @hud.bitmap = RPG::Cache.windowskin("Combo_HUD")
      @hud.z = PRIORITY_Z
      @hud.x = COMBO_POSITION[0]
      @hud.y = COMBO_POSITION[1]
      @hud.opacity = 250
      @hud.visible = false
 end    

 #--------------------------------------------------------------------------
 # ● Create Total Damage Sprite
 #--------------------------------------------------------------------------
 def create_total_damage_sprite    
      @total_image = RPG::Cache.windowskin("Combo_damage")
      @total_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
      @total = Sprite.new
      @total.bitmap = @total_bitmap
      @total_im_cw = @total_image.width / 10
      @total_im_ch = @total_image.height    
      @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
      for r in 0..@total_number_text.size - 1
        @total_number_abs = @total_number_text[r].to_i
        @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
        @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 0, @total_image, @total_src_rect)        
      end      
      @total.z = PRIORITY_Z + 1
      @total_orig_x = COMBO_POSITION[0] + TOTAL_POSITION[0]
      @total_orig_y = COMBO_POSITION[1] + TOTAL_POSITION[1]
      @total.x = @total_orig_x
      @total.y = @total_orig_y
      @total.zoom_x = 1.00
      @total.zoom_y = 1.00
      @total.opacity = 250  
      @total.visible = false
 end    

 #--------------------------------------------------------------------------
 # ● Create Combo Number  
 #--------------------------------------------------------------------------
 def create_combo_sprite
      @combo_image = RPG::Cache.windowskin("Combo_Number")
      @combo_bitmap = Bitmap.new(@combo_image.width,@combo_image.height)
      @combo = Sprite.new
      @combo.bitmap = @combo_bitmap
      @combo_im_cw = @combo_image.width / 10
      @combo_im_ch = @combo_image.height    
      @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
      for r in 0..@combo_number_text.size - 1
        @combo_number_abs = @combo_number_text[r].to_i
        @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
        @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
      end      
      @combo.z = PRIORITY_Z + 2
      @combo_orig_x = COMBO_POSITION[0] + HIT_POSITION[0]
      @combo_orig_y = COMBO_POSITION[1] + HIT_POSITION[1]
      @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
      @combo.x = @combo_orig_x - @pos_x_fix    
      @combo.y = @combo_orig_y
      @combo.zoom_x = 1.00
      @combo.zoom_y = 1.00
      @combo.opacity = 250
      @combo.visible = false
 end  
   
 #--------------------------------------------------------------------------
 # ● Dispose
 #--------------------------------------------------------------------------
 def dispose
     @combo_bitmap.dispose
     @combo.bitmap.dispose
     @combo.dispose
     @hud.bitmap.dispose
     @hud.dispose
     @total_bitmap.dispose
     @total.bitmap.dispose
     @total.dispose
     super
 end
   
 #--------------------------------------------------------------------------
 # ● Refresh
 #--------------------------------------------------------------------------
 def refresh
     @combo_hit_old = $game_temp.combo_hit
     @combo.bitmap.clear
     @total.bitmap.clear
     @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//)
     for r in 0..@combo_number_text.size - 1
        @combo_number_abs = @combo_number_text[r].to_i
        @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch)
        @combo_bitmap.blt(40 + ((@combo_im_cw - 12) *  r), 0, @combo_image, @combo_src_rect)        
      end            
      @total_number_text = $game_temp.max_damage.abs.to_s.split(//)
      for r in 0..@total_number_text.size - 1
        @total_number_abs = @total_number_text[r].to_i
        @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch)
        @total_bitmap.blt(40 + ((@total_im_cw - 12) *  r), 20, @total_image, @total_src_rect)        
      end
      #Combo Position
      @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size)
      @combo.x = @combo_orig_x - @pos_x_fix
      @combo.y = @combo_orig_y
      @combo.zoom_x = 2
      @combo.zoom_y = 2
      @combo.opacity = 70
      @combo.visible = true
      #Total Position      
      @total.x = @total_orig_x + 20
      @total.y = @total_orig_y    
      @total.opacity = 100
      @total.visible = true            
      #Hud Position
      @hud.x = COMBO_POSITION[0]
      @hud.y = COMBO_POSITION[1]
      @hud.opacity = 255
      @hud.visible = true
  end    
 
 #--------------------------------------------------------------------------
 # ● Slide Update
 #--------------------------------------------------------------------------
 def slide_update
   return if @combo.visible == false
   if $game_temp.combo_time > 0 and @combo_wait == false
      $game_temp.combo_time -= 1 if TIME_COUNT == true
   end
   if $game_temp.combo_time > 0 and $game_temp.combo_hit > 0  
        #Total Damage
        if @total.x > @total_orig_x
           @total.x -= 1
           @total.opacity += 8
        else  
           @total.x = @total_orig_x
           @total.opacity = 255
        end  
        #Combo
        if @combo.zoom_x > 1.00
           @combo.zoom_x -= 0.05
           @combo.zoom_y -= 0.05      
           @combo.opacity += 8
        else
           @combo.zoom_x = 1
           @combo.zoom_y = 1
           @combo.opacity = 255
           @combo.x = @combo_orig_x - @pos_x_fix
           @combo.y = @combo_orig_y
        end          
    elsif $game_temp.combo_time == 0 and @combo.visible == true
          @combo.x -= 5
          @combo.opacity -= 10
          @total.x -= 3
          @total.opacity -= 10
          @hud.x += 5
          @hud.opacity -= 10    
          $game_temp.combo_hit = 0
          @combo_hit_old = $game_temp.combo_hit
          $game_temp.max_damage = 0
          if @combo.opacity <= 0
             @combo.visible = false
             @total.visible = false
             @hud.visible = false
          end  
    end    
 end
 
 #--------------------------------------------------------------------------
 # ● Cancel
 #--------------------------------------------------------------------------    
 def cancel
     $game_temp.combo_hit = 0
     $game_temp.max_damage = 0
     $game_temp.combo_time = 0      
     @combo_hit_old = $game_temp.combo_hit
 end  

 #--------------------------------------------------------------------------
 # ● Clear
 #--------------------------------------------------------------------------    
 def clear
     $game_temp.combo_time = 0
 end      

 #--------------------------------------------------------------------------
 # ● Update
 #--------------------------------------------------------------------------
 def update
   super
   refresh if $game_temp.combo_hit != @combo_hit_old
   slide_update
 end    
end

#===============================================================================
# ■ Scene_Battle
#===============================================================================
class Scene_Battle
 include MOG_COMBO_DISPLAY
 
 #--------------------------------------------------------------------------
 # ● main
 #--------------------------------------------------------------------------
 alias mog_combo_main main
 def main
   create_cb_sprite
   mog_combo_main
   dispose_cb_sprite
 end
 
 #--------------------------------------------------------------------------
 # ● create_cb_sprite
 #--------------------------------------------------------------------------  
 def create_cb_sprite
    @combo_sprite = Combo_Sprite_Hud.new
 end
 
 #--------------------------------------------------------------------------
 # ● dispose_cb_sprite
 #--------------------------------------------------------------------------
 def dispose_cb_sprite
    @combo_sprite.dispose
 end  
 
 #--------------------------------------------------------------------------
 # ● update
 #--------------------------------------------------------------------------
 alias mog_combo_update update
 def update
   mog_combo_update
   @combo_sprite.update      
 end      
 
 #--------------------------------------------------------------------------
 # ● mog_combo_start_phase1
 #--------------------------------------------------------------------------
 alias mog_combo_start_phase2 start_phase2
 def start_phase2
     @combo_sprite.combo_wait = false
     mog_combo_start_phase2
 end  
 
 #--------------------------------------------------------------------------
 # ● start_phase4  
 #--------------------------------------------------------------------------
 alias mog_combo_display_start_phase4 start_phase4
 def start_phase4  
     @combo_sprite.combo_wait = true
     mog_combo_display_start_phase4
 end  
 
 #--------------------------------------------------------------------------
 # ● update_phase4_step5
 #--------------------------------------------------------------------------
 alias mog_combo_display_update_phase4_step5 update_phase4_step5
 def update_phase4_step5    
     for target in @target_battlers        
       if target.damage != nil and target.damage.is_a?(Numeric) and
          target.damage.to_i > 0
         if target.is_a?(Game_Enemy)
            $game_temp.combo_hit += 1
            $game_temp.max_damage += target.damage.to_i
            $game_temp.combo_time = COMBO_TIME
         else
            $game_temp.combo_time = 0 if ENEMY_CANCEL_COMBO == true
         end            
       end
     end    
     mog_combo_display_update_phase4_step5      
  end  
 
 #--------------------------------------------------------------------------
 # ● Start After Battle Phase
 #--------------------------------------------------------------------------
 alias mog_combo_start_phase5 start_phase5
 def start_phase5
     @combo_sprite.clear  
     mog_combo_start_phase5
 end    
end  

$mog_rgssxp_combo_display = true




Edit:
Combo_Hud
Combo_Number
[/url][url=http://imgur.com/Zr2fvA0]Combo_Damage

Edit2: removed KGC's code since I'll be using Mea's Multistrike
Reply }
#2
First, there are a few things to note.

Of the Moghunter script.... Grrraarrrr.... can he just make clean code? It's like looking at spaghetti! Great visuals, but ... uggh. Winking HOWEVER, the script requires three graphics which you did not supply. This also needs "Combo_Damage.png", "Combo_Hud.png" and "Combo_Number.png" which you did not supply. These will need to go within the Graphics\Windowskins folder. Please supply them within your first post. It would be helpful.

Of the KGC script. Well.... I went to the site and read the terms of use of the KGC scripts. They are kinda harsh. One of their terms is that you can not post their scripts elsewhere (whoops... the above script will 'eventually' be removed). And another term is that you can't even provide a hot link to their script links. MAN, that's not just tough, but insane! And third, you can't make a commercial game with their works. Seriously, it's like they don't want anyone asking for help elsewhere? Jerks.

What you may NOT realize is that the KGC script requires another script: The KGC_FrameShadowText script. This other KGC script defines the 'draw_frame_text' method which the MultiAttack script relies upon for a few features. Fortunately, I have the whole original DevProject of theirs. I wish I translated it into English though (headaches). But at least you know I have THAT covered.

I take it that you want it to show a damage pop for each strike? For example, if Aluxes had a special 'OCTO-STRIKE' attack which delivered 8 slashing blows on a target that you would have 8 individual attacks? The KGC script is a bit poor in execution. It doesn't do justice to that as it shows the final attack with the # of hits .... waits.... and then shows the final hit damage 'again' with the # of hits. Messy.

You may want to look at Mea's MultiSTRIKE by .... me? Winking The code may not count the number of hits like the KGC script, but it is much smaller and solves that issue.

STILL.... the Moghunter script does need those graphics.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#3
Thanks for the fast reply!

I edited the post with the links for "Combo_Damage.png", "Combo_Hud.png" and "Combo_Number.png". For now they are just the ones that were in the demo, but they serve their purpose of making the script works.

About KGC scripts, I didn't know they were so strict! I was sure the scripts were fine to use commercially, but i believe you are not supposed to trust google translate too much Laughing  Maybe I will send an email to them asking for permission since I'm using a lot of useful scripts. 

What I wanted was to make the combo hit count the max damage of the multiple hits. For example, if octo-slash did 8 attacks of 100 damage, instead of showing 800 damage, Mog's Combo Hit would show the damage of only the first attack, but it would be very cool if it counted the number of hits too. I wasn't planning on asking for this because I assumed it would be a difficult request  Sad

I tried using Mea's MultiSTRIKE and it works fine! The only issue I have is an extra damage popping at the end of the animation
Reply }
#4
Whoops! I forgot to upload Mea after fixing that issue a couple years ago. Confused It didn't take much, just adding a value into the BattleActions class to see if the attacker is performing a MultiStrike. If he is, it erases the initial 'default' attack so only the remaining 'multiStrikes' affect the target(s).

I didn't adapt it to give you a final tally, but that shouldn't be TOO hard. It just needs to have another value to add all the hits together and 'pop' them too.

For some rendering fun, you may find that Moggy isn't the only person who used graphics for damage displays. We have a few damage display scripts in the forum, beginning with Cogwheel's. Of course, there are also versions that edit the font used in the damage displays.

Meanwhile.... Yeah, KGC's terms have been the same for over a decade. I first thought they were up for grabs like everyone else. That is, I thought that until I used an online translator to read all the terms. *BARF!* You can't even make a hotlink to an individual script thread!?

If you have a bunch of KGC scripts, you may want to make another thread like "Anyone have scripts equivalent to these KGC scripts?" In it, just list each script and what each script accomplishes in some level of detail.

AND.... if you're done with the KGC script above, can you kindly delete it from your initial post? Winking That would show you're good with Mea if that's the case.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#5
Yeah. KGC. KDC. I was like "WhatTheHell?" too.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#6
Given this...

Quote:Who Viewed Online:
Bounty Hunter Lani   Today 02:40 PM
Keeroh                         Today 02:06 PM
LiTTleDRAgo                Today 01:55 PM

... I know you already read my last post.

Well, gotta let you know I made a new version of Mea's MultiStrike.  It doesn't COUNT the number of strikes, but it can show the accumulated total damage delivered when all the hits have been delivered.  Heck, the 'total' hits can be used in place of the individual strike pops if you want!

...... Workin' on your list?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#7
(05-14-2017, 06:25 PM)DerVVulfman Wrote: Whoops!   I forgot to upload Mea after fixing that issue a couple years ago.  Confused  It didn't take much, just adding a value into the BattleActions class to see if the attacker is performing a MultiStrike.  If he is, it erases the initial 'default' attack so only the remaining 'multiStrikes' affect the target(s).  

I didn't adapt it to give you a final tally, but that shouldn't be TOO hard.   It just needs to have another value to add all the hits together and 'pop' them too.

For some rendering fun, you may find that Moggy isn't the only person who used graphics for damage displays.  We have a few damage display scripts in the forum, beginning with Cogwheel's.  Of course, there are also versions that edit the font used in the damage displays.

Meanwhile.... Yeah, KGC's terms have been the same for over a decade.  I first thought they were up for grabs like everyone else.  That is, I thought that until I used an online translator to read all the terms.   *BARF!*  You can't even make a hotlink to an individual script thread!?  

If you have a bunch of KGC scripts, you may want to make another thread like  "Anyone have scripts equivalent to these KGC scripts?"   In it, just list each script and what each script accomplishes in some level of detail.

AND.... if you're done with the KGC script above, can you kindly delete it from your initial post?  Winking   That would show you're good with Mea if that's the case.

Hello! Blushing + Cheery 

I used the new Mea's Multistrike and at first it worked. It showed the max damage in the combo count, but the damage popping after each hit was not appearing. After a little observation I saw that the opacity in animation was 255 instead of 254. When i put 254, the damage of the attack turned 0  Confused  

I don't know why this happened but probably must be some conflict with another script, i'll continue testing and see 
Reply }
#8
Er, I have the SWITCH in the configuration system set to only show the final totals. Laughing + Tongue sticking out This means, individual hits won't show... only the final total. It can be configured to show individual hits. I wanted you to have a choice of showing all hits and/or just the final total.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#9
I've set MS_TOTALPOP to true and MS_TOTALONLY to false and it should show all the hits + the total damage, but instead all the damage that i did was zero. Some script must be conflicting with this one

Edit: When i commented KGC's Action Count Battle it worked
Reply }
#10
Ya must have ACB posted 'below' mine. Overwriting it in essence. If you put it below KGC's ACB, it would prolly work.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Display some uncommon values Mel 6 8,475 08-15-2017, 05:38 PM
Last Post: Mel
   Display State Ranks in Status Screen Mel 3 7,375 04-02-2017, 12:46 AM
Last Post: marketing small business ideas
   [XP]Alternative Attack Algorithms by Xelias - need help with bug Geminil 0 3,209 02-06-2016, 07:56 PM
Last Post: Geminil
Question  Lycan ABS - Weapon display Jetboy 4 7,114 07-14-2015, 06:02 AM
Last Post: DerVVulfman
  Icon Display 1.0 scripts makes events impossible to go to events, which are passable Djigit 0 3,880 01-03-2015, 09:11 PM
Last Post: Djigit
  Attack from an enemy to a actor as condinitional branch Djigit 7 9,986 07-05-2014, 06:58 PM
Last Post: Djigit
   Combo Attacks Script Help JackMonty 11 12,982 05-04-2013, 10:55 PM
Last Post: JackMonty



Users browsing this thread: 1 Guest(s)