Re: [Release] Coluber HUD No. 1
Posted: Mon Nov 24, 2014 8:45 am
very appropriate... lol every body sing.... "It's cold outside there's no kind of atmosphere...."
For information and discussion about Oolite.
https://bb.oolite.space/
"Does anyone want any toast?"spud42 wrote:very appropriate... lol every body sing.... "It's cold outside there's no kind of atmosphere...."
Nice idea.Mazur wrote:adding the numerical 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
}
}
combatSpeed
calculated by CombatMFD which support [wiki]FarPlanets[/wiki] and probably any future OXPs also which use position changes to manipulate the speed.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;
},
This is a bit more tricky due to you must locate the altitude from the nearest mass around you, like this:Mazur wrote:the numerical height if lower than 100
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);
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;
},
This is not supported by the core, so you should place a big real clock next to your display.Mazur wrote:a Real World clock
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:Nice idea.Mazur wrote:adding the numerical speed
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 thecombatSpeed
calculated by CombatMFD which support [wiki]FarPlanets[/wiki] and probably any future OXPs also which use position changes to manipulate the speed.
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:This is a bit more tricky due to you must locate the altitude from the nearest mass around you, like this:Mazur wrote:the numerical height if lower than 100
[snip]
Why are you interested below 100m only? I think 1000m would be better due to [wiki]PlanetFall[/wiki] detect landing at 500m.
Pity. Oh, well, I could only ask.Norby wrote:This is not supported by the core, so you should place a big real clock next to your display.Mazur wrote:a Real World clock
Oh, goodly! I was already preparing to make an unofficlal 1.0.1 update available here through Dropbox, butNorby 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.
Ha, that's about the only sciency thing I know, so I get a chance to show off whenever it comes upNorby wrote:
* Removed degree sign from cabin temp, thanks to Smivs.
Could it not be displayed below the speed number? There's some "free" room there...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.
Me like* Gauges are hidden in dock to allow big gui.
I noticed these things as well, and fixed the errant ° here. (But forgot to increase the version number 1.1 to 1.1.1).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.
This is a core bug imho when the new allow_big_gui is true, I can not fix.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
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.Tichy wrote:I see two Coluber HUD CH01 in the Expansion Manager.