iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> Vixotic's [Damage Popup] Version 1.1 [Bug edited], Missing battle features from XP~
Rating 5 V
Vixotic
post Feb 10 2008, 04:55 AM
Post #1



Group Icon


Type: Coder




Vixotic's Damage Popup
Exclusive Script for Rpgmakervx.net
Version: 1.1
Released on: 09/02/2008




.:DescriptioN:.
This script will show damage pop-up when the monster got attacked. Same as features in RMXP battle.


.:Screenshot:.



.:Script:.
Place script above main
CODE
#==============================================================================
# <<\/>> Vixotic_Damage_Pop up
#------------------------------------------------------------------------------
# Version 1.1
# by Vixotic [vixotic@live.com]
# Exclusive Script for http://rpgmakervx.net/
#
# Place this script above Main
#==============================================================================  

module VIX
  #--------------------------
  # Damage Text Position
  #------------------------
  Damage_X_Plus = 0
  # Move Damage Position in vertical direction ((-)up <= 0 => down(+))
  
  Damage_Y_Plus = -20
  # Move Damage Position in horizontal direction ((-)left <= 0 => right(+))
  
  #--------------------------
  # Damage Text Font/Size
  #------------------------
  Damage_Text_Font = "Arial Black"
  Damage_Text_Size = 32
end

class Sprite_Base < Sprite
  alias vix_sprbase_ini initialize
  alias vix_sprbase_upd update

  def initialize(viewport = nil)
    vix_sprbase_ini(viewport)
    @_damage_duration = 0
  end
  
  def update
    vix_sprbase_upd
    if @_damage_duration > 0
      @_damage_duration -= 1
      case @_damage_duration
      when 38..39
        @_damage_sprite.y -= 4
      when 36..37
        @_damage_sprite.y -= 2
      when 34..35
        @_damage_sprite.y += 2
      when 28..33
        @_damage_sprite.y += 4
      end
        @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
      if @_damage_duration == 0
        dispose_damage
      end
    end
  end
  
  
  def damage(value)
      dispose_damage
      if value.is_a?(Numeric)
        damage_string = value.abs.to_s
      else
        damage_string = value.to_s
      end
      bitmap = Bitmap.new(160, 48)
      bitmap.font.name = VIX::Damage_Text_Font
      bitmap.font.size = VIX::Damage_Text_Size
      bitmap.font.color.set(0, 0, 0)
      bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
      bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
      bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
      bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
      if value.is_a?(Numeric) and value < 0
        bitmap.font.color.set(176, 255, 144)
      else
        bitmap.font.color.set(255, 255, 255)
      end
      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
      @_damage_sprite = ::Sprite.new(self.viewport)
      @_damage_sprite.bitmap = bitmap
      @_damage_sprite.ox = 80
      @_damage_sprite.oy = 20
      @_damage_sprite.x = self.x + VIX::Damage_X_Plus
      @_damage_sprite.y = (self.y - self.oy / 2) + VIX::Damage_Y_Plus
      @_damage_sprite.z = 3000
      @_damage_duration = 40
    end
    
    def dispose_damage
      if @_damage_sprite != nil
        @_damage_sprite.bitmap.dispose
        @_damage_sprite.dispose
        @_damage_sprite = nil
        @_damage_duration = 0
      end
    end
    
  end

class Game_Battler
  attr_accessor :damage
  
  alias vix_gamebat_clr clear_sprite_effects
  def clear_sprite_effects
    @damage = 0
    vix_gamebat_clr
  end
  
end

class Sprite_Battler < Sprite_Base
  DAMAGE = 7
  
  alias vix_sprbat_set setup_new_effect
  def setup_new_effect
    vix_sprbat_set
    if @battler.damage != 0
      damage(@battler.damage)
      @effect_type = DAMAGE
      @battler.damage = 0
    end
  end
  
end

class Scene_Battle < Scene_Base

  def display_action_effects(target, obj = nil)
    unless target.skipped
      line_number = @message_window.line_number
      wait(5)
      target.damage = target.hp_damage if target.is_a?(Game_Enemy)
      display_critical(target, obj)
      display_damage(target, obj)
      display_state_changes(target, obj)
      if line_number == @message_window.line_number
        display_failure(target, obj) unless target.states_active?
      end
      if line_number != @message_window.line_number
        wait(30)
      end
      @message_window.back_to(line_number)
    end
  end
end


.:Instruction:.
You can config the position of damage text & Text's font and size
CODE
  # Damage Text Position
  #------------------------
  Damage_X_Plus = 0
  # Move Damage Position in vertical direction ((-)up <= 0 => down(+))
  
  Damage_Y_Plus = -20
  # Move Damage Position in horizontal direction ((-)left <= 0 => right(+))
  
  #--------------------------
  # Damage Text Font/Size
  #------------------------
  Damage_Text_Font = "Arial Black"
  # Font Name
  Damage_Text_Size = 32
  # Font Size


.:Note:.
This script is free to use in non-commercial game if credit included.


--------------------

I know my graphic skill is pretty bad, hope you don't mind. :)

Vixotic
Go to the top of the page
 
+Quote Post
   
Retired-Pine
post Feb 10 2008, 05:07 AM
Post #2


Not a democracy
Group Icon


Type: Spriter
Alignment: Lawful Evil




Saved, copied, tested, approved... man, it works like a charm! Love it


--------------------



Spoiler:


Awards
Spoiler:




Games I support [under construction]
Spoiler:

Go to the top of the page
 
+Quote Post
   
Vixotic
post Feb 10 2008, 05:41 AM
Post #3



Group Icon


Type: Coder




Anyone who copied the script after I just post, please get new version (1.1)!

Version 1.0 has bug when screen fade out, you will see the character floating in the dark..

If anyone want to know how this bug happens >>
it's because of these line:
QUOTE
def initialize(viewport = nil)
vix_sprbase_ini(viewport = nil)

@_damage_duration = 0
end


I changed to:
QUOTE
def initialize(viewport = nil)
vix_sprbase_ini(viewport)
@_damage_duration = 0
end


--------------------

I know my graphic skill is pretty bad, hope you don't mind. :)

Vixotic
Go to the top of the page
 
+Quote Post
   
Jumbo
post Feb 10 2008, 09:37 AM
Post #4


Highest and Lowest of all Nigel
Group Icon


Type: Designer




Neat!
Liked a lot, lots of people will use wink.gif


--------------------

Hello, I am jumbo!
As you can see, I don't post in RMVX related threads (well, sometimes...).
That's because I don't like VX, I'm staying here just because of some friends I met.
So, you'll only see me in the Fun&Games forum.


Go to the top of the page
 
+Quote Post
   
scherzo
post Feb 10 2008, 02:36 PM
Post #5



Group Icon


Type: Musician
Alignment: Lawful Neutral




This is great! This is part of a larger quest to get back all that XP script goodness, I know, but it's still works wonderfully at what's it supposed to do.


--------------------
Go to the top of the page
 
+Quote Post
   
techie
post Feb 10 2008, 02:44 PM
Post #6


The forum Technician
Group Icon


Type: Artist




awesome! thanks for an amazing script that I will definitely use tongue.gif


--------------------
I take sig requests
Need a Title screen or a Game over screen for your game? Go Here and post a request. I will try and make one.

Do you have super smash bros brawl and a wifi connection? PM me and we can brawl together.
Go to the top of the page
 
+Quote Post
   
ChaosRPG
post Feb 10 2008, 03:05 PM
Post #7



Group Icon






Nice script smile.gif. I would use it, but my battlesystem already has it implemented.


--------------------
IPB Image

Pineda is the best spriter :)

IPB Image
Go to the top of the page
 
+Quote Post
   
Xaiko
post Feb 23 2008, 04:28 AM
Post #8



Group Icon


Type: Undisclosed




Great script! I'd like to have a "MISS" message to show up when no damage is done. Is that possible yet or could you implement that? biggrin.gif
Go to the top of the page
 
