Jump to content
Nicke

XS - Variable Hud

Recommended Posts

xs.png

Variable Hud

Version: 1.0a

 

Introduction

 

A simple variable hud where you can show off to the player certain currencies or other values such as acquired gems etc.The choice is yours.


Features

  • Easy to use and install.
  • Just like my previous scripts it is quite easy to setup the variable list and test it out.
  • Unlimited variables to show but I suggest you only use around 5-7.
  • Enable/disable the hud by a switch.
  • Easy to positioning the hud as well as change the space beetween the variables.
  • Support for icons.
  • The choice to display a text next to the variable that will act like a vocab.
  • Lag free!
  • And more!

Screenshots


xs-var-hud.png



Script
Get the script here.

Updates
None.

Credit
Do credit me, Nicke, if you are planing on using this script. Thanks.
Can be use in a commercial project.

Edited by Nicke

Share this post


Link to post
Share on other sites

Nice script! Just one thing...

The window hud is transparent by default I think. How may I change it to say, a blue window?

 

27 # HUD = [width, x, y, opacity, skin]

28 HUD = [160, 455, -5, 200, 0, nil]

 

Changing nil will affect the skin/colour of the window, right? I run into errors when I change it to numbers. Help?

Share this post


Link to post
Share on other sites

Very nice, was looking for a simple variable hud script.

I have a few questions, I want to use it for a time system but im having some trouble.

1) Is there anyway to remove the "x" like 161x herbs?

2) Is there anyway to move the individual hud display so I can put Hour > Minute > Am/PM all on the same line? I thought I could because I saw

# VAR_LIST = [variable_id, vocab (nil), icon_index (nil), x, y]

 

x,y? Unless im doing something wrong I put my x,y coordinates but it doesn't change where the line displays.

 

I guess it wont be as simple to create it for Time? I don't see a feature that can show either AM or PM.

Share this post


Link to post
Share on other sites

XAIL, just noticed, i think you should put a note one how to make the window visible with a background.

I've found the answer to Rinku's question, just the co-ordiantes are off.

HUD = [160, 405, -5, 200, 200, "Window"]

 

So I was just wondering if you'd like to update the script just to show people that it's possible to make a back.

 

Also, line 27 is missing something

# HUD = [width, x, y, opacity, skin]

It shows 5 options, but there's actually 6.

What's the option between y and opactiy?

Share this post


Link to post
Share on other sites

Ah yeah, thanks @Anton. The following code @Rinku should display the window with none tranparency:

HUD = [160, 405, -5,  200, 255, nil]

The missing option for HUD was z and has been updated now:

# HUD = [width, x, y, z, opacity, skin]

@Ice Nick: I've added so that you can change the amount symbol as you like in the settings now. For the second question I can probably add a feature so it will work for a time system.

Edited by Niclas

Share this post


Link to post
Share on other sites

Thanks for the help both of you.

 

 

1) Is there anyway to remove the "x" like 161x herbs?

 

 

I think removing (or changing) the x from line 67 will resolve that.

Share this post


Link to post
Share on other sites

Thanks for the help both of you.

 

1) Is there anyway to remove the "x" like 161x herbs?

 

 

I think removing (or changing) the x from line 67 will resolve that.

 

Line 67 is

# // Method to return the width.

 

Edit found it on line 44! :D

Edited by Ice Nick

Share this post


Link to post
Share on other sites

One of you probably editted your so that there's more lines

(The customization lets you do that)

 

Yeah makes sense lol, I just copied the lastest version and went by that.

Is there anyway using this script to achieve that Time system hud? Like can I display AM if its AM and change it to PM when its PM?

Share this post


Link to post
Share on other sites

As in AM in-game, or AM in real life?

 

Am in game. When its midnight to noon, the hud will read... X o'clock AM. From noon to midnight it will read X o'clock PM.

Share this post


Link to post
Share on other sites

@Ice Nick: You could do it like this...

First go to the script and add the following:

VAR_LIST[0] = [1, "", nil]

This will display variable id 1 with no text and no icon. Then you go to the variable page and set the variable to this:

time.png

This will use Ruby's built in Time class and get the computer time, then it will change the format to only get PM or AM.

For more details about setting up different formats look at this page.

 

This will be the result of that:

time_result.png

 

You may need to change the width, height and x, y position for the hud to your needs as well but that is kind of obvious. I'll let you decide where it should be located. Hope that helped!

 

Bah update again, you might need to know that when using a variable you must update it before a value displays. In this particular case the PM/AM wont be updated until you set the variable again, which can be kind of tedious to do. I mean, you have to constantly call the variable with a common event so that it changes to PM/AM correctly. Anyways, just so you know. :)

Edited by Niclas

Share this post


Link to post
Share on other sites

Oh sorry maybe I wasnt clear, I have my own time system, to be more specific im using http://www.rpgmakerv...rial-with-demo/ this one.

