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.

Status change battler picture

Hello guys,

I am requesting a script that will change a battler's picture according to the status
(eg.when an actor is in the status of poison, his battler picture will change into another picture that shows he is being poisoned)

I am using RMXP, THANKS!!!
 
MCsephiroth13":3tszfbkx said:
Just do Conditional Branch if Actor State Poison is inflicted, change battler picture. Set this Condition in all of your troops.

I'm afraid that this is going to mess my things up...(just too many craps in my troops XD)
so I hope that it can be done by scripting

does anyone have this kind of script?
 

Atoa

Member

With this script you can change battler and character graphic

StateImageBattlers[State ID] = Hash.new('File Name')
StateImageBattlers[State ID][Actor ID] = Hash.new('File Name')

StateImageCharacters[State ID] = Hash.new('File Name')
StateImageCharacters[State ID][Actor ID] = Hash.new('File Name')

Code:
#==========================================================================

# Status Image Change

# by SandGolem

#==========================================================================

 

module SG

  StateImageBattlers = {} #Dont change

  StateImageCharacters = {} #Dont change

 

  StateImageBattlers[3] = Hash.new('088-Monster02')

  StateImageBattlers[3][8] = '089-Monster03'

  StateImageCharacters[3] = Hash.new('088-Monster02')

  StateImageCharacters[3][8] = '089-Monster03'

end

 

SG::StateImages = SG::StateImageBattlers.keys

 

#==============================================================================

# ? Game_Actor

#==============================================================================

class Game_Actor < Game_Battler

  #--------------------------------------------------------------------------

  if !@alias_sg_stateimages

    alias sg_stateimages_add add_state

    alias sg_stateimages_remove remove_state

    @alias_sg_stateimages = true

  end

  #--------------------------------------------------------------------------

  def add_state(state_id,force = false)

    sg_stateimages_setrevert

    sg_stateimages_add(state_id,force)

    if SG::StateImages.include?(state_id)

      if SG::StateImageBattlers[state_id][@actor_id] != ''

        @battler_name = SG::StateImageBattlers[state_id][@actor_id]

        @battler_hue = 0

      end

      if SG::StateImageCharacters[state_id][@actor_id] != ''

        @character_name = SG::StateImageCharacters[state_id][@actor_id]

        @character_hue = 0

      end

      $game_player.refresh

    end

  end

  #--------------------------------------------------------------------------

  def remove_state(state_id,force = false)

    begin

      sg_stateimages_remove(state_id,force)

    rescue

    end

    sg_stateimages_revert

  end

  #--------------------------------------------------------------------------

  def sg_stateimages_revert

    for i in 0...SG::StateImages.size

      return if state?(SG::StateImages[i])

    end

    return if @sg_staterevert_battler == nil

    @battler_name = @sg_staterevert_battler

    @battler_hue = @sg_staterevert_battlerhue

    @character_name = @sg_staterevert_character

    @character_hue = @sg_staterevert_characterhue

    $game_player.refresh

  end

  #--------------------------------------------------------------------------

  def sg_stateimages_setrevert

    for i in 0...SG::StateImages.size

      return if state?(SG::StateImages[i])

    end

    @sg_staterevert_battler = @battler_name

    @sg_staterevert_battlerhue = @battler_hue

    @sg_staterevert_character = @character_name

    @sg_staterevert_characterhue = @character_hue

    $game_player.refresh

  end

end
 

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