state icons in battle

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
57
Reaction score
0
First Language
English
Primarily Uses
RMXP
i have this script for changing the states from names to icons
Code:
#--------------------------------------------------------------------------
  # Window_Base.draw_actor_state Modification
  #--------------------------------------------------------------------------
  # * Draw State
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    # calc space
    if actor.states.size > 5
      space = ((width - 24) / (actor.states.size - 1)).floor
    else
      space = ((width - 24 * 5) / 4).floor + 24
    end
    # draw states
    for i in actor.states
      if $data_states[i].rating >= 1
        bitmap = RPG::Cache.icon("state_" + $data_states[i].name)
        src_rect = Rect.new(0, 0, 24, 24)
        self.contents.blt(x, y + 6, bitmap, src_rect, 170)
        x += space
      end
    end
  end
but that only works for the actors. help me, how do i work the same thing to the enemies???
 

alaky

Villager
Member
Joined
Oct 16, 2015
Messages
14
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
Hello there, this scipt might help you.
 

alaky

Villager
Member
Joined
Oct 16, 2015
Messages
14
Reaction score
0
First Language
Portuguese
Primarily Uses
RMVXA
Sorry man, didn't see that you used XP. I hope you find a solution soon =/
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
57
Reaction score
0
First Language
English
Primarily Uses
RMXP
@alaky next time look into the catagory more carefully.
dangit! @KK20 where are you when i need you most!...
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
170
Reaction score
62
First Language
English
Primarily Uses
RMXP
I would use Blizzard's Tons of Add-ons as it contains a script that replaces status names with icons for both battlers.

Use this thread as a reference on where to import all 3 parts:

alaky next time look into the catagory more carefully.
This doesn't really apply because the board you posted in is for all RPG Makers that use RGSS (XP, VX, VXA). It wasn't entirely obvious that this request was for XP though.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
57
Reaction score
0
First Language
English
Primarily Uses
RMXP
@KK20 i found the thing
Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Status Effects as Icons by Blizzard
# Version: 1.2b
# Type: Game Design Improvement
# Date: 30.4.2007
# Date v1.0b: 17.11.2007
# Date v1.1b: 13.7.2008
# Date v1.2b: 19.10.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# new in v1.0b:
#   - added possibility that status effects are excluded from icons
#   - now beta
#
# new in v1.1b:
#   - fixed a bug caused by a typing mistake
#
# new in v1.2b:
#   - improved system
#
#
# Explanation:
#
#   This add-on will modify your game so no status text is displayed, but icons
#   instead. Note that you need to use default icon size of 24x24. Import the
#   icons into the new folder inside the default icon folder and name them like
#   the status effects, but type everything in lower case. The new folder has
#   to be named "State" so the path would be "Graphics/Icons/State/name.png".
#   In SPECIAL_EFFECTS include all the IDs from status effects that will
#   override the usual icon display and force the display of their name in the
#   default way of displaying.
#   If you want a status effect to have no icon at all, set its rating value in
#   the database to 0.
#
#   Example:
#   
#     status effect name: "Painful Distortion"
#     icon file name:     "State/painful distortion.png"
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

SPECIAL_EFFECTS = []

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
#==============================================================================
# Window_Base
#==============================================================================
 
class Window_Base
 
  alias draw_actor_state_icons_later draw_actor_state
  def draw_actor_state(actor, x, y, width = 120)
    if $game_system.STATUS_ICONS
      if actor != nil
        actor.states.each {|id|
            if SPECIAL_EFFECTS.include?(id)
              text = "[#{$data_states[id].name}]"
              self.contents.font.color = actor.dead? ? knockout_color : normal_color
              self.contents.draw_text(x, y, width, 32, text)
              return
            end}
        s = actor.states.find_all {|id| $data_states[id].rating > 0}
        s.each_index {|i|
            break if i*28 > width
            icon = RPG::Cache.icon("State/#{$data_states[s[i]].name.downcase}")
            self.contents.blt(x+2+i*28, y+4, icon, Rect.new(0, 0, 24, 24))}
      end
    else
      draw_actor_state_icons_later(actor, x, y, width)
    end
  end
 
end

#==============================================================================
# Window_Help
#==============================================================================
 
class Window_Help
 
  alias set_enemy_state_icons_later set_enemy
  def set_enemy(enemy)
    if !$game_system.STATUS_ICONS || $game_system.ENEMY_STATUS ||
        enemy.states.size == 0
      set_enemy_state_icons_later(enemy)
      return
    end
    text = enemy.name
    s = enemy.states.find_all {|id| $data_states[id].rating > 0}
    if s.size*28 + self.contents.text_size(text).width > self.contents.width
      width = self.contents.width/self.contents.text_size(' ').width
    else
      width = s.size*28/self.contents.text_size(' ').width
    end
    (0...width).each {|i| text += ' '}
    if @text != text || @align != 1
      enemy.states.each {|id|
          if SPECIAL_EFFECTS.include?(id)
            set_text("#{enemy.name}  [#{$data_states[id].name}]", 1)
            return
          end}
      set_text(text, 1)
      x = self.contents.width/2 - width/2
      s.each_index {|i|
          break if x+2+i*28 > self.contents.width
          icon = RPG::Cache.icon("State/#{$data_states[s[i]].name.downcase}")
          self.contents.blt(x+2+i*28, 4, icon, Rect.new(0, 0, 24, 24))}
    end
  end

end
but where do i put in the script section and how it works???
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
170
Reaction score
62
First Language
English
Primarily Uses
RMXP
Read the script instructions--it's clearly defined. And you need to have all three parts of ToA installed.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

just spent FOREVER troubleshooting an issue with my keyboard... turns out the cord was just loose OTL
I count on someone one time, I let them promise something to me, and one week later it's complete silence as I'm completely let down. I hate everything.
Everytime I need to write dialogues I find myself writing new music pieces... what kind of trick is this?!
Me Being Dumb spending hrs trying to figure out Irenas Visual Novel busts plugin..lol. I'm probably missing something stupid and obvious xDD

let the journey begin >w>
X.X ok... I guess I'll just have to think about 48x48 a little differently. Its not "room for more work"..."its room for more detail!...yay"

Forum statistics

Threads
99,218
Messages
963,167
Members
130,807
Latest member
NotADev
Top