I believe I actually understand, the time only displays PM because well right now its 5PM on my computer.

 

However

VAR_LIST[0] = [1, "", nil]

using nil causes an error so I have to use 0.

 

How do I change the position of the hud? Right now I have it on 2 lines

The hour and then under it PM

 

9

PM

 

Is it possible to have them next to each other, also I want to right X O'Clock but when I do that it just displays

 

O'Clock

PM

 

Dont worry about the O'Clock part I was just testing it, I dont want to use 9 O'Clock but I cant seem to it working regardless.

Edited by Ice Nick

Share this post


Link to post
Share on other sites

Okay, yeah well do as I did above but include the time system within the variable. As for the nil error I've updated the script *again* which enables you to do nil instead. Sorry for the inconvenience!

Edited by Niclas

Share this post


Link to post
Share on other sites

Nick, I'll be able to script this in a little window on the top-left of the screen if you want.

I'm actually checking out the tutourial now

 

I actually want to figure this one my self or at least try till I fail. However yes that would be perfect :)

So far my problems are, I want to press Q to toggle Hud display, I cant figure this out, I have it to turn on but wont turn off.

Moving the variables to show all in a line... Hour:Minutes AM/PM

And displaying the correct AM/PM

 

I apologize for posting my time system problems in this thread perphaps we should Private Message to keep Niclas Thread clean.

BTW its awesome script Niclas, I can't tell if its broken or I just have no clue to set it up lawl.

 

Edit: Yeah I don't think I can get it the way I want, Anton I could use your help :)

Edited by Ice Nick

Share this post


Link to post
Share on other sites

I'm not sure how to do it the way you want at all, but after downloading the tutourial, ive gotten this scriplet together.

 

#Wherever you see $game_switches[1]
#Change 1 to the switch to turn the hud on/off

class Window_MapTime < Window_Base
 def initialize
super(0,0,200,80)
@ampm = "AM"
if $game_switches[1] == false
  self.opacity = 0
  time_draw
end
 end

 def time_draw
if $game_variables[100] == 1
  @ampm = "PM"
else
  @ampm = "AM"
end
@hours = $game_variables[97] # Hours
@mins = $game_variables[96] # Mins
@secs = $game_variables[95] #Seconds
text = @hours.to_s + ":" + @mins.to_s + ":" + @secs.to_s + " " + @ampm
draw_text(0,0,200,40,text)
 end

 def update
if $game_switches[1] == false
  contents.clear
  time_draw
end
if $game_switches[1] == true
  self.opacity = 255
end
 end
end

class Scene_Map < Scene_Base
 alias time_draw_on_map_time create_all_windows
 def create_all_windows
time_draw_on_map_time
@maptime_window = Window_MapTime.new
 end
end

 

 

 

Sorry Niclas for kinda stealing this topic...

Edited by Anton

Share this post


Link to post
Share on other sites

I'm not sure how to do it the way you want at all, but after downloading the tutourial, ive gotten this scriplet together.

 

#Wherever you see $game_switches[1]
#Change 1 to the switch to turn the hud on/off

class Window_MapTime < Window_Base
 def initialize
super(0,0,200,80)
@ampm = "AM"
if $game_switches[1] == false
  self.opacity = 0
  time_draw
end
 end

 def time_draw
if $game_variables[100] == 1
  @ampm = "PM"
else
  @ampm = "AM"
end
@hours = $game_variables[97] # Hours
@mins = $game_variables[96] # Mins
@secs = $game_variables[95] #Seconds
text = @hours.to_s + ":" + @mins.to_s + ":" + @secs.to_s + " " + @ampm
draw_text(0,0,200,40,text)
 end

 def update
if $game_switches[1] == false
  contents.clear
  time_draw
end
if $game_switches[1] == true
  self.opacity = 255
end
 end
end

class Scene_Map < Scene_Base
 alias time_draw_on_map_time create_all_windows
 def create_all_windows
time_draw_on_map_time
@maptime_window = Window_MapTime.new
 end
end

 

 

 

Sorry Niclas for kinda stealing this topic...

 

Thanks, I sent you a PM :)

Share this post


Link to post
Share on other sites

2) Is there anyway to move the individual hud display so I can put Hour > Minute > Am/PM all on the same line? I thought I could because I saw

# VAR_LIST = [variable_id, vocab (nil), icon_index (nil), x, y]

 

x,y? Unless im doing something wrong I put my x,y coordinates but it doesn't change where the line displays.

 

Same issue here, I just can't manage to move my variables (only the general position of the HUD is working). I just want to place all of them in the same line (instead of being placed vertically).

 

Are the x, y options in # VAR_LIST = [variable_id, vocab (nil), icon_index (nil), x, y] simply misplaced or perhaps just unnecessary here ?

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