FighterHud Alpha

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

Moderators: winston, another_commander

User avatar
JeffBTX
---- E L I T E ----
---- E L I T E ----
Posts: 366
Joined: Sun Dec 27, 2009 2:23 pm
Location: Abilene Texas

Post by JeffBTX »

JazHaz;
I found it not that hard to do, once I understand how it all worked. Hopefully I've explained everything OK. Adapting the FighterHud to 1680x1050 was fun, and it gave me a few ideas.

I will not be working with the FighterHud anymore... I think I want to put together my own hud; so for the time being, I am falling back to the default Oolite hud.

WHEN I get around to it, the dashboard (which will be completely opaque, but not-as-tall; text will not be obscured) will be rendered in my favorite raytracer;
http://www.povray.org
... it will probably be optimized for a 1680x1050 screen though.

ClymAngus;
Medusa was one of the ones that I download to study, and to learn from. I like the concept of integrating roll/pitch indicators with the compass.

What I WOULD LIKE to do, is to integrate status (or threat level; green, yellow, red) with the radar scanner display. The radar gridlines / outline would be green, yellow or red based on threat level (or blue if a certain piece of mission-related equipment is installed and active, thanks Kaks!). BUT I've searched the wiki, and I don't think Oolite has a way of extracting the player's current threat level at this time.
Sword, thy name is Cobra. And Cobra has fangs!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

JeffBTX wrote:
BUT I've searched the wiki, and I don't think Oolite has a way of extracting the player's current threat level at this time.
It has. Using JavaScript, you can query the player's alert condition using

Code: Select all

player.alertCondition
in a script and Oolite responds with 0 for docked, 1 for green, 2 for yellow and 3 for red.
User avatar
JeffBTX
---- E L I T E ----
---- E L I T E ----
Posts: 366
Joined: Sun Dec 27, 2009 2:23 pm
Location: Abilene Texas

Post by JeffBTX »

another_commander;

Ah! Found it, thanks, and also this:

Code: Select all

alertConditionChanged 
The alertConditionChanged handler is called when the player’s alert status (player.alertCondition) changes. Only the player and stations have an alert condition. (world script and station scripts) 

this.alertConditionChanged = function(newCondition, oldCondition)
{
     // Your code here
}
I'm not sure how (if) it can be linked to a hud.plist (hopefully in a simple way)? Specifically this secton:

Code: Select all

<dict><!-- scanner --> 
         <key>alpha</key> 
         <real>0.8</real> 
         <key>selector</key> 
         <string>drawScanner:</string> 
         <key>x</key> 
         <integer>1</integer> 
         <key>y</key> 
         <integer>-190</integer> 
         <key>height</key> 
         <real>62</real> 
         <key>width</key> 
         <real>182</real> 
               <key>rgb_color</key> 
               <array> 
                  <real>0.5</real> 
                  <real>1.0</real> 
                  <real>0.5</real> 
               </array> 
... and is

Code: Select all

player.alertCondition
affected by the Cloaking Device?
Sword, thy name is Cobra. And Cobra has fangs!
User avatar
JeffBTX
---- E L I T E ----
---- E L I T E ----
Posts: 366
Joined: Sun Dec 27, 2009 2:23 pm
Location: Abilene Texas

Post by JeffBTX »

Ah! Found it, thanks, and also this:

Code: Select all

alertConditionChanged 
The alertConditionChanged handler is called when the player’s alert status (player.alertCondition) changes. Only the player and stations have an alert condition. (world script and station scripts) 

this.alertConditionChanged = function(newCondition, oldCondition)
{
     // Your code here
}
I'm not sure how (if) it can be linked to a hud.plist (hopefully in a simple way)? Specifically this section (rgb_color):

Code: Select all

<dict><!-- scanner --> 
         <key>alpha</key> 
         <real>0.8</real> 
         <key>selector</key> 
         <string>drawScanner:</string> 
         <key>x</key> 
         <integer>1</integer> 
         <key>y</key> 
         <integer>-190</integer> 
         <key>height</key> 
         <real>62</real> 
         <key>width</key> 
         <real>182</real> 
               <key>rgb_color</key> 
               <array> 
                  <real>0.5</real> 
                  <real>1.0</real> 
                  <real>0.5</real> 
               </array> 
... and is

Code: Select all

player.alertCondition
affected by the Cloaking Device?
Sword, thy name is Cobra. And Cobra has fangs!
Post Reply