Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
(Sorry if this is the wrong section. There was no link in the "Script requests go here" description, so I assumed this was the correct section)

I'm interested in implementing a VERY simple HUD into a Friday the 13th fan game I'm making and wanted to see what it'd cost to have someone make it. Here is a rough idea of what I'm looking for.

HUDsnip1.png
HUDsnip2.png

That is literally all I need, perhaps with some kind of simple graphic (see below). This game doesn't use MP/TP, experience points, levels, or money, so none of that needs to be included. The only caveat is I don't want it displayed if there is more than 1 person in the party, as the game is story-based and Formation and party line-up don't really exist (the ability to turn it on/off with a switch would be ideal).

As to the simple graphic, I was thinking something along the lines of what is used in Fatal Frame II, except there'd be no need for anything except the portrait and HP bar.


Thanks.
 

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
2,164
Reaction score
4,086
First Language
English
Primarily Uses
RMVXA
There are a bunch of HUD scripts for Ace. Little confused, though, since you seem to be using entirely MV/MZ graphics, but this is posted in the Ace forum. Can you clarify which one you're using?
 
Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
VX Ace engine, but MV characters. I found a bust script I liked but wasn't able to make the MV created bust match VX Ace created characters, so I ended up making them in MV but using Ace for everything else.

EDIT: I looked for Ace HUD scripts, but haven't been able to find one that allows for ONLY a simple portrait and the HP bar to be displayed. Most of the ones I've been able to find add a ton of info that simply isn't needed.

ALSO, while I'm on the subject, does anybody happen to know how to tweak the menu a bit so that the HP bar is a little lower than default? HP in this game is called 'Life' and I'm trying to add a bit more distance between the label and the bar.
 
Last edited:

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
2,164
Reaction score
4,086
First Language
English
Primarily Uses
RMVXA
I looked for Ace HUD scripts, but haven't been able to find one that allows for ONLY a simple portrait and the HP bar to be displayed.
Mog's script allows you to remove anything using the script settings. Don't even need to edit the core script.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,369
Reaction score
799
First Language
English
Primarily Uses
RMVXA
EDIT: I looked for Ace HUD scripts, but haven't been able to find one that allows for ONLY a simple portrait and the HP bar to be displayed. Most of the ones I've been able to find add a ton of info that simply isn't needed.
I just finished writing one, but I added in all the extra info. However it can be removed.
I can modify what I just made to only have the bar as I assume you don't want to see the health numbers.

*edit
does this work for you?
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor HUD on Map             ║  Version: 1.01a    ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║ Trimmed down version                ╠════════════════════╣
# ║ Show a HUD on the map               ║    10 Oct 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to display actor data on screen                   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Adjust the settings to your preference                 ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝
$imported ||= {}

module Vocab
  Exp_s = "EXP"
end
module R2_MAP_HUD
  # Configure options
 
  Hud_X         = 0      # Hud Position
  Hud_Y         = 300     # Hud Position
  Hud_Width     = 300     # Hud Width
  Hud_Height    = 120     # Hud Height
 
  Actor_Shown   = 0       # 0 = party leader, 1 = first follower
 
  Key_Cycle     = :CTRL   # Key to cycle actors
  Use_Cycle     = false   # Option to use cycle control
 
  Show_Face     = true    # Show face graphic
  Face_X        = 0       # Face graphic X position
  Face_Y        = 0       # Face graphic Y position
  Face_Index    = 0       # Index of face Graphic

  Show_HP       = true    # Show HP bar
  HP_X          = 120     # HP bar X position
  HP_Y          = 50      # HP bar Y position
  HP_Width      = 124     # HP bar width
  HP_Height     = 20      # HP bar heigth 
  # requires Vlue Sleek gauges
  # add these lines to vlue sleek gauges
  #  $imported ||= {}
  #  $imported["vlue_sleek_gauges"] = 1.0
  
  HP_Color1     = 22      # Set the HP color
  HP_Color2     = 26      # Set the HP color
 
  Window_Opacity      = 0         # window visibility, does not affect contents
  Window_Back_Opacity = 0         # Window background opacity
  Window_Graphic      = "Window"  # Window Graphic file to use
 
  Font          = "Arial"
  Font_Size     = 20
 
end
# ╔══════════════════════════════════════════════════════════╗
# ║ End of Configuration                                     ║
# ╚══════════════════════════════════════════════════════════╝

class Actor_Hud_Window < Window_Base
  def initialize
    x = R2_MAP_HUD::Hud_X
    y = R2_MAP_HUD::Hud_Y
    w = R2_MAP_HUD::Hud_Width
    h = R2_MAP_HUD::Hud_Height
    super(x,y,w,h)
    self.windowskin = Cache.system(R2_MAP_HUD::Window_Graphic)
    self.opacity = R2_MAP_HUD::Window_Opacity
    self.back_opacity = R2_MAP_HUD::Window_Back_Opacity
    self.contents_opacity = 255
    @current_actor = R2_MAP_HUD::Actor_Shown if @current_actor.nil?
    @old_actor = 0
    @actor = $game_party.leader
    @current_hp = @actor.hp
    refresh
  end
 
  def actor_data
    @old_actor = @current_actor
    @actor = $game_party.members[@current_actor]
    face = R2_MAP_HUD::Face_Index > 0 ? R2_MAP_HUD::Face_Index : @actor.face_index
    # actor image
    draw_face(@actor.face_name, face, R2_MAP_HUD::Face_X, R2_MAP_HUD::Face_Y, enabled = true) if R2_MAP_HUD::Show_Face
    width = R2_MAP_HUD::HP_Width
    draw_actor_hud_hp(@actor, R2_MAP_HUD::HP_X, R2_MAP_HUD::HP_Y, width) if R2_MAP_HUD::Show_HP
    @current_hp = @actor.hp
  end
 
  def draw_actor_hud_hp(actor, x, y, width = 124, height = R2_MAP_HUD::HP_Height)
    color1 = text_color(R2_MAP_HUD::HP_Color1)
    color2 = text_color(R2_MAP_HUD::HP_Color2)
    if !$imported["vlue_sleek_gauges"]
      draw_gauge(x, y, width, actor.hp_rate, color1, color2)
    else
      draw_gauge(x, y, width, actor.hp_rate, color1, color2, height)
    end
  end

  def refresh
    self.contents.clear
    font = R2_MAP_HUD::Font
    font_size = R2_MAP_HUD::Font_Size
    self.contents.font = Font.new(font, font_size)
    actor_data
  end
 
  def hud_data_changed
    return true if @current_actor != @old_actor
    return true if @current_hp != @actor.hp
    return false
  end
 
  def update
    super
    refresh if hud_data_changed
  end
 
  def switch_actor
    @old_actor = @current_actor
    @current_actor += 1
    if @current_actor > ($game_party.members.size - 1 )
      @current_actor = 0
    end
    update
  end
  def c_actor
    return @current_actor
  end
end

class Scene_Map < Scene_Base
  alias r2_map_hud_start  start
  def start
    r2_map_hud_start
    start_hud
  end
  def start_hud
    @actor_shown = R2_MAP_HUD::Actor_Shown == 0 ? $game_party.leader : $game_party.members[R2_MAP_HUD::Actor_Shown]
    @map_hud = Actor_Hud_Window.new
  end
  alias r2_map_update_switch_actor    update
  def update
    r2_map_update_switch_actor
    if Input.trigger?(R2_MAP_HUD::Key_Cycle)
      @map_hud.switch_actor if R2_MAP_HUD::Use_Cycle
    end
  end
  def hud_update
    @map_hud.refresh
  end
end
 
Last edited:
Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
I just finished writing one, but I added in all the extra info. However it can be removed.
I can modify what I just made to only have the bar as I assume you don't want to see the health numbers.

*edit
does this work for you?
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor HUD on Map             ║  Version: 1.00a    ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║ Trimmed down version                ╠════════════════════╣
# ║ Show a HUD on the map               ║    10 Oct 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to display actor data on screen                   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Adjust the settings to your preference                 ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝
module Vocab
  Exp_s = "EXP"
end
module R2_MAP_HUD
  # Configure options
 
  Hud_X         = 0      # Hud Position
  Hud_Y         = 300     # Hud Position
  Hud_Width     = 300     # Hud Width
  Hud_Height    = 120     # Hud Height
 
  Actor_Shown   = 0       # 0 = party leader, 1 = first follower
 
  Key_Cycle     = :CTRL   # Key to cycle actors
  Use_Cycle     = false   # Option to use cycle control
 
  Show_Face     = true    # Show face graphic
  Face_X        = 0       # Face graphic X position
  Face_Y        = 0       # Face graphic Y position
  Face_Index    = 0       # Index of face Graphic

  Show_HP       = true    # Show HP bar
  HP_X          = 120     # HP bar X position
  HP_Y          = 50      # HP bar Y position
  HP_Width      = 124     # HP bar width
  HP_Height     = 20      # HP bar heigth # requires Vlue Sleek gauges
  HP_Color1     = 22      # Set the HP color
  HP_Color2     = 26      # Set the HP color
 
  Window_Opacity      = 0         # window visibility, does not affect contents
  Window_Back_Opacity = 0         # Window background opacity
  Window_Graphic      = "Window"  # Window Graphic file to use
 
  Font          = "Arial"
  Font_Size     = 20
 
end
# ╔══════════════════════════════════════════════════════════╗
# ║ End of Configuration                                     ║
# ╚══════════════════════════════════════════════════════════╝

class Actor_Hud_Window < Window_Base
  attr_reader :gauges
  def initialize
    x = R2_MAP_HUD::Hud_X
    y = R2_MAP_HUD::Hud_Y
    w = R2_MAP_HUD::Hud_Width
    h = R2_MAP_HUD::Hud_Height
    super(x,y,w,h)
    self.windowskin = Cache.system(R2_MAP_HUD::Window_Graphic)
    self.opacity = R2_MAP_HUD::Window_Opacity
    self.back_opacity = R2_MAP_HUD::Window_Back_Opacity
    self.contents_opacity = 255
    @current_actor = R2_MAP_HUD::Actor_Shown if @current_actor.nil?
    @old_actor = 0
    @actor = $game_party.leader
    refresh
  end
 
  def actor_data
    @old_actor = @current_actor
    @actor = $game_party.members[@current_actor]
    face = R2_MAP_HUD::Face_Index > 0 ? R2_MAP_HUD::Face_Index : @actor.face_index
    # actor image
    draw_face(@actor.face_name, face, R2_MAP_HUD::Face_X, R2_MAP_HUD::Face_Y, enabled = true) if R2_MAP_HUD::Show_Face
    width = R2_MAP_HUD::HP_Width
    draw_actor_hud_hp(@actor, R2_MAP_HUD::HP_X, R2_MAP_HUD::HP_Y, width) if R2_MAP_HUD::Show_HP
  end
 
  def draw_actor_hud_hp(actor, x, y, width = 124, height = R2_MAP_HUD::HP_Height)
    color1 = text_color(R2_MAP_HUD::HP_Color1)
    color2 = text_color(R2_MAP_HUD::HP_Color2)
    if SPECIAL_GAUGES::DEFAULT_HEIGHT == nil
      draw_gauge(x, y, width, actor.hp_rate, color1, color2)
    else
      draw_gauge(x, y, width, actor.hp_rate, color1, color2, height)
    end
  end

  def refresh
    self.contents.clear
    font = R2_MAP_HUD::Font
    font_size = R2_MAP_HUD::Font_Size
    self.contents.font = Font.new(font, font_size)
    actor_data
  end
 
  def hud_data_changed
    return true if @current_actor != @old_actor
    return true if $game_party.members[@current_actor].hp != @actor.hp
    return false
  end
 
  def update
    super
    refresh if hud_data_changed
  end
 
  def switch_actor
    @old_actor = @current_actor
    @current_actor += 1
    if @current_actor > ($game_party.members.size - 1 )
      @current_actor = 0
    end
    update
  end
  def c_actor
    return @current_actor
  end
end

class Scene_Map < Scene_Base
  alias r2_map_hud_start  start
  def start
    r2_map_hud_start
    start_hud
  end
  def start_hud
    @actor_shown = R2_MAP_HUD::Actor_Shown == 0 ? $game_party.leader : $game_party.members[R2_MAP_HUD::Actor_Shown]
    @map_hud = Actor_Hud_Window.new
  end
  alias r2_map_update_switch_actor    update
  def update
    r2_map_update_switch_actor
    if Input.trigger?(R2_MAP_HUD::Key_Cycle)
      @map_hud.switch_actor if R2_MAP_HUD::Use_Cycle
    end
  end
  def hud_update
    @map_hud.refresh
  end
end
I'm afraid not. Am I missing something?

HUD.PNG

Hex, I've looked at MOGs HUD but the only ones I can find are battle HUDs.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,369
Reaction score
799
First Language
English
Primarily Uses
RMVXA
I was trying to make it adaptable, but can't find a way to do it with the default code for vlue sleek gauges.
If you use vlue sleek gauges then you will need to add in some lines
Code:
$imported ||= {}
$imported["vlue_sleek_gauges"]

Code above updated
 
Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
I was trying to make it adaptable, but can't find a way to do it with the default code for vlue sleek gauges.
If you use vlue sleek gauges then you will need to add in some lines
Code:
$imported ||= {}
$imported["vlue_sleek_gauges"]

Code above updated
At the risk of sounding like a complete dumbass, I have no idea what you mean by vlue sleek gauges, nor do I have any idea where that line of code fits into your script. What do I need to do for this to work?

EDIT: The picture and HP works for Lorelai (actor 1) but it doesn't change when you remove her from the party. Also, the HP bar doesn't change when taking damage.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,369
Reaction score
799
First Language
English
Primarily Uses
RMVXA
I have no idea what you mean by vlue sleek gauges,
it doesn't change when you remove her from the party. Also, the HP bar doesn't change when taking damage
I'll work on that. It should work for taking damage as the script is designed to update when the hp is different, but I'll check on it. I just didn't test with map battle scripts, but I can simulate with a change hp command.
*fixed - code above updated
 
Last edited:
Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
If it helps, there is no battle in this game whatsoever. The primary way damage is incurred is by missing a QTE (it's a F13 fan-game, so if Jason pops up suddenly and they miss a button prompt, they lose a chunk of Life).

The bar DOES update, but only if you enter the menu and then exit it. It doesn't seem to auto-refresh at all.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,369
Reaction score
799
First Language
English
Primarily Uses
RMVXA
You must have something else that is causing that. It updates perfectly in my test.
1634104345872.png
1634104378320.png1634104393053.png
I did not go into the menu.
To make it work for you I will need to know what QTE script you are using or how the event works.
 
Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
This is going to be convoluted as hell but it's the only way I've been able to make them work, Give me a short bit and I'll post screenshots.

EDIT: It's updating damage taken in real time, but is still not updating HUD picture unless you enter and exit the menu.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,369
Reaction score
799
First Language
English
Primarily Uses
RMVXA
In conversation with @MattLikesPenguins it was found that I did not plan for adding and removing actors. This is what caused the issue.
This is now resolved (in my tests)
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor HUD on Map             ║  Version: 1.02a    ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║ Trimmed down version                ╠════════════════════╣
# ║ Show a HUD on the map               ║    10 Oct 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to display actor data on screen                   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Adjust the settings to your preference                 ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝
$imported ||= {}

module R2_MAP_HUD
  # Configure options
 
  Hud_X         = 0      # Hud Position
  Hud_Y         = 300     # Hud Position
  Hud_Width     = 300     # Hud Width
  Hud_Height    = 120     # Hud Height
 
  Actor_Shown   = 0       # 0 = party leader, 1 = first follower
 
  Key_Cycle     = :CTRL   # Key to cycle actors
  Use_Cycle     = true   # Option to use cycle control
 
  Show_Face     = true    # Show face graphic
  Face_X        = 0       # Face graphic X position
  Face_Y        = 0       # Face graphic Y position
  Face_Index    = 0       # Index of face Graphic

  Show_HP       = true    # Show HP bar
  HP_X          = 120     # HP bar X position
  HP_Y          = 50      # HP bar Y position
  HP_Width      = 124     # HP bar width
  HP_Height     = 20      # HP bar heigth
  # requires Vlue Sleek gauges
  # add these lines to vlue sleek gauges
  #  $imported ||= {}
  #  $imported["vlue_sleek_gauges"] = 1.0
 
  HP_Color1     = 22      # Set the HP color
  HP_Color2     = 26      # Set the HP color
 
  Window_Opacity      = 0         # window visibility, does not affect contents
  Window_Back_Opacity = 0         # Window background opacity
  Window_Graphic      = "Window"  # Window Graphic file to use
 
  Font          = "Arial"
  Font_Size     = 20
 
end
# ╔══════════════════════════════════════════════════════════╗
# ║ End of Configuration                                     ║
# ╚══════════════════════════════════════════════════════════╝

class Actor_Hud_Window < Window_Base
  def initialize(id)
    x = R2_MAP_HUD::Hud_X
    y = R2_MAP_HUD::Hud_Y
    w = R2_MAP_HUD::Hud_Width
    h = R2_MAP_HUD::Hud_Height
    super(x,y,w,h)
    self.windowskin = Cache.system(R2_MAP_HUD::Window_Graphic)
    self.opacity = R2_MAP_HUD::Window_Opacity
    self.back_opacity = R2_MAP_HUD::Window_Back_Opacity
    self.contents_opacity = 255
    @current_actor = id
    @old_actor = 0
    refresh
  end
 
  def actor_data
    switch_actor if @current_actor > ($game_party.members.size - 1)
    @old_actor = @current_actor
    @actor = $game_party.members[@current_actor]
    face = R2_MAP_HUD::Face_Index > 0 ? R2_MAP_HUD::Face_Index : @actor.face_index
    # actor image
    draw_face(@actor.face_name, face, R2_MAP_HUD::Face_X, R2_MAP_HUD::Face_Y, enabled = true) if R2_MAP_HUD::Show_Face
    width = R2_MAP_HUD::HP_Width
    draw_actor_hud_hp(@actor, R2_MAP_HUD::HP_X, R2_MAP_HUD::HP_Y, width) if R2_MAP_HUD::Show_HP
    @current_hp = @actor.hp
  end
 
  def draw_actor_hud_hp(actor, x, y, width = 124, height = R2_MAP_HUD::HP_Height)
    color1 = text_color(R2_MAP_HUD::HP_Color1)
    color2 = text_color(R2_MAP_HUD::HP_Color2)
    if !$imported["vlue_sleek_gauges"]
      draw_gauge(x, y, width, actor.hp_rate, color1, color2)
    else
      draw_gauge(x, y, width, actor.hp_rate, color1, color2, height)
    end
  end

  def refresh
    self.contents.clear
    font = R2_MAP_HUD::Font
    font_size = R2_MAP_HUD::Font_Size
    self.contents.font = Font.new(font, font_size)
    actor_data
  end
 
  def hud_data_changed
    return true if @current_actor != @old_actor
    return true if @current_hp != @actor.hp
    return false
  end
 
  def update
    super
    refresh if hud_data_changed
  end
 
  def switch_actor
    @old_actor = @current_actor
    @current_actor += 1
    if @current_actor > ($game_party.members.size - 1 )
      @current_actor = 0
    end
    update
  end
  def c_actor
    return @current_actor
  end
end

class Scene_Map < Scene_Base
  alias r2_map_hud_start  start
  def start
    r2_map_hud_start
    start_hud
  end
  def start_hud
    @actor_shown = R2_MAP_HUD::Actor_Shown == 0 ? $game_party.leader : $game_party.members[R2_MAP_HUD::Actor_Shown] if @actor_shown.nil?
    @map_hud = Actor_Hud_Window.new(@actor_shown.id - 1)
  end
  alias r2_map_update_switch_actor    update
  def update
    r2_map_update_switch_actor
    if Input.trigger?(R2_MAP_HUD::Key_Cycle)
      @map_hud.switch_actor if R2_MAP_HUD::Use_Cycle
    end
    hud_update if @actor_shown != $game_party.members[@map_hud.c_actor]
  end
  def hud_update
    return if @actor_shown.nil?
    @map_hud.refresh
    @actor_shown = $game_party.members[@map_hud.c_actor]
  end
end
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor HUD on Map             ║  Version: 1.03a    ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║ Trimmed down version                ╠════════════════════╣
# ║ Show a HUD on the map               ║    10 Oct 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Allows to display actor data on screen                   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Adjust the settings to your preference                 ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝
# Not compatible with Vlue Sleek gauges

module R2_MAP_HUD
  # Configure options
 
  Hud_X         = 0      # Hud Position
  Hud_Y         = 300     # Hud Position
  Hud_Width     = 300     # Hud Width
  Hud_Height    = 120     # Hud Height
 
  Actor_Shown   = 0       # 0 = party leader, 1 = first follower
 
  Key_Cycle     = :CTRL   # Key to cycle actors
  Use_Cycle     = true   # Option to use cycle control
 
  Show_Face     = true    # Show face graphic
  Face_X        = 0       # Face graphic X position
  Face_Y        = 0       # Face graphic Y position
  Face_Index    = 0       # Index of face Graphic

  Show_HP       = true    # Show HP bar
  HP_X          = 120     # HP bar X position
  HP_Y          = 50      # HP bar Y position
  HP_Width      = 124     # HP bar width
  HP_Height     = 20      # HP bar heigth
 
  HP_Color1     = 22      # Set the HP color
  HP_Color2     = 26      # Set the HP color
 
  Window_Opacity      = 0         # window visibility, does not affect contents
  Window_Back_Opacity = 0         # Window background opacity
  Window_Graphic      = "Window"  # Window Graphic file to use
 
  Font          = "Arial"
  Font_Size     = 20
 
  Toggle        = :ALT
  Toggle_Switch = 4 # if switch is on, hud can be displayed
      # if switch is off hud cannot be displayed
  Formation_Switch = 2 # switch to update hud when changing formation
end
# ╔══════════════════════════════════════════════════════════╗
# ║ End of Configuration                                     ║
# ╚══════════════════════════════════════════════════════════╝

class Actor_Hud_Window < Window_Base
  def initialize(id)
    x = R2_MAP_HUD::Hud_X
    y = R2_MAP_HUD::Hud_Y
    w = R2_MAP_HUD::Hud_Width
    h = R2_MAP_HUD::Hud_Height
    super(x,y,w,h)
    self.windowskin = Cache.system(R2_MAP_HUD::Window_Graphic)
    self.opacity = R2_MAP_HUD::Window_Opacity
    self.back_opacity = R2_MAP_HUD::Window_Back_Opacity
    self.contents_opacity = 255
    @current_actor = id
    @old_actor = 0
    refresh
  end
 
  def actor_data
    switch_actor if @current_actor > ($game_party.members.size - 1)
    @old_actor = @current_actor
    @actor = $game_party.members[@current_actor]
    face = R2_MAP_HUD::Face_Index > 0 ? R2_MAP_HUD::Face_Index : @actor.face_index
    # actor image
    draw_face(@actor.face_name, face, R2_MAP_HUD::Face_X, R2_MAP_HUD::Face_Y, enabled = true) if R2_MAP_HUD::Show_Face
    width = R2_MAP_HUD::HP_Width
    draw_actor_hud_hp(@actor, R2_MAP_HUD::HP_X, R2_MAP_HUD::HP_Y, width) if R2_MAP_HUD::Show_HP
    @current_hp = @actor.hp
  end
 
  def draw_actor_hud_hp(actor, x, y, width = 124, height = R2_MAP_HUD::HP_Height)
    color1 = text_color(R2_MAP_HUD::HP_Color1)
    color2 = text_color(R2_MAP_HUD::HP_Color2)
    draw_gauge(x, y, width, actor.hp_rate, color1, color2)
  end
 
  def draw_gauge(x, y, width, rate, color1, color2)
    fill_w = (width * rate).to_i
    gauge_y = y + line_height - 8
    height = R2_MAP_HUD::HP_Height
    contents.fill_rect(x, gauge_y, width, height, gauge_back_color)
    contents.gradient_fill_rect(x, gauge_y, fill_w, height, color1, color2)
  end

  def refresh
    self.contents.clear
    font = R2_MAP_HUD::Font
    font_size = R2_MAP_HUD::Font_Size
    self.contents.font = Font.new(font, font_size)
    actor_data
  end
 
  def hud_data_changed
    return true if @current_actor != @old_actor
    return true if @current_hp != @actor.hp
    return false
  end
 
  alias r2_hud_update_vlue    update
  def update
    refresh if hud_data_changed
    r2_hud_update_vlue
  end
 
  def switch_actor
    @old_actor = @current_actor
    @current_actor += 1
    if @current_actor > ($game_party.members.size - 1 )
      @current_actor = 0
    end
    update
  end
 
  def c_actor
    return @current_actor
  end
 
  def formation_change(id)
    @current_actor = id
  end
end

class Scene_Map < Scene_Base
  alias r2_map_hud_start  start
  def start
    r2_map_hud_start
    @map_hud_seen = true if @map_hud_seen.nil?
    start_hud
  end
  def start_hud
    @actor_shown = R2_MAP_HUD::Actor_Shown == 0 ? $game_party.leader : $game_party.members[R2_MAP_HUD::Actor_Shown] if @actor_shown.nil?
    @map_hud = Actor_Hud_Window.new(@actor_shown.id)
  end
  alias r2_map_update_switch_actor    update
  def update
    r2_map_update_switch_actor
    if $game_switches[R2_MAP_HUD::Toggle_Switch] == false
      @map_hud.close
    end
    if Input.trigger?(R2_MAP_HUD::Toggle)
      @map_hud_seen = !@map_hud_seen
    end
    if @map_hud_seen == false
      @map_hud.close if @map_hud.open?
    else
      @map_hud.open if @map_hud.close?
    end
    if Input.trigger?(R2_MAP_HUD::Key_Cycle)
      @map_hud.switch_actor if R2_MAP_HUD::Use_Cycle
    end
    hud_update if @actor_shown != $game_party.members[@map_hud.c_actor]
    if $game_switches[R2_MAP_HUD::Formation_Switch] == true
      @map_hud.formation_change(0)
      @map_hud.refresh
      @actor_shown = $game_party.members[0]
      $game_switches[R2_MAP_HUD::Formation_Switch] = false
    end
  end
  def hud_update
    return if @actor_shown.nil?
    @map_hud.refresh
    @actor_shown = $game_party.members[@map_hud.c_actor]
  end
end
 
class Scene_Menu < Scene_MenuBase
  alias r2_on_formation_ok_actor_hud  on_formation_ok
  def on_formation_ok
    r2_on_formation_ok_actor_hud
    $game_switches[R2_MAP_HUD::Formation_Switch] = true
  end
end
 
Last edited:
Joined
Apr 21, 2016
Messages
45
Reaction score
14
First Language
English
Primarily Uses
This thread can be closed whenever one of the mods have time to do so, as Ronin's script gave me exactly what I was looking for (and I'm very thankful for his help).
 

Latest Threads

Latest Profile Posts

ready to fall into another development hell...
Mega has been giving me a lot of problems as of late, so I think I'll need to switch to another cloud service. I'm considering Dropbox.
Rough week, but in the end there's light in the darkness.
Mental health is an issue I wish was taken more seriously.
Take care.
1638421271905.jpeg
By the power of timezones! This picture shall still be posted on december 1st!!!
7xI2Gc2.jpg

This is not something I'd ever even considered but wow! What a way to use music in a game.

Forum statistics

Threads
117,121
Messages
1,104,750
Members
153,163
Latest member
tgjtjtjt
Top