I made myself a hud

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
lave
Deadly
Deadly
Posts: 141
Joined: Thu Sep 09, 2010 12:21 am
Location: Deep in Leesti space mining asteroids for a living.
Contact:

I made myself a hud

Post by lave »

Hi.
I was bored today so I thought I'd have a go at making a hud for myself.
It is nothing special but I think it looks quite good.

Image
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Looks very nice. So... where do we download it from?
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post by Micha »

I would probably make the blue background a bit darker so that the green stands out better, but otherwise I have to agree with a_c: looks very nice.
The glass is twice as big as it needs to be.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

sweet. clear, no clutter, nicely laid out.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

That's really nice! Is the 'cross' the pitch and roll indicator? What happens if you're doing both simultaneously?
I don't do HUDs myself (note to self "do a HUD sometime"), and haven't looked into them, but I was just wondering about those indicator lights on the left panel. Can they be used as the 'Status' light?
Good work...and it is worth packaging up and releasing as an OXP.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
lave
Deadly
Deadly
Posts: 141
Joined: Thu Sep 09, 2010 12:21 am
Location: Deep in Leesti space mining asteroids for a living.
Contact:

Post by lave »

another_commander wrote:
Looks very nice. So... where do we download it from?
I'm not sure how to package it for download. If someone with access to the Wiki wishes me to email it to them for inclusion then I will.
Micha wrote:
I would probably make the blue background a bit darker so that the green stands out better
The blue background looks darker in game than it does in the images. But I could make it a bit darker.
Smivs wrote:
Is the 'cross' the pitch and roll indicator?
Yes.
Smivs wrote:
What happens if you're doing both simultaneously?
Then both yellow dots will move together.
Smivs wrote:
I was just wondering about those indicator lights on the left panel. Can they be used as the 'Status' light?
Well those lights are just there for decor and as far as I know a HUD image can't be changed depending on Status.
I was going to put the status light there actually, but it wouldn't have had the 'glow' around it like the other lights have.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

lave wrote:
Smivs wrote:
Is the 'cross' the pitch and roll indicator?
Yes.
Smivs wrote:
What happens if you're doing both simultaneously?
Then both yellow dots will move together.

Ah, I didn't realise there were two dots, that makes a lot more sense. There's plenty of info on the Wiki about making OXPs here, and we are always happy to answer questions. :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

lave wrote:
Smivs wrote:
I was just wondering about those indicator lights on the left panel. Can they be used as the 'Status' light?
Well those lights are just there for decor and as far as I know a HUD image can't be changed depending on Status.
I was going to put the status light there actually, but it wouldn't have had the 'glow' around it like the other lights have.
You can always make four HUD plists (let's call them greenhud.plist, yellowhud.plist, redhud.plist and dockedhud.plist), which are basically copies of the same HUD, with the exception that the greenhud.plist main image has a green light drawn on it, the yellowhud.plist image has a yellow one, the redhud.plist image has a red one and the dockedhud.plist image has no light drawn. The four images should reside inside your OXP's Images folder. Then, you can put this inside a file called script.js inside the Config folder of your OXP:

Code: Select all

this.alertConditionChanged = function(currentAlertCondition, previousAlertCondition)
{
	var hudToDisplay;
	switch (player.alertCondition)
	{		
		case 1:
			hudToDisplay = "greenhud.plist";
			break;
		
		case 2:
			hudToDisplay = "yellowhud.plist";
			break;
		
		case 3:
			hudToDisplay = "redhud.plist";
			break;
		
		default:
			hudToDisplay = "dockedhud.plist";
	};
   player.ship.hud = hudToDisplay;
}


this.startUp = function()
{
        player.ship.hud = "dockedhud.plist";
}
The above has not been tested at all, but I hope it would do the trick. When a player is loaded or on new game start, it will set the ship's HUD to the docked one. From there, every time there is a change in the player's alert status, it will change the HUD to the one containing the image you want. All the rest should be the same and the change happens quickly enough to not be visible. So, the effect would be to give the impression of the status lights changing.

Just an idea, as I said, I did not test it and maybe there are more efficient ways of doing it, but I believe it should do the job.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16055
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Post by Cody »

If that's what you can do when you're bored, I'd like to see what you can do if you really set your mind to it... nice one, lave.
lave wrote:
I'm not sure how to package it for download.
Some basic instructions on how to package an oxp, license it, host it, and make it available, might be a good idea for the Wiki ‘OXP - how to’ page, preferably written by someone who knows how to express it succinctly.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Post by maik »

Nice one! Seeing that you added the Shift-F info in the Ship DATA box brings me to this idea: how about using it for the comms log? It might need more lines though...
lave wrote:
I'm not sure how to package it for download. If someone with access to the Wiki wishes me to email it to them for inclusion then I will.
Sure, send it my way if you don't want to host it yourself. I would put it up for download on my box.net account.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

maik wrote:
how about using it for the comms log? It might need more lines though...
In 1.74.2 the comms log overrides were largely untested, and ever so slightly buggy.

They're perfectly ok in trunk, though... ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
lave
Deadly
Deadly
Posts: 141
Joined: Thu Sep 09, 2010 12:21 am
Location: Deep in Leesti space mining asteroids for a living.
Contact:

Post by lave »

another_commander wrote:
You can always make four HUD plists ..........

Code: Select all

this.alertConditionChanged = function(currentAlertCondition, previousAlertCondition)
{
	var hudToDisplay;
	switch (player.alertCondition)
	{		
		case 1:
			hudToDisplay = "greenhud.plist";
			break;
		
		case 2:
			hudToDisplay = "yellowhud.plist";
			break;
		
		case 3:
			hudToDisplay = "redhud.plist";
			break;
		
		default:
			hudToDisplay = "dockedhud.plist";
	};
   player.ship.hud = hudToDisplay;
}


this.startUp = function()
{
        player.ship.hud = "dockedhud.plist";
}
The above has not been tested at all, but I hope it would do the trick.
I'd like to try that however I have no idea how to write a Java Script file with the .js extention.

If someone could do it for me, with the above script, then I will try it out and see if it works.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

You only need to copy the contents of the Code: box and paste them as they are in an empty file in the text editor of your choice. Save that file with the filename script.js inside the Config folder of your HUD OXP and that's pretty much it.
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Very good looking! You should be bored more often :)
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
lave
Deadly
Deadly
Posts: 141
Joined: Thu Sep 09, 2010 12:21 am
Location: Deep in Leesti space mining asteroids for a living.
Contact:

Post by lave »

another_commander wrote:
You only need to copy the contents of the Code: box and paste them as they are in an empty file in the text editor of your choice. Save that file with the filename script.js inside the Config folder of your HUD OXP and that's pretty much it.
Oh OK thanks.

I will try that now and see what happens.


EDIT !!!!

I tried it and it only bloody worked lol.

The change in hud image when your condition changes is instant too.

This is so cool. It now means that I can do away with the 'status indicator' and instead have some sort of light or other indicator on the hud itself.

I can also give the blue screens a slight red colour too during a red alert.

I will do this tomorrow as it's late now, but I will post an update once it's done.

Thanks again.
Post Reply