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.

Individual Troop Battlebacks

PK8

Member

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
m9ng3t.png

Fighting Troop ID 1 in a modified grassland battleback.

Demo
No demo.

Script
Ruby:
<span style="color:#000080; font-style:italic;">=begin

<span style="color:#000080; font-style:italic;">╔══════════════════════════════════════════════════════════════════════════════╗

<span style="color:#000080; font-style:italic;">║ Individual Troop Battleback                                                  ║

<span style="color:#000080; font-style:italic;">║ by PK8                                                                       ║

<span style="color:#000080; font-style:italic;">║ September 28th, 2009                                                         ║

<span style="color:#000080; font-style:italic;">║ [url=http://rmvxp.com]http://rmvxp.com[/url]                                                             ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ Table of Contents                                                          ║

<span style="color:#000080; font-style:italic;">║ ├─ Author's Notes                - Line 16─18                                ║

<span style="color:#000080; font-style:italic;">║ ├─ Introduction & Description    - Line 20─23                                ║

<span style="color:#000080; font-style:italic;">║ ├─ Features                      - Line 25─27                                ║

<span style="color:#000080; font-style:italic;">║ ├─ How to Use                    - Line 29─38                                ║

<span style="color:#000080; font-style:italic;">║ ├─ Methods Aliased               - Line 40,41                                ║

<span style="color:#000080; font-style:italic;">║ └─ Thanks                        - Line 43,44                                ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ Author's Notes                                                             ║

<span style="color:#000080; font-style:italic;">║ This script was requested by a user in HBGames.org's IRC channel and I was   ║

<span style="color:#000080; font-style:italic;">║ interested in creating this script so... here you go!                        ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ Introduction & Description                                                 ║

<span style="color:#000080; font-style:italic;">║ This script allows game makers to give a specific Troop ID their own         ║

<span style="color:#000080; font-style:italic;">║ battleback and other stuff (hue, mirror, tone). I'm not sure what it would be║

<span style="color:#000080; font-style:italic;">║ useful for, actually.                                                        ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ Features                                                                   ║

<span style="color:#000080; font-style:italic;">║ ─ Give a specific troop ID their own battleback.                             ║

<span style="color:#000080; font-style:italic;">║ ─ Set battleback file, hue, mirror and tone.                                 ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ How to Use                                                                 ║

<span style="color:#000080; font-style:italic;">║ To give a troop ID their own battle theme, simply type this:                 ║

<span style="color:#000080; font-style:italic;">║ Troops_BB[id] = [file, hue, mirror, [red, green, blue, sat]]                 ║

<span style="color:#000080; font-style:italic;">║ file: Battleback Graphic name. (Should be in Graphics/Battlebacks directory) ║

<span style="color:#000080; font-style:italic;">║ hue:    Set battleback's hue.               [Min: 0 - Max: 360]              ║

<span style="color:#000080; font-style:italic;">║ mirror: Flip battleback horizontally?       [true or false]                  ║

<span style="color:#000080; font-style:italic;">║ red:    Set amount of red in battleback.    [Min: -255 - Max: 255]           ║

<span style="color:#000080; font-style:italic;">║ green:  Set amount of green in battleback.  [Min: -255 - Max: 255]           ║

<span style="color:#000080; font-style:italic;">║ blue:   Set amount of blue in battleback.   [Min: -255 - Max: 255]           ║

<span style="color:#000080; font-style:italic;">║ sat:    Set battleback saturation.          [Min: 0 - Max: 255 (grey)]       ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ Methods Aliased                                                            ║

<span style="color:#000080; font-style:italic;">║ ─ initialize of Spriteset_Battle                                             ║

<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢

<span style="color:#000080; font-style:italic;">║ ■ Thanks                                                                     ║

<span style="color:#000080; font-style:italic;">║ ─ JoeYoung requested something like this in the HBGames.org's IRC channel.   ║

<span style="color:#000080; font-style:italic;">╚══════════════════════════════════════════════════════════════════════════════╝

<span style="color:#000080; font-style:italic;">=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.com and HBGames.org.
 
OOOOOoooo, I like what youve done with this. This makes alot more options for battle backs, without having to make lots more, and it can be set for individual troops... SWEET!
 

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