Product Chat / Make your own HUD

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 29th Sep 2016 18:22 Edited at: 30th Sep 2016 05:21
Hi everyone!

Here's a video showing how to make your own custom HUD. I've been asked on Youtube a few times and though it about time I got round to doing it. The basics are easy, but I go a little further here and show you a way to improve the health meter a little. Making it only go red when your actually low on health rather than almost immediately It should be easy to tweak it to do all sorts with your health or anything else you want to represent.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 30th Sep 2016 05:20 Edited at: 30th Sep 2016 05:23
Here's the script I promised on the video. You will need to add it to an object and set that as always active, also add your own graphic for the health bar, either using my folder structure, or your own. Or just change it in the script to suit.

If you have problems, don't hesitate to ask.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.

Attachments

Login to view attachments
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 30th Sep 2016 09:08
Very cool DVader thanks ....
I need to wait till the weekend to really go through the vid in a play / Pause mode
Even so ...Thanks for the tutorial ... Its going to be handy...
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 30th Sep 2016 11:58
cheers Dvader, very useful
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: SegAutoWelder, Entity+Weapon Welder
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 30th Sep 2016 12:23
@DVader, thanks for the tut and the script, I have been meaning to play around with making a sci-fi hud for a while and this will help with the learning curve for sure.

Reliquia....
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.
PM
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 30th Sep 2016 12:58
Thank for this ,very healpfull .

Dave
PM
MXS
Valued Member
15
Years of Service
User Offline
Joined: 10th Jan 2009
Location: Cybertron
Posted: 30th Sep 2016 13:56
we need more LUA
more than what meets the eye.Welcome to SciFi Summer

Windows 7 home premium 64bit gtx770 sc acx 2gb gpu boost 2.0

3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 30th Sep 2016 21:20
Retrogame block attack again!

Nice one Dvader and thanks a lot.
I'm going to wait also till next weekend, to deal with.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Jerry Tremble
GameGuru TGC Backer
11
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 1st Oct 2016 03:13
This is great! Thank you. I will have to rewatch
Desktop: i7 4770@3.4Ghz, 12GB RAM, Win 10/64, GeForce GTX 1080, 1TB SSD, 1TB HDD; Laptop: i7 4800MQ@2.7Ghz, 16GB RAM, Win 10/64, GeForce GTX870M , 1TB SSD.
PM
seppgirty
Game Guru Backer
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 1st Oct 2016 15:54
Really helpful. Thanks for taking the time to do this.
gamer, lover, filmmaker
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Oct 2016 11:29
Thanks everyone. It was a bit of a fight with GF Experience for awhile, but got it working in the end, pesky updates. I spent way more time with the video than the script took to write, lol. Glad it is helpful to you all. Don't forget to leave a comment and a like on my channel! It all helps me keep plugging away.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
Mipastu
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 16th Feb 2015
Location: Finland
Posted: 3rd Nov 2016 19:12
Im actually having problems with the script, turning "on" the hud creates an error?
Final Path - Action punched dinosaur survival game, coming in steam greenlight soon
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th Nov 2016 01:06
What error are you getting?


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
TechCo
User Banned
Posted: 22nd Jan 2017 09:59
hOW to make custom weapon hud??
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 22nd Jan 2017 11:26 Edited at: 9th Feb 2017 06:18
Try this script, place it in a dynamic (static = no), always active entity. You can change the location and size of the text and sprite by changing the numbers in the HUD Locations and Sizes section.

Name it ammo_hud.lua



You will need to create a background image called ammo.png and place it in your scriptbank\images folder.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.

Attachments

Login to view attachments
devlin
10
Years of Service
User Offline
Joined: 12th Feb 2014
Location:
Posted: 22nd Jan 2017 16:43
thank you for your time was waiting for this
PM
Duchenkuke
GameGuru VBOTB Developer
7
Years of Service
User Offline
Joined: 7th Jun 2016
Location: Germany
Posted: 28th Jan 2017 12:38 Edited at: 28th Jan 2017 12:54
Awesome. Also thanks very much for the ammo.hud Will play around with this and see what I get !

btw. how can I make that the new hud shows right away and not after pressing tilde?
Windows 10 64bit - Intel Core i7-2600 CPU @ 3.40GHz, 8,0 GB Ram, AMD Radeon R9 270X

Youtube:
The German Music Dude: https://www.youtube.com/user/DeutscherVolker
DK Productions: https://www.youtube.com/channel/UCIqwvScXnJL_zNYqSsfTCqA
Len the man
8
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 28th Jan 2017 18:06
Could one of these scripts be altered to make a HUD for the number of lives a player has, or would it need another script to put in the game.
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 28th Jan 2017 19:11
Here you go ....

lives_hud.lua


You will need to create a background image called lives.png and place it in your scriptbank\images folder.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.

Attachments

Login to view attachments
Len the man
8
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 28th Jan 2017 20:46
Thanks again Belidos...
PM
lotgd
3D Media Maker
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 22nd Feb 2017 19:39
hi, thank you for all. i have a problem whit lives_hud.lua
See attachment file

Attachments

Login to view attachments
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 22nd Feb 2017 20:26 Edited at: 22nd Feb 2017 20:26
Yeah there's something odd happens when you copy/paste from the code box on the forum, I wrote the script on the forum then copy/pasted it to a file and uploaded it, I've uploaded a new copy that should work (see attached file).

1. Place any entity you want to hold the script
2. In properties change "Static Mode" to NO
3. In properties change "Always Active" to YES
4. Change "Main" to the lives_hud.lua script
5. Place an image named lives.png in your scriptbank/images folder (this is whatever image you want as a background)

You can change the size and position of the image, and the position of the text in section called "HUD Locations and Sizes"

Run the game and enjoy.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.

Attachments

Login to view attachments
lotgd
3D Media Maker
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 22nd Feb 2017 21:10
Thank you, the last script work great!
first lives_hug.lua dont work.

THANKS!

Attachments

Login to view attachments
IndieFrell
7
Years of Service
User Offline
Joined: 23rd Apr 2016
Location: Our House in the middle of our street
Posted: 23rd Feb 2017 10:55
Cheers for this, this looks more like that sort of HUD id want
Build Test Sell Repeat...
PM
Fasold
6
Years of Service
User Offline
Joined: 26th Apr 2017
Location:
Posted: 28th Apr 2017 12:29
Hi,

Thanks for your work, it looks very nice!

Only, I get an error when I try the HUD script. I have created the healthbar folder and added the script to an object. The old hud is gone, but when I
press the Tilde button, I get an error. "Runtime error 501 : image number 96000 ()"

I'm pretty bad with coding, so I have no idea what this means...

Best regards,

Fasold

Attachments

Login to view attachments
PM
tommy8
GameGuru TGC Backer
16
Years of Service
User Offline
Joined: 24th Dec 2007
Location: Northern Ireland
Posted: 29th Apr 2017 01:40
The links arent working for me
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 29th Apr 2017 08:36
@ Tommy8. Just tried the link to my HUD script, working fine here, download-wise.
@ fasold. It sounds like you are failing to load an image. You will need to add your own as I only included the script here.

Make sure you have an image in this directory:- "scriptbank\images\healthbar\health.png"

Call it health.png or rename the image loaded in the script.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
Fasold
6
Years of Service
User Offline
Joined: 26th Apr 2017
Location:
Posted: 30th Apr 2017 08:57
Thanks for the help!

I'll go do that right away.
PM

Login to post a reply

Server time is: 2024-04-18 03:46:50
Your offset time is: 2024-04-18 03:46:50