[ACE] Shana’s Map HUD-Need extra config

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
I’m using Adiktuzmiko’s script here: https://lescripts.wordpress.com/rgss3/map-hud/

I apologize for advance for coming off NEEDY but I have three additional things I need for the script. (Which I hope isn’t too much to ask for.)

It’s a script that shows an HUD on Map displaying the players’ current health. Problem is, I need it to show on the top right of the corner but my game is a 640x480. While the script only allows the hud to fit the default VX Ace screen. So the hud gets cut off.

The script only allows the hud to be turned off and on with a toggle script command. I was wondering if it was possible to have both an “off” and “on” command. It’ll be much more useful if I had it that way.

Lastly, I was wondering if there were a way to always hide the HUD while a text message is shown. And for it to reappear once text is gone. I know I could use the ‘toggle’ command but that’s just way too tedious. (But if there isn’t a way to include this, than it’s okay.)

Again, sorry for being needy. Thanks in advance!!!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
See these?

Code:
   #X position of hp gauge
   X_HP = 24
   #Y position of hp gauge
   Y_HP = 9
   #X position of mp gauge
   X_MP = 24
   #Y position of mp gauge
   Y_MP = 34
  #X position of tp gauge
   X_TP = 24
   #Y position of tp gauge
   Y_TP = 60
  #X position of exp gauge
   X_XP = 22
   #Y position of xp gauge
   Y_XP = 416-16
  #X position of hp icon
   X_HP_ICON = 2
   #Y position of hp icon
   Y_HP_ICON = 1
   #X position of mp icon
   X_MP_ICON = 2
   #Y position of mp icon
   Y_MP_ICON = 26
  #X position of tp icon
   X_TP_ICON = 0
   #Y position of tp icon
   Y_TP_ICON = 0
  #X position of xp icon
   X_XP_ICON = 0
   #Y position of xp icon
   Y_XP_ICON = 0
Muck around with them until they're right.


Find this:

Code:
   def self.toggle
     @use_hud = !@use_hud
     if SceneManager.scene_is?(Scene_Map)
       if @use_hud
         self.update(true)
       else
         @sprite_b.bitmap.clear
       @sprite_bg.bitmap.clear
       end
     end
   end
Put this after it:
Code:
  def self.turn_on
    @use_hud = true
    if SceneManager.scene_is?(Scene_Map)
      self.update(true)
    end
  end

  def self.turn_off
    @use_hud = false
    if SceneManager.scene_is?(Scene_Map)
      @sprite_b.bitmap.clear
      @sprite_bg.bitmap.clear
    end
  end

Not sure about the message thing. Try the above first and see if those things work. If they do, give this a go ...
Find this:
Code:
   def self.update(forced=false)
     unless forced
Put some extra lines in between:
Code:
   def self.update(forced=false)
    @sprite_b.bitmap.visible = !$game_message.busy?
    @sprite_bg.bitmap.visible = !$game_message.busy?
     unless forced
I haven't tested this, so copy away the script somewhere before you make these changes, just in case it doesn't work.

If you get any errors, post back to say what they are.
 

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
Thanks! I was able to fix the X,Y Screen coordinates by replacing the numbers on line:266 and onwards.

The toggle on and off commands work perfectly.

The only thing that does not work is the off and on during the display of text messages. I get this message after inputting those two new lines:
 

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Not sure why would you forcibly redraw all that thing when it's not necessary when turning the HUD on/off.
Code:
  def self.turn_on
    @use_hud = true
    if SceneManager.scene_is?(Scene_Map)
      @sprite_b.visible = @sprite_bg.visible = true
    end
  end

  def self.turn_off
    @use_hud = false
    if SceneManager.scene_is?(Scene_Map)
      @sprite_b.visible = @sprite_bg.visible = false
    end
  end
This should work too, and it won''t redraw anything, just changes the visibility flag of the HUD images.

You get that error because the method run there should be run on the sprites, not on their bitmaps.
Code:
@sprite_b.visible = @sprite_bg.visible = !$game_message.busy? && @use_hud
Try the above instead, it should work, although I haven't tested any of this.
 

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
Not sure why would you forcibly redraw all that thing when it's not necessary when turning the HUD on/off.
Code:
  def self.turn_on
    @use_hud = true
    if SceneManager.scene_is?(Scene_Map)
      @sprite_b.visible = @sprite_bg.visible = true
    end
  end

  def self.turn_off
    @use_hud = false
    if SceneManager.scene_is?(Scene_Map)
      @sprite_b.visible = @sprite_bg.visible = false
    end
  end
This should work too, and it won''t redraw anything, just changes the visibility flag of the HUD images.

You get that error because the method run there should be run on the sprites, not on their bitmaps.
Code:
@sprite_b.visible = @sprite_bg.visible = !$game_message.busy? && @use_hud
Try the above instead, it should work, although I haven't tested any of this.
Thanks so much! It worked!
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
@Sixth How dangerous is the reported memory leak?
Code:
Time: 2019-03-14 10:07:09 -0400
Memory Leak #<Sprite_Base:0x113966b8>
In Scene Scene_Title
Creation Stack::
Script 0126 -- map hud, Line: 268:in `init'
Script 0126 -- map hud, Line: 533:in `start'
Script 0100 -- Scene_Base, Line: 12:in `main'
Script 0123 -- Mithran | Grap Obj Ref, Line: 246:in `main'
Script 0006 -- SceneManager, Line: 23:in `run'
Script 0130 -- Hime | Backtrace, Line: 9:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
Script 0130 -- Hime | Backtrace, Line: 7:in `<main>'
ruby:in `eval'
-----
Time: 2019-03-14 10:07:09 -0400
Memory Leak #<Sprite_Base:0x113964ec>
In Scene Scene_Title
Creation Stack::
Script 0126 -- map hud, Line: 271:in `init'
Script 0126 -- map hud, Line: 533:in `start'
Script 0100 -- Scene_Base, Line: 12:in `main'
Script 0123 -- Mithran | Grap Obj Ref, Line: 246:in `main'
Script 0006 -- SceneManager, Line: 23:in `run'
Script 0130 -- Hime | Backtrace, Line: 9:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
Script 0130 -- Hime | Backtrace, Line: 7:in `<main>'
ruby:in `eval'
It does not seem to cause any problems and does not increase in numbers or reduce fps.
I was able to make the reported leaks go away by putting the init into the scene map part and adding on sprite dispose to the def clear.
The only issue after that was the hud did not show up after exiting the menu.

*EDIT

I got it working.
no messages about memory leaks and works as expected.
Code:
    def self.toggle
      @use_hud = !@use_hud
      if SceneManager.scene_is?(Scene_Map)
        if @use_hud
          @use_hud = true
          @hud_on = true
          self.update(true)
        else
          @use_hud = false
          @hud_on = false
        end
      end
    end
Code:
  def self.turn_on
    self.update
    @use_hud = true if @hud_on == true
  end

  def self.turn_off
    @use_hud = false if @hud_on == false
    self.clear
  end
Code:
  def self.clear
    @sprite_b.bitmap.clear
    @sprite_bg.bitmap.clear
    @sprite_b.dispose
    @sprite_bg.dispose
  end
Code:
    def self.update(forced=false)
    self.init if @sprite_b.disposed?
    @sprite_b.visible = @sprite_bg.visible = !$game_message.busy? && @use_hud
      unless forced
Code:
  alias start_adik_map_hud start
  def start
    start_adik_map_hud
    ADIK::MAP_HUD.init
    ADIK::MAP_HUD.update(true) if ADIK::MAP_HUD.use_hud
  end
Code:
  alias r2_update_call_menu_827f  update_call_menu
  def update_call_menu
    r2_update_call_menu_827f
    @use_hud = true if @hud_on == true
      ADIK::MAP_HUD.turn_on
  end
Deleting the scene title section

*DOUBLE EDIT

Forget all of this. Turns out the issue of the possible memory leak is still there, but now shows up when the map hud is not on and you enter the menu.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,456
Members
137,821
Latest member
Capterson
Top