[Release] Coluber HUD No. 1

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

Moderators: another_commander, winston

User avatar
spud42
---- E L I T E ----
---- E L I T E ----
Posts: 1275
Joined: Wed Mar 26, 2014 10:11 am
Location: Brisbane,Australia

Re: [Release] Coluber HUD No. 1

Post by spud42 »

very appropriate... lol every body sing.... "It's cold outside there's no kind of atmosphere...."
Arthur: OK. Leave this to me. I'm British. I know how to queue.
OR i could go with
Arthur Dent: I always said there was something fundamentally wrong with the universe.
or simply
42

User avatar
Ranthe
---- E L I T E ----
---- E L I T E ----
Posts: 330
Joined: Sat Oct 13, 2012 7:35 pm
Location: Paraparaumu, New Zealand (TL 8, Rich Agricultural, Multi-Government)

Re: [Release] Coluber HUD No. 1

Post by Ranthe »

spud42 wrote:very appropriate... lol every body sing.... "It's cold outside there's no kind of atmosphere...."
"Does anyone want any toast?" :mrgreen:
Commander Ranthe: Flying the Anaconda-class transport Atomic Annie through Galaxy 2.
Combat Ranking: Dangerous
"Big ships take more booty on your interstellar flights..."

User avatar
Mazur
Dangerous
Dangerous
Posts: 110
Joined: Thu Jun 04, 2015 7:53 pm

Re: [Release] Coluber HUD No. 1

Post by Mazur »

Hi, I'm loving the Coluber HUD, it's quietly beautiful and functional at the same time. :)

I had only only little issue with it: when I'd started out with a brand spanking new Cobra from the start, the guidelines are absent. It was not until started buying more and more equipment, that all of a sudden the horizontal appeared, still waiting for the vertical one.

Also, I'm trying to make three minor changes: adding the numerical speed in the top-right corner just outside the scanner, the numerical height if lower than 100, and a Real World clock, to help remind me of the time when I keep playing too long.

I've a working unpacked Coluber HUD in my ~/.Oolite/AddOns, now, (made a requires.plist with fictional content,) and will report back if i come anywhere near succeeding. Or not.

Thank you for an appealing functional HUD!
User Mazur, Commander Vatta, Hyperspace Delivery Boy.
Squeaky clean, utterly harmless, rank amateur.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2560
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [Release] Coluber HUD No. 1

Post by Norby »

Mazur wrote:adding the numerical speed
Nice idea. :)
Avoid player.ship.speed if you want to see injector and torus speeds.
Add these into the script.js which use velocity to get the speed:

Code: Select all

this.shipWillLaunchFromStation = function() {
	this._combat_MFD = worldScripts.combat_MFD;
	if( !this.$Timer ) {
		this.$Timer = new Timer(this, this._update.bind(this), 0, 0.25);
	}
}

this._centeredText = function(txt, width) {
	var t = ""+txt; //force to srting, else txt.length is undefined for numbers
	var w = width / 2;
	while( t && t.length < w ) { //for fixed with font in setCustomHUDDial
		t = " " + t;
	}
	return(t);
}

this._update = function () {
	var p = player.ship;
	if( !p || !p.isValid ) return; //player died

	var setd = p.setCustomHUDDial;
	if( setd ) {
		if( !this._combat_MFD ) { //prefer CombatMFD if available
			var sp = Math.round(p.velocity.magnitude()/10)*10;
			sp = this._centeredText(sp, 28); //default width
			setd("combatSpeed", sp);
		}
		
		//insert the altitude code here
	}
}
Speed value is rounded to 10 to reduce flickering and a small inaccuracy in max. speed.
Will refresh the value 4 times in a second. More is not better just need a bit more CPU and timers can not be set to run more often.
The last "if" avoid an error in the log if somebody still use Oolite 1.80 due to setCustomHUDDial is introduced in 1.81 and this is not a very improtant function which worth to increase the reuired Oolite version of the whole HUD.

This code is not enough if you use [wiki]TorusToSun[/wiki], in this case you should use the combatSpeed calculated by CombatMFD which support [wiki]FarPlanets[/wiki] and probably any future OXPs also which use position changes to manipulate the speed.

Either way you must add this into the dials section in coluberhud.plist:

Code: Select all

		{//S P E E D
			data_source = "combatSpeed";
			selector = "drawCustomText:";
			alpha = 1.0; 
			height = 13; 
			width = 15; 
			x = 95; 
			y = 105; 
			y_origin = -1; 
		},
Mazur wrote:the numerical height if lower than 100
This is a bit more tricky due to you must locate the altitude from the nearest mass around you, like this:

Code: Select all

		var c = system.sun;
		if( c ) var d = p.position.distanceTo( c.position );
		else var d = 100000000000000000000.0; //10^20m for sure
		var l = system.planets;
		var len = l.length;
		for( var i = 0; i < len; i++ ) { //find the smallest distance
			var s = p.position.distanceTo( l[i].position )-l[i].radius;
			if( d > s ) {
				d = s;
				c = l[i];
			}
		}
		var alt = ""; //clear if no planetary object
		if( c ) {
			var a = p.position.distanceTo(c) - c.radius - p.collisionRadius;
			if( a < 100 ) alt = this._centeredText( Math.floor(a)+"m", 28 );
		}
		setd("combatAlt", alt);
The dial in coluberhud.plist:

Code: Select all

		{//A L T
			data_source = "nearAlt";
			selector = "drawCustomText:";
			alpha = 1.0; 
			height = 13; 
			width = 15; 
			x = 234; 
			y = 64; 
			y_origin = -1; 
		},
Image

Why are you interested below 100m only? I think 1000m would be better due to [wiki]PlanetFall[/wiki] detect landing at 500m.
Mazur wrote:a Real World clock
This is not supported by the core, so you should place a big real clock next to your display. ;)

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Disunited Kingdom
Contact:

Re: [Release] Coluber HUD No. 1

Post by Smivs »

Aaaaaaaaaargh!
degrees K again. There's no such thing, people.
Commander Smivs, the friendliest Gourd this side of Riedquat.

User avatar
Mazur
Dangerous
Dangerous
Posts: 110
Joined: Thu Jun 04, 2015 7:53 pm

Re: [Release] Coluber HUD No. 1

Post by Mazur »

Norby wrote:
Mazur wrote:adding the numerical speed
Nice idea. :)
Avoid player.ship.speed if you want to see injector and torus speeds.
Add these into the script.js which use velocity to get the speed:

[snip]

Speed value is rounded to 10 to reduce flickering and a small inaccuracy in max. speed.
Will refresh the value 4 times in a second. More is not better just need a bit more CPU and timers can not be set to run more often.
The last "if" avoid an error in the log if somebody still use Oolite 1.80 due to setCustomHUDDial is introduced in 1.81 and this is not a very improtant function which worth to increase the reuired Oolite version of the whole HUD.

This code is not enough if you use [wiki]TorusToSun[/wiki], in this case you should use the combatSpeed calculated by CombatMFD which support [wiki]FarPlanets[/wiki] and probably any future OXPs also which use position changes to manipulate the speed.
Of course I use TorusToSun, I'm a trader, I use Market Inquirer to identify the best place to drop off my cargo, and simply haul something local to the cheapest place I can buy my outgoing cargo, but not if it takes 6 hours to do so... ;)
Norby wrote:
Mazur wrote:the numerical height if lower than 100
This is a bit more tricky due to you must locate the altitude from the nearest mass around you, like this:

[snip]

Why are you interested below 100m only? I think 1000m would be better due to [wiki]PlanetFall[/wiki] detect landing at 500m.
Meters? I had not thought as far as that, but yes, the exact distance in meters can be a factor of importance if for instance one has to make a "soft landing" or flyby, like in picking up a derellict to tow. I can imagine someone making a piece of equipment or mission, where the rough indication that is the ALT bar is not quite precise enough for a slow reacting pilot like me.
Norby wrote:
Mazur wrote:a Real World clock
This is not supported by the core, so you should place a big real clock next to your display. ;)
Pity. Oh, well, I could only ask.
User Mazur, Commander Vatta, Hyperspace Delivery Boy.
Squeaky clean, utterly harmless, rank amateur.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2560
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [Release] Coluber HUD No. 1

Post by Norby »

Due to the author is not logged in since jan I uploaded an update (v1.1):

* Removed degree sign from cabin temp, thanks to Smivs.
* Added numeric ship speed display and a numeric altitude meter below 1000m.
* Gauges are hidden in dock to allow big gui.
* Clock moved a bit to fit into Xenon UI.

User avatar
Mazur
Dangerous
Dangerous
Posts: 110
Joined: Thu Jun 04, 2015 7:53 pm

Re: [Release] Coluber HUD No. 1

Post by Mazur »

Norby wrote:Due to the author is not logged in since jan I uploaded an update (v1.1):

* Removed degree sign from cabin temp, thanks to Smivs.
* Added numeric ship speed display and a numeric altitude meter below 1000m.
* Gauges are hidden in dock to allow big gui.
* Clock moved a bit to fit into Xenon UI.
Oh, goodly! I was already preparing to make an unofficlal 1.0.1 update available here through Dropbox, but
1. you are far more versed in the whole OXP business (truth be told, _everyone_ is, but never mind that. ;) )
2. you were the one making the necessary changes
3. You can and did make it through offcial channels.

There is still the minor issue, of the guidelines not being drawn in fullscreen mode (1280x800), but only in windowed mode, and then only the horizontal. I'll keep looking into that to find the reason.

Btw, the actual 1.0 release had already changed the erroneous °K to K. You must still have had a development release.

Anecdote: The original reason for me to ask for the height in numbers was, some time ago I was cruising to a Kiota, mind wandering, probably thinking about where I'd go from there, when the alarm sounded, so, as I was reaching for the injector, I noticed no pirate in sight... "What then?", I wondered in that split second, and I noticed the text 7km, which made a clearer impression on me than the heightbar, which has no immediate meaning in my mind yet. I decided to reduce speed and pull up, instead, and lived. Kiota was on the other side of the planet, of course.
User Mazur, Commander Vatta, Hyperspace Delivery Boy.
Squeaky clean, utterly harmless, rank amateur.

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Disunited Kingdom
Contact:

Re: [Release] Coluber HUD No. 1

Post by Smivs »

Norby wrote:
* Removed degree sign from cabin temp, thanks to Smivs.
Ha, that's about the only sciency thing I know, so I get a chance to show off whenever it comes up :lol:
Commander Smivs, the friendliest Gourd this side of Riedquat.

User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Re: [Release] Coluber HUD No. 1

Post by ffutures »

One thing I asked for on this ages ago - it would be nice to have the "joystick sensitivity on/off" indicator enabled. The trouble is that I think it normally goes exactly where you've got the speedo number displayed.

User avatar
Mazur
Dangerous
Dangerous
Posts: 110
Joined: Thu Jun 04, 2015 7:53 pm

Re: [Release] Coluber HUD No. 1

Post by Mazur »

ffutures wrote:One thing I asked for on this ages ago - it would be nice to have the "joystick sensitivity on/off" indicator enabled. The trouble is that I think it normally goes exactly where you've got the speedo number displayed.
Could it not be displayed below the speed number? There's some "free" room there...
User Mazur, Commander Vatta, Hyperspace Delivery Boy.
Squeaky clean, utterly harmless, rank amateur.

mohawk
Competent
Competent
Posts: 46
Joined: Thu Feb 28, 2013 1:21 pm

Re: [Release] Coluber HUD No. 1

Post by mohawk »

* Gauges are hidden in dock to allow big gui.
Me like :D
But in the f5 screen if the equipment are too much to fit the screen the arrows right/left don't work to change the page

User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

Re: [Release] Coluber HUD No. 1

Post by Tichy »

I downloaded it yesterday, but it seems there's another °K in the weapon temperature gauge.
Also, I see two Coluber HUD CH01 in the Expansion Manager.

User avatar
Mazur
Dangerous
Dangerous
Posts: 110
Joined: Thu Jun 04, 2015 7:53 pm

Re: [Release] Coluber HUD No. 1

Post by Mazur »

Tichy wrote:I downloaded it yesterday, but it seems there's another °K in the weapon temperature gauge.
Also, I see two Coluber HUD CH01 in the Expansion Manager.
I noticed these things as well, and fixed the errant ° here. (But forgot to increase the version number 1.1 to 1.1.1).
The other weirdness I can neither explain nor fix.

Hopefully someone able will make the necessary moves to make this one officlal.

[Edit] However, somehow my GIMP seems not to have preserved the alpha channel, and the blue colour is off, new attempt in a bit.

[2nd Edit] {url=https://dl.dropboxusercontent.com/u/169 ... d_ch01.oxz]This version 1.1.1[/url] looks ok in game, though it looks different in a regular image viewer.
User Mazur, Commander Vatta, Hyperspace Delivery Boy.
Squeaky clean, utterly harmless, rank amateur.

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2560
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [Release] Coluber HUD No. 1

Post by Norby »

In version 1.2:
* Joystick sensitivity indicator enabled
* Alert sensitive scanner color
* Another degree fix by Mazur
* Allow big gui (longer equipment list in F5) disabled during flight
mohawk wrote:in the f5 screen if the equipment are too much to fit the screen the arrows right/left don't work to change the page
This is a core bug imho when the new allow_big_gui is true, I can not fix.
Tichy wrote:I see two Coluber HUD CH01 in the Expansion Manager.
You will see both until we decide that the original author, Captain Beatnik is missing permanently and somebody ask cim to remove the old manifest entry (I can handle the new one only). Until then you can select if you want the old or the new version.

Post Reply