+Quote Post
   
fmjpr
post Feb 26 2008, 06:41 AM
Post #9



Group Icon


Type: Writer
Alignment: Chaotic Neutral




Miss would be cool and damage for the hero characters as well.


--------------------
Trailer for It Came From Yesterday: Click Me

This was made by a dear friend of mine. Any support is appreciated! Also, Like the Facebook page while you're at it: It Came From Yesterday

New and improved official site: ICFY

Swagbucks referral link: http://www.swagbucks.com/refer/jbart321
Go to the top of the page
 
+Quote Post
   
ZarroTsu
post Feb 26 2008, 06:48 AM
Post #10



Group Icon


Type: Designer




Prehaps you could have the sprite flicker white just as the damage pops up?
Go to the top of the page
 
+Quote Post
   
Vixotic
post Feb 26 2008, 11:07 PM
Post #11



Group Icon


Type: Coder




It's a little harder to make 'miss' (I tried it)

Because I don't sure the order of VX battle system, and how the system store that damage 'Miss' or not.


--------------------

I know my graphic skill is pretty bad, hope you don't mind. :)

Vixotic
Go to the top of the page
 
+Quote Post
   
Blaz3r
post Aug 18 2008, 01:32 PM
Post #12


The Lord of Sapharan (not Sarafan)
Group Icon


Type: Undisclosed
Alignment: Chaotic Evil




I have some bug.
When fight starts, nothing happens.
transition, and then black screen (and bgm plays).


--------------------
Be a part of Adventure Quest Worlds History!
Spoiler:
Go to the top of the page
 
+Quote Post
   
A12345
post Aug 22 2008, 10:19 AM
Post #13


Fast and hardly to get!
Group Icon


Type: Designer




Cool smile.gif its working very nice rolleyes.gif
Go to the top of the page
 
+Quote Post
   
fmjpr
post Aug 22 2008, 10:23 AM
Post #14



Group Icon


Type: Writer
Alignment: Chaotic Neutral




QUOTE (Blaz3r @ Aug 18 2008, 09:28 AM) *
I have some bug.
When fight starts, nothing happens.
transition, and then black screen (and bgm plays).


Probably not this script. Check what else you have added. This is a minor add-on and could not cause that.


--------------------
Trailer for It Came From Yesterday: Click Me

This was made by a dear friend of mine. Any support is appreciated! Also, Like the Facebook page while you're at it: It Came From Yesterday

New and improved official site: ICFY

Swagbucks referral link: http://www.swagbucks.com/refer/jbart321
Go to the top of the page
 
+Quote Post
   
exile322
post Nov 10 2009, 10:00 AM
Post #15



Group Icon


Type: Undisclosed




QUOTE (jasonicus @ Feb 26 2008, 02:41 PM) *
Miss would be cool and damage for the hero characters as well.


I agree it would be awesome if it showed the damage taken for the hero as well.

I'm using Claimh's sideview battle system and it works perfectly for the enemy but it would be really good if it showed the damage that the heros took as well.
Go to the top of the page
 
+Quote Post
   
ZeroManArmy
post Nov 12 2009, 06:07 PM
Post #16


Click the Pokémon Banner!
Group Icon


Type: Undisclosed
Alignment: Chaotic Neutral




I like this very much. Its very good. Once I start to mess around with the colors it will work nicely with my game. Thanks so much.

EDIT: Could you at least save page space by putting the code in a spoiler? It would be so much easier on all of us

This post has been edited by ZeroManArmy: Nov 12 2009, 06:08 PM


--------------------
Go to the top of the page
 
+Quote Post
   
gabreddy
post Nov 30 2011, 05:13 PM
Post #17



Group Icon


Type: Designer
Alignment: Chaotic Good




Awesome happy.gif Works perfectly. No problems for me! Thanks for this!


--------------------
OK, cyaz.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1st August 2014 - 09:39 PM

RPGMakerVX.net is an Privacy Policy, Legal.