The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: darkserge000 on October 07, 2011, 05:42:13 AM

Poll
Question: Does anyone knows how to make a script that when the character engage in battle, the characters are bigger?
Option 1: Thumbs Up votes: 2
Option 2: Thumbs Down votes: 2
Title: Bigger character when engage in battle
Post by: darkserge000 on October 07, 2011, 05:42:13 AM
Does anyone knows how to make a script that when the character engage in battle, the characters are bigger?
Title: Re: Bigger character when engage in battle
Post by: JonFawkes on October 07, 2011, 06:43:21 AM
This isn't the place to make a request or ask for a script.

And it depends on the battle script you're using. The default battle system doesn't even show your characters, so it doesn't even matter. Most alternate battle systems use their own battle sprites, so it's just a matter of making bigger sprites for battlers.
Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 08, 2011, 05:03:09 AM
Oh! Sorry! ^_^ i am a newbie here so i don't know much about this site ^_^

So, is there any battle scripts like that?

Where should i post a request?
Title: Re: Bigger character when engage in battle
Post by: JonFawkes on October 08, 2011, 06:43:33 AM
That depends on what kind of battle system you want. There are many varieties of ABS, Turn-Based, there's one or two Tactics style, and maybe a real-time one.

A good place to look would be here, the script index
http://rmrk.net/index.php/topic,31844.0.html

Other sites usually have script indexes too. If you can't find it here, the other two sites I use are RPGmVX.net
www.rpgmakervx.net/index.php?showtopic=4241
or RPG RPG Revolution
http://www.rpgrevolution.com/
Maybe Creation Asylum too
http://www.creationasylum.net/forum/index.php?s=b2cec6810dc260656789f5c8ebdbd122&showforum=153

Google is a great place to look for script if none of those sites serve your needs
Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 08, 2011, 01:26:31 PM
Thanks a lot!
Title: Re: Bigger character when engage in battle
Post by: shintashi on October 14, 2011, 03:37:48 AM
Here's something I threw together a while ago.

  if @battler.is_a?(Game_Actor)
  #case code shrinks enemies and actors as they get closer to top of screen
      case @battler.index
      when 0
        self.zoom_x = 0.90
        self.zoom_y = 0.90
      when 1
        self.zoom_x = 0.95
        self.zoom_y = 0.95
      when 2
        self.zoom_x = 0.98
        self.zoom_y = 0.98
      when 3
        self.zoom_x = 1
        self.zoom_y = 1
      when 4
        self.zoom_x = 0.90
        self.zoom_y = 0.90
      when 5
        self.zoom_x = 0.95
        self.zoom_y = 0.95
      when 6
        self.zoom_x = 0.98
        self.zoom_y = 0.98
      when 7
        self.zoom_x = 1
        self.zoom_y = 1
        end
      #self.mirror = true
    end
  #


inside Sprite Battler > Update

here's a simplified version  to make your sprites big:


  if @battler.is_a?(Game_Actor)
        self.zoom_x = 1.20
        self.zoom_y = 1.20
    end


You can change 1.2 to whatever you like.
Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 14, 2011, 09:08:17 AM
where will i put this script? is it above main?
Title: Re: Bigger character when engage in battle
Post by: shintashi on October 14, 2011, 04:04:15 PM
inside sprite_battler

inside update

above #Blink around line 74

so instead of stuff that looks like this:

   if @battler.is_a?(Game_Actor) and @battler_visible
      # Bring opacity level down a bit when not in main phase
      if $game_temp.battle_main_phase
        self.opacity += 3 if self.opacity < 255
      else
        self.opacity -= 3 if self.opacity > 207
      end
    end
    # Blink
    if @battler.blink
      blink_on
    else
      blink_off
    end
    # If invisible



have it look like this:

   if @battler.is_a?(Game_Actor) and @battler_visible
      # Bring opacity level down a bit when not in main phase
      if $game_temp.battle_main_phase
        self.opacity += 3 if self.opacity < 255
      else
        self.opacity -= 3 if self.opacity > 207
      end
    end
      if @battler.is_a?(Game_Actor)
        self.zoom_x = 1.20
        self.zoom_y = 1.20
    end
    # Blink
    if @battler.blink
      blink_on
    else
      blink_off
    end
    # If invisible


You are only adding four lines of code, so it's a snippet.  ;)
Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 18, 2011, 04:06:13 PM
there is no #Blink in line 74..
Title: Re: Bigger character when engage in battle
Post by: shintashi on October 18, 2011, 04:21:14 PM
Quote from: darkserge000 on October 18, 2011, 04:06:13 PM
there is no #Blink in line 74..

