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.

Could someone please mod the Battle Status window for me?

Status
Not open for further replies.
http://i127.photobucket.com/albums/p142 ... enshot.jpg[/IMG]

Next to where states are shown (the red boxes in my screenshot) I would like to have the value of a variable specified for each actor displayed when a specified switch is on. Actor #1 will be using variable 0026, and actor #2 will use 0027, etc etc up to actor #8. And the switch I'll probably use is 0048.
The variables will be updated throughout the battle, so please make sure the variable display refreshes itself.
Also, I'd appreciate it if you commented on it well enough that I could change the variables and make other minor adjustments by myself without any trouble.

Thanks for looking, and thanks to whoever does this for me.
 
Like this?

Code:
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================

# DO NOT include zero prefixes for IDs (e.g. 1 NOT 0001)
# Activator switch ID
SWITCH_ID = 1
# Assign each variable for each actor using format:
# actor_id => variable_id
VARIABLE_ID = 
{
1 => 1,
2 => 2,
7 => 7,
8 => 8
}

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
      self.contents.font.color = normal_color
      # If switch is activated...
      if $game_switches[SWITCH_ID]
        # ONLY If this actor has variable
        if VARIABLE_ID.include?(actor.id)
          # Draw variable value
          var_val = $game_variables[VARIABLE_ID[actor.id]].to_s
          # Change x and width value (first and third parameter) as necessary
          # if the text cuts off or overlaps with another
          self.contents.draw_text(actor_x + 88, 96, 32, 32, var_val, 2)
        end
      end
    end
  end
end

Your states should not be too long or they will overlap with the variables (I can't check it since I don't know the names). I also don't know how long the variable values will be, so I leave to you to edit the position and width of the text (commented as you ask).
 
This topic has been resolved. If Vinderex or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

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