[HUD Dev] Display speed in meters?

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

Moderators: winston, another_commander

Post Reply
User avatar
pleiadian
Deadly
Deadly
Posts: 143
Joined: Mon Feb 20, 2017 2:14 pm

[HUD Dev] Display speed in meters?

Post 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?
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [HUD Dev] Display speed in meters?

Post by spara »

Variable combatSpeed is from Combat MFD.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [HUD Dev] Display speed in meters?

Post 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.
Post Reply