tell ya what, you post your copy of sprite_battler, ill insert it, and you can put it in.
Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 19, 2011, 02:59:03 PM
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  This sprite is used to display battlers. It observes a instance of the
# Game_Battler class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Battler < Sprite_Base
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  WHITEN    = 1                      # Flash white (start action)
  BLINK     = 2                      # Blink (damage)
  APPEAR    = 3                      # Appear (appear, revive)
  DISAPPEAR = 4                      # Disappear (escape)
  COLLAPSE  = 5                      # Collapse (incapacitated)
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :battler
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     viewport : viewport
  #     battler  : battler (Game_Battler)
  #--------------------------------------------------------------------------
  def initialize(viewport, battler = nil)
    super(viewport)
    @battler = battler
    @battler_visible = false
    @effect_type = 0            # Effect type
    @effect_duration = 0        # Effect remaining time
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    if self.bitmap != nil
      self.bitmap.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if @battler == nil
      self.bitmap = nil
    else
      @use_sprite = @battler.use_sprite?
      if @use_sprite
        self.x = @battler.screen_x
        self.y = @battler.screen_y
        self.z = @battler.screen_z
        update_battler_bitmap
      end
      setup_new_effect
      update_effect
    end
  end
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Bitmap
  #--------------------------------------------------------------------------
  def update_battler_bitmap
    if @battler.battler_name != @battler_name or
       @battler.battler_hue != @battler_hue
      @battler_name = @battler.battler_name
      @battler_hue = @battler.battler_hue
      self.bitmap = Cache.battler(@battler_name, @battler_hue)
      @width = bitmap.width
      @height = bitmap.height
      self.ox = @width / 2
      self.oy = @height
      if @battler.dead? or @battler.hidden
        self.opacity = 0
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Set New Effect
  #--------------------------------------------------------------------------
  def setup_new_effect
    if @battler.white_flash
      @effect_type = WHITEN
      @effect_duration = 16
      @battler.white_flash = false
    end
    if @battler.blink
      @effect_type = BLINK
      @effect_duration = 20
      @battler.blink = false
    end
    if not @battler_visible and @battler.exist?
      @effect_type = APPEAR
      @effect_duration = 16
      @battler_visible = true
    end
    if @battler_visible and @battler.hidden
      @effect_type = DISAPPEAR
      @effect_duration = 32
      @battler_visible = false
    end
    if @battler.collapse
      @effect_type = COLLAPSE
      @effect_duration = 48
      @battler.collapse = false
      @battler_visible = false
    end
    if @battler.animation_id != 0
      animation = $data_animations[@battler.animation_id]
      mirror = @battler.animation_mirror
      start_animation(animation, mirror)
      @battler.animation_id = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Update Effect
  #--------------------------------------------------------------------------
  def update_effect
    if @effect_duration > 0
      @effect_duration -= 1
      case @effect_type
      when WHITEN
        update_whiten
      when BLINK
        update_blink
      when APPEAR
        update_appear
      when DISAPPEAR
        update_disappear
      when COLLAPSE
        update_collapse
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update White Flash Effect
  #--------------------------------------------------------------------------
  def update_whiten
    self.blend_type = 0
    self.color.set(255, 255, 255, 128)
    self.opacity = 255
    self.color.alpha = 128 - (16 - @effect_duration) * 10
  end
  #--------------------------------------------------------------------------
  # * Update Blink Effect
  #--------------------------------------------------------------------------
  def update_blink
    self.blend_type = 0
    self.color.set(0, 0, 0, 0)
    self.opacity = 255
    self.visible = (@effect_duration % 10 < 5)
  end
  #--------------------------------------------------------------------------
  # * Update Appearance Effect
  #--------------------------------------------------------------------------
  def update_appear
    self.blend_type = 0
    self.color.set(0, 0, 0, 0)
    self.opacity = (16 - @effect_duration) * 16
  end
  #--------------------------------------------------------------------------
  # * Updated Disappear Effect
  #--------------------------------------------------------------------------
  def update_disappear
    self.blend_type = 0
    self.color.set(0, 0, 0, 0)
    self.opacity = 256 - (32 - @effect_duration) * 10
  end
  #--------------------------------------------------------------------------
  # * Update Collapse Effect
  #--------------------------------------------------------------------------
  def update_collapse
    self.blend_type = 1
    self.color.set(255, 128, 128, 128)
    self.opacity = 256 - (48 - @effect_duration) * 6
  end
end
Title: Re: Bigger character when engage in battle
Post by: shintashi on October 19, 2011, 08:32:03 PM
is this VX? cause it doesn't look familiar.
request someone like Coz translate this


    if @battler.is_a?(Game_Actor)
        self.zoom_x = 1.20
        self.zoom_y = 1.20
    end


Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 20, 2011, 12:46:35 PM
yup! it is!
Title: Re: Bigger character when engage in battle
Post by: shintashi on October 20, 2011, 08:19:19 PM
Quote from: darkserge000 on October 20, 2011, 12:46:35 PM
yup! it is!

ahh, that explains it. You must always state which version you are using, because the scripts are not always compatible. I don't even have a copy of VX, but cozziekuns does. You should send them a pm with my four lines and see if they will work in your VX program.
Title: Re: Bigger character when engage in battle
Post by: darkserge000 on October 21, 2011, 12:44:30 PM
ah ok.. anyway, tnx..