Page 1 of 1

[HUD Dev] Display speed in meters?

Posted: Thu Apr 13, 2017 7:33 pm
by pleiadian
So I'm trying to figure out how to get the integer of the ship's current speed. Obviously that speed is measured in meters per second. Some HUDs do display that number and I downloaded two of them as example.

In the ExtraLarge HUD, I found this segment:

Code: Select all

data_source = "combatSpeed"; selector = "drawCustomText:";
// alert_conditions = 2; //uncomment if you want to see in green alert only
alpha = 1.0; height = 13; width = 15; x = 211; y = 82; y_origin = -1; },
I placed the same in my hud.plist, but slightly changed, like so:

Code: Select all

// SPEED IN M PER SECOND
{
	data_source = "combatSpeed"; selector = "drawCustomText:"; 
	alert_conditions = 14;
	alpha = 0.55; height = 13; width = 15; x = 0; y = 120; y_origin = 0; x_origin=0;
},
I do not see that number though. Later I checked if maybe the Javascript of ExtraLarge HUD (HUD Selector) contains a call for that, but also nothing. I'm a bit puzzled.

Can you give me some pointers regarding how to get that integer?

Re: [HUD Dev] Display speed in meters?

Posted: Thu Apr 13, 2017 7:49 pm
by spara
Variable combatSpeed is from Combat MFD.

Re: [HUD Dev] Display speed in meters?

Posted: Thu Apr 13, 2017 9:26 pm
by Norby
Yes, Combat MFD contain the calculations of speed including support for some speed-related addons like TorusToSun. You can make your HUD depending on Combat MFD by placing a requires_oxps block into your mainfest.plist.