Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Individual Troop Battlebacks
#1
Individual Troop Battlebacks
Version: 1

Introduction
This script allows game makers to give a specific Troop ID their own battleback and other stuff (hue, mirror, tone). I'm not sure what it would be useful for, actually.

Features
  • Give a specific troop ID their own battleback.
  • Set battleback file, hue, mirror and tone.

Screenshots
[Image: m9ng3t.png]
Fighting Troop ID 1 in a modified grassland battleback.

Demo
No demo.

Script
Code:
=begin
????????????????????????????????????????????????????????????????????????????????
? Individual Troop Battleback                                                  ?
? by PK8                                                                       ?
? September 28th, 2009                                                         ?
? http://rmvxp.com                                                             ?
????????????????????????????????????????????????????????????????????????????????
? ? Table of Contents                                                          ?
? ?? Author's Notes                - Line 16?18                                ?
? ?? Introduction & Description    - Line 20?23                                ?
? ?? Features                      - Line 25?27                                ?
? ?? How to Use                    - Line 29?38                                ?
? ?? Methods Aliased               - Line 40,41                                ?
? ?? Thanks                        - Line 43,44                                ?
????????????????????????????????????????????????????????????????????????????????
? ? Author's Notes                                                             ?
? This script was requested by a user in HBGames.org's IRC channel and I was   ?
? interested in creating this script so... here you go!                        ?
????????????????????????????????????????????????????????????????????????????????
? ? Introduction & Description                                                 ?
? This script allows game makers to give a specific Troop ID their own         ?
? battleback and other stuff (hue, mirror, tone). I'm not sure what it would be?
? useful for, actually.                                                        ?
????????????????????????????????????????????????????????????????????????????????
? ? Features                                                                   ?
? ? Give a specific troop ID their own battleback.                             ?
? ? Set battleback file, hue, mirror and tone.                                 ?
????????????????????????????????????????????????????????????????????????????????
? ? How to Use                                                                 ?
? To give a troop ID their own battle theme, simply type this:                 ?
? Troops_BB[id] = [file, hue, mirror, [red, green, blue, sat]]                 ?
? file: Battleback Graphic name. (Should be in Graphics/Battlebacks directory) ?
? hue:    Set battleback's hue.               [Min: 0 - Max: 360]              ?
? mirror: Flip battleback horizontally?       [true or false]                  ?
? red:    Set amount of red in battleback.    [Min: -255 - Max: 255]           ?
? green:  Set amount of green in battleback.  [Min: -255 - Max: 255]           ?
? blue:   Set amount of blue in battleback.   [Min: -255 - Max: 255]           ?
? sat:    Set battleback saturation.          [Min: 0 - Max: 255 (grey)]       ?
????????????????????????????????????????????????????????????????????????????????
? ? Methods Aliased                                                            ?
? ? initialize of Spriteset_Battle                                             ?
????????????????????????????????????????????????????????????????????????????????
? ? Thanks                                                                     ?
? ? JoeYoung requested something like this in the HBGames.org's IRC channel.   ?
????????????????????????????????????????????????????????????????????????????????
=end

#------------------------------------------------------------------------------
# * Customise
#------------------------------------------------------------------------------
class PK8
  Troops_BB = {} # Do not touch this.
  
  #       [id] = [Battleback, Hue, Flip, [Red, Green, Blue, Sat] ]
  Troops_BB[1] = ["005-Beach01", 0, true, [0, 0, 0, 0]]
end

#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================
class Spriteset_Battle
  alias_method(:pk8_troops_bb_initialize, :initialize)
  def initialize
    start_troop_battleback1
    pk8_troops_bb_initialize
    start_troop_battleback2
  end
  
  #----------------------------------------------------------------------------
  # * Start Troop BattleBack 1
  #----------------------------------------------------------------------------
  def start_troop_battleback1
    PK8::Troops_BB.each_key { | i |
    # If Troop ID equals the key.
    if $game_temp.battle_troop_id == i
      # If specified battleback File isn't nil or empty.
      if PK8::Troops_BB[i][0] != nil and !PK8::Troops_BB[i][0].empty?
        $game_temp.battleback_name = PK8::Troops_BB[i][0]
      end
      break
    end }
  end
  
  #----------------------------------------------------------------------------
  # * Start Troop BattleBack 2
  #----------------------------------------------------------------------------
  def start_troop_battleback2
    PK8::Troops_BB.each_key { | i |
    # If Troop ID equals the key.
    if $game_temp.battle_troop_id == i
      # Sets Battleback's hue to 0 if nil.
      PK8::Troops_BB[i][1] = 0 if PK8::Troops_BB[i][1] == nil
      # If mirror is set to nil, sets it to false.
      PK8::Troops_BB[i][2] = false if PK8::Troops_BB[i][2] == nil
      # Sets tone to [0, 0, 0, 0] if battleback's tone is nil.
      PK8::Troops_BB[i][3] = [0, 0, 0, 0] if PK8::Troops_BB[i][3] == nil
      # Sets battleback's red tone to 0 if nil
      PK8::Troops_BB[i][3][0] = 0 if PK8::Troops_BB[i][3][0] == nil
      # Sets battleback's green tone to 0 if nil
      PK8::Troops_BB[i][3][1] = 0 if PK8::Troops_BB[i][3][1] == nil
      # Sets battleback's blue tone to 0 if nil
      PK8::Troops_BB[i][3][2] = 0 if PK8::Troops_BB[i][3][2] == nil
      # Sets battleback's saturation to 0 if nil
      PK8::Troops_BB[i][3][3] = 0 if PK8::Troops_BB[i][3][3] == nil
      # Changing Hue
      @battleback_sprite.bitmap.hue_change(PK8::Troops_BB[i][1])
      # Flipping battleback?
      @battleback_sprite.mirror = PK8::Troops_BB[i][2]
      # Changing Tone
      @battleback_sprite.tone = Tone.new(PK8::Troops_BB[i][3][0],
      PK8::Troops_BB[i][3][1], PK8::Troops_BB[i][3][2], PK8::Troops_BB[i][3][3])
      break
    end }
  end
end

Instructions
Instructions are in the script.

FAQ
Awaiting question.

Compatibility
I'm not sure if it's compatible with any battle-related scripts or the SDK. Aliases Spriteset_Battle's initialize.

Credits and Thanks
JoeYoung for requesting something like this in HBGames.org's IRC channel.

Author's Notes
This script was requested by someone, I was interested, voila! :P

Terms and Conditions
Exclusive to RMVXP.co.cc and HBGames.org.
Reply }


Messages In This Thread
Individual Troop Battlebacks - by PK8 - 09-29-2009, 03:07 AM
Individual Troop Battlebacks - by Yin - 09-29-2009, 06:40 AM
Individual Troop Battlebacks - by Alpha-Mad - 09-29-2009, 12:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Troop : Self-Switches Kain Nobel 0 4,074 06-03-2016, 09:40 AM
Last Post: Kain Nobel
   Individual Battle Commands by Charlie Fleed, Version 1.0 Charlie Fleed 3 10,319 01-25-2014, 12:15 PM
Last Post: Charlie Fleed
   Troop : Self Switches Kain Nobel 1 5,196 02-02-2013, 01:07 PM
Last Post: yamina-chan
   Individual Battle Commands RPG Advocate 4 9,828 10-09-2011, 04:44 AM
Last Post: DerVVulfman
   Advanced Individual Battle Commands Trickster 6 14,574 01-29-2011, 04:30 AM
Last Post: DerVVulfman
   Individual Equipment Fix syvkal 1 5,767 10-24-2009, 12:38 AM
Last Post: Archeia
   Individual Troop Themes XP PK8 5 9,040 10-03-2009, 06:36 PM
Last Post: Alpha-Mad
   Individual Troop Victory MEs PK8 1 5,487 09-29-2009, 06:18 AM
Last Post: Yin
   Individual Troop Themes VX PK8 0 4,213 09-29-2009, 01:26 AM
Last Post: PK8
   Battlebacks VX DerVVulfman 0 4,507 03-06-2008, 04:18 AM
Last Post: DerVVulfman



Users browsing this thread: