[XP] Battle Icons

Started by Juan, August 22, 2008, 08:11:03 am

Previous topic - Next topic

Juan

August 22, 2008, 08:11:03 am Last Edit: May 02, 2016, 06:02:31 pm by Juan
Battle Icons
Authors: Juan
Version: 3.0
Type: Battle system add on
Key Term: Battle Add-on



Introduction

This script allows you have battle icons in the battle menu with a simple edit. And  icons on the pre fight menu ie Fight Escape


Features


  • Displays Icon

  • Easy Edit




Screenshots

Spoiler: ShowHide

Spoiler: ShowHide


Dont mind the screenshots didnt have time to find or make proper icons for pre fight menu just showing that it does work.


Demo

None atm can be added if requested.


Script

Spoiler: ShowHide

#===========================================================================
# ** Battle Icons
#------------------------------------------------------------------------------
# Juan
# Version 3.0
# Date 8/21/08
# Date Last Updated 5/2/16
# Custom Battle Icon
#===========================================================================
#
#
# Compatibility:
# This script is 100% compatibly with Tons of add-ons and sdk 2.3 with editing.
# This script is compatible with Blizzard's easy party switcher using battle
# command switch on. This script will need to go below easy party switcher
# and another icon for battle switching will be needed. Anything that
# overides Window_PartyCommands  def draw_item(index, color) will mean icons.
# and likely to need to be scripted to get the right position if new item is
# added to the pre fight commands. Not compatible with skill categories doesn't draw any icons at all...
#
#
#Features:
#
# ->  This script lets you use battle icons for prefight commands
# and commands when fighting.
# -> Easy edit
#
#Version History
#
#Version 1.0
#-> This script was first made
# Version 2.0
# -> Improved Coding
# -> This scipt is now compatible with tons of add-ons by Blizzard
# Version 3.0
# -> Now icons are available for the menu and now show on fight and escape
# commands.
# -> now compatible with Skill Categories by Game Guy
# -> now compatible with Easy party Switcher by Blizzard
# particularly when using battle switch options.
#
#
# Instructions
# Change this line in scene battle 1 line 30
# @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
# to @actor_command_window = Window_Battle_Command.new(160, [s1, s2, s3, s4])
# Then make icons called battle menu0 untill battle menu3 in the icons folder.
# Configure everything else below
#
#
#FAQ (Frequently Asked Questions):
#None so far
#
#
#Credits
# Juan
# Fantasist for suggesting I edit the pre fight command window to display icons too
#
#
#Author's Notes
#Any bugs
#Report them here:
#http://forum.chaos-project.com/index.php?topic=11.0
#or
#Email me
# Juanito119@yahoo.com
#Thats it
#enjoy

module Juan_Cfg
# How many commands you want icons for by default its 3
Battle_Icons_Amount = 3
# Name of the icon for the battle menu with number at the end starting from 0.
Battle_Icons_Name = "battle_menu"
# Do you want to enable support for the prebattle command?
Party_Window = true
# name of the party icons if party window is enabled with index from 0
Party_Icons_Name = "party_menu"
end

#===========================================================================
# Window_Battle_Command
#===========================================================================

class Window_Battle_Command < Window_Command

  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.font.color = color
    # if command is greater than the amount specfiied in battle icons
    # amount dont draw icon.
    # this line is for compatabilty with Skill Categories by Game Guy from
    # Chaos Project
    if index > Juan_Cfg::Battle_Icons_Amount   
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
    else   
    self.contents.blt(4, 4 + index*32, RPG::Cache.icon("#{Juan_Cfg::Battle_Icons_Name}#{index}"),
    Rect.new(0, 0, 24, 24))
    self.contents.draw_text(32, index*32, 148, 32, @commands[index])
    end
  end

end

if Juan_Cfg::Party_Window
#==============================================================================
# ** Window_PartyCommand
#------------------------------------------------------------------------------
#  This window is used to select whether to fight or escape on the battle
#  screen.
#==============================================================================
#$easy_party_switcher
class Window_PartyCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text character color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    if $easy_party_switcher && $game_system.battle_switch
    self.contents.blt(84 + index * 160, 6,
    RPG::Cache.icon("#{Juan_Cfg::Party_Icons_Name}#{index}"),
    Rect.new(0, 0, 24, 24))
    self.contents.draw_text(80 + index * 160 + 4, 0, 128 - 10, 32, @commands[index], 1)
    else     
    self.contents.blt(163 + index * 160, 6,
    RPG::Cache.icon("#{Juan_Cfg::Party_Icons_Name}#{index}"),
    Rect.new(0, 0, 24, 24))
    self.contents.draw_text(160 + index * 160, 0, 128, 32, @commands[index], 1)
      end
    end
  end
end





Instructions
Change this line in scene battle 1 line 30
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
to @actor_command_window = Window_Battle_Command.new(160, [s1, s2, s3, s4])
Then make icons called battle menu0 untill battle menu3 in the icons folder. If using party window
just make icons named party_menu starting from 0 to 1 assuming you only have default scripts. If using easy party switcher by Blizzard this script goes below that one if using party switch option and party window enabled.
Configure everything else in the script.


Compatibility

This script is 100% compatibly with Tons of add-ons and sdk 2.3 with editing.
This script is compatable with Blizzard's easy party switcher using battle
command switch on. This script will need to go below easy party switcher
and another icon for battle switching will be needed. Anything that
overides Window_PartyCommands  def draw_item(index, color) will mean icons.
and likely to need to be scripted to get the right position if new item is
added to the pre fight commands. Not compatible with skill categories doesn't draw any icons at all...


Credits and Thanks


  • Juan

  • Fantasist for suggesting I edit the pre fight command window to display icons too




Author's Notes

Any bug post in this topic or send me an email at Juanito119@yahoo.com
Dropbox Who need luck when you can make your own.
3ds Friend code: ShowHide
 4468 1422  6617

Fantasist

Ah, nice job Juan, though I have a small hint. The method "start_phase1" in Scene_Battle gets executed once before battle starts, see if you can replace the command window there ;)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Calintz

Very simple, but very intuitive. I love it, and this will be a sure thing in my game. Thanks Juan

Juan

Dropbox Who need luck when you can make your own.
3ds Friend code: ShowHide
 4468 1422  6617

legacyblade

Great script. It's small and simple enough to take very few lines of code, yet it improves the visual quality of the ugly DBS. Great job, I'm sure all the DBS users for RMXP will love you for this script.

Calintz

Well put LegacyBlade...

BTW:
I love your new avy. Very clean...

legacyblade

(I was trying to use RMXP keywords to increase the search engine rating >_>)

and my avi? Thanks. I like meh avatar.