Jump to content
Galv

Explorer's HUD

Recommended Posts

Explorer's HUD - Version 2.0
By Galv


Introduction
This was the result in me fiddling around with how to make a HUD as part of my ongoing learning stuff. It's very basic and won't win any prizes for top HUD script but thought I would share anyway.


Features
A HUD that displays information that might be useful for an RPG with a lot of exploring such as:
- The leading actor’s hp, mp, tp, exp, states, level and equipped item (you choose which equip slot gets shown in the HUD options)
- Party gold
- Map display name
- X,Y coordinates
Can use a custom windowskin.

The player can toggle the HUD on or off when needed. Because it displays the lead actor's info it works well with Tsukihime’s Rotate Formation script to switch the lead actor with the press of a button.


Screenshot
info-hud.jpg


How to Use
Place script under Materials and above Main.
See top of the script for instructions and settings.


Script
Get it here


FAQ
None yet.


Credit and Thanks
- Galv
- Tsukihime if you include his rotate formation script with it


Updates
2013-01-31 - Version 2.0 - fixed another bug with TP showing in battle option
2013-01-30 - Version 1.9 - more fixes to no party member issue
2013-01-24 - Version 1.8 - Fixed crash when no party members in party
2012-11-06 - Version 1.7 - Some tweaking thanks the advice from Niclas
2012-11-06 - Version 1.6 - more bug fixes
2012-11-06 - Version 1.5 - Fixed so HUD doesn't appear in battle
2012-11-06 - Version 1.4 - Added TP
2012-11-06 - Version 1.3 - Added options to remove unwanted bottom windows
2012-11-06 - Version 1.2 - Fixed map name not updating bug.
2012-11-06 - Version 1.1 - Lowered z values of windows as some custom scenes were using lower z values and appearing under the HUD. Edited by Galv

Share this post


Link to post
Share on other sites

Awesome! =) All you need for a HUD and way more beautiful than most other simple HUDs out there.

 

Just sayin: In combination with some custom menu scenes (like Modern Algebra's Quest Journal), the actor face and equip slot isn't faded into the background properly and appears on the same layer as the custom menu's font layer.

Edited by Caveras

Share this post


Link to post
Share on other sites

This looks good, but could you add a small hud beneath the upper part of the hud to display the status of other party members? That will be more easy for an ARPG to use.

Share this post


Link to post
Share on other sites

@Caveras - the custom quest scene was using windows with lower z values causing them to display underneath. I reduced the z values of the HUD which hopefully fixed it for all custom scenes. (grab v.1.2)

 

@ 3 - Okay, I'll try this and see what I can come up with when I have some time.

Share this post


Link to post
Share on other sites

Pretty cool, I like it! :D

 

Just one question: it's possible to make it more customizable? I mean, it would be nice to disable some boxes (like the coordinates), or hide the map box from using a tag or something.

Edited by Cal Avera

Share this post


Link to post
Share on other sites

Okay, later I will add some customising to the script settings.

 

What do you mean hide the map box from using a tag?

Share this post


Link to post
Share on other sites

I've tested it with some maps without a name for display, and for those it only shows an empty box. I was thinking that you can add a note on these maps, like <dont show>... Or just make it to automatically hide when the maps have no name... Hope it's clear now.

Share this post


Link to post
Share on other sites

Thanks estriole :)

 

@ Cal Avera - my concern with making boxes 'disappear' is that it will look odd with gaps in the bottom bar and throw out the balance. I was going to leave the boxes blank for anything that was set to not shown and have the option to remove the whole bottom bar

Share this post


Link to post
Share on other sites

some suggestion:

 

btw galv could you include tp?

if you could set it like yanfly it would be awesome

 

yanfly version

when actor have skill that use mp only. it will show mp only.

when actor have skill that use tp only. it will show tp only (in the same place as mp)

when actor have skill that use mp and tp. it will show two bar (yanfly make it side by side. but i think in your hud it will be better if it below. since there's still spot for that)

 

and i think you could include leader name there too.

maybe moving the equip to bottom of hp. move down the states. and put the name where the state was.

Share this post


Link to post
Share on other sites

The TP/MP thing like Yanfly does is a good idea. I personally don't think actor name is needed, it just takes up space for no reason (Unless you have to keep checking to make sure it hasn't changed while you've been walking around haha). I'll add the TP in later next time I feel like typing more :)

 

EDIT: I copped out and just added TP with the option to disable it... no fancy Yanfly functionality.

Okay so I just noticed a problem that I am struggling with. The HUD stays in combat. Trying to work out how to hide it when the scene changes.

Okay, learning new stuff! woot

Edited by Galv

Share this post


Link to post
Share on other sites

Hey Galv, thanks for the fix! It's not overlapping any scenes now anymore, but instead I now have this:

 

HUD is deactivated - I press Escape to open the menu - I close the menu, and the HUD is visible for a split second before disappearing.

Share this post


Link to post
Share on other sites

Thanks for letting me know, I didn't notice that when I was testing haha. Should be fixed now... hopefully. Will get this right one day :P

Share this post


Link to post
Share on other sites

No problem, no one expects you to go and test every little nuance after each fix :) thanks anyway, I'll get the update later, but I believe it should work quite fine now.

Share this post


Link to post
Share on other sites

So, overall I like the simplicty for this script but I found out you can actually make your code more optimized.

 

Let me give you some examples:

 

1. This code can be broken down to one line actually:

$imported = {} if $imported.nil?
$imported["Info_Hud"] = true

Like so:

($imported ||= {})["Info_Hud"] = true

You should also try to rename it to like Galv_Info_Hud as someone else might actually use the same name in the $imported variable. (Just a suggestion since the changes for that too happen is kind of minimal)

 

2. I've noticed you have alot of "create" methods that check whether or not the instance variable is nil or not. That won't be necessary because it is only going to be initialize once so you don't need to be checking if it is nil or not. Like this:

 alias galv_hud_create_spriteset create_spriteset
 def create_spriteset
   galv_hud_create_spriteset
   create_hud #if @galv_hud.nil?
 end

Or this:

 def initialize(viewport)
   super(viewport)
   create_gold_window #if @gold_window.nil?
   create_coords_window #if @coords_window.nil?
   create_location_window #if @location_window.nil?
   create_status_window #if @status_window.nil?
   $game_temp.hud_update[4] = []
   $game_temp.hud_update[6] = ""
   $game_temp.hud_update[7] = $game_party.members[0].tp
 end

Notice the things I commented.

 

3. You can also change the code where you are looking for actor 1 in the party to this code which probably is a better way:

$game_party.leader

This will return the actual leader of the party since I guess thats the one you want to be showing at the HUD anyways.

 

4. Also I think you messed up a comperssion check in this method as well:

 def check_trigger
   if Input.trigger?(Galvs_Hud::ACTIVATE_BUTTON)
  $game_switches[Galvs_Hud::TOGGLE_SWITCH] ^= true
   end
 end

Should be changed to this:

 def check_trigger
   if Input.trigger?(Galvs_Hud::ACTIVATE_BUTTON)
  $game_switches[Galvs_Hud::TOGGLE_SWITCH] == true
   end
 end

 

5. Also you don't have to dispose each window since everything is disposed at Scene_Base terminate method anyways.

 

6. What is the purpose of this in Game_Temp?

 def hud_update
   @hud_update
 end

You are setting up an accessor which can read or write so why do you need that method for?

 

There are probably even more ways to optimize the code but just wanted to help you out with your learning experience so you can improve. Keep it up :)

Share this post


Link to post
Share on other sites

Hi Niclas - thanks very much for this, it was very helpful!

 

1. Thanks, I didn't know that.

 

2. Ah, yes I should take that out. I had at first created the hud a really silly way that required that or it kept drawing the hud over itself. But I saw there was a more appropriate way to do it and changed it but never removed those. Thanks

 

4. I believe this is correct - the ^= turns the switch on if off and off if on.

 

5. I didn't know how to dispose the scene when battle starts. This is how I accomplish it because I couldn't work out a better way.

 

6. I thought that was required to define the attr_accessor. Seems its not! haha

 

Thanks again for the tips! Much appreciated

Share this post


Link to post
Share on other sites

Sir Galv can i make some request? Can you make the window semi transparent when the player is under the window explorer and can i make some pictures instead of window, cause it`s more complicated when window and it has more less design. Thanks a lot sir!!!!

Share this post


Link to post
Share on other sites

Hi Galv,

 

I having a problem with the 

 

@status_window.refresh

when on it is creating a lot of lag with my images and maps. When I comment it out everything is back to normal
is there a way to update only when the lead actor is switched using the Rotate Formation script? Instead of always refreshing?

 

Thank you for the help.

Share this post


Link to post
Share on other sites

It isn't always refreshing, it only refreshes when there's a change to something (hp,mp,xp, lead actor, etc.)

How are you using it?

Share this post


Link to post
Share on other sites

That's what I thought it diid.

 

It did give me an undefined error with

draw_gauge_area_without_tp(rect, actor)

so I just added

  def draw_gauge_area_without_tp(rect, actor)  end

 

What is odd is that I can load it in to my test project and it works just fine.

 

 

I even started a new project and transferred over my other scripts one at a time to see it that was creating the problem but got no errors or lag everthing work the way it should.

 

I even edited your script so it would only show the actors face image to see if I could get it to work that way but no luck.

 

I have a feeling theres a problem somewhere in the database of this project which sucks as I have over a month of work it to it now.

Share this post


Link to post
Share on other sites

I'm getting the following msg after going starting a new game. Script 'Window_Base' line 471: NoMethodError occurred. undefined method 'state_icons' for nil:NilClass. I believe this is because i have the game ask you to choose your character gender class and then name and after all that it will add your chosen party member. You have no initial party when starting a game.

Share this post


Link to post
Share on other sites

Please don't double post

You could use an initial party to fix the problem :)
Just make them transparent.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted