Release: Switching MilHUD

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

Moderators: another_commander, winston

User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Release: Switching MilHUD

Post by Cmdr Wyvern »

Readme -

MilHUD 3.4 by Wyvern - Based on GenericHUD by KW and Thargoid, and MilHUD 3.1 by Wyvern
Oolite version: 1.74+
=======================================================================================
This is a mode-switching version of MilHUD 3.1, displaying HUD "modes" depending on condition.

MODES: (See included screenshots)
- Docked: All instruments disabled when docked, except the clock and missile/mine display.
- Green: Gun pippers switched off, reticule sensetivity disabled; scanner, zoom, and sights turn green. A good indicator that you're clear to engage Supercruise.
- Yellow: A basic sniper gun pipper appears, reticule sensetivity disabled; scanner, zoom, and sights turn yellow. Masslocked, could be hostiles around. If you want to get in a pre-emptive strike, this mode lets you.
- Red: Gun pipper swiches to advanced mode, reticule sensetivity enabled; zoom and sights turn red, scanner takes on high-contrast blue-green. This is full combat mode, time to kick some ass.
- Critical: Gun pipper, reticule sensetivity, and most instruments disabled. A warning message appears. If you see this, then your shields are down, you're out of energy, and you're about to take a sudden, unwelcome spacewalk. Yank the eject handle.
=========================================================================================

Target Reticule oxp doesn't work with this (it doesn't work with GenericHUD either), so it's function is built-in.
TAF_Reset oxp isn't needed with this, it's functions are built-in. TAF reset function kicks in when docked, Witching to a new system, and when Condition Red. Unless you use time acceleration, you won't notice.

INSTALLATION:
Remove all HUD oxps that replace the standard HUD (including GenericHUD and older MilHUD), TAF_Reset and Target Reticule from your AddOns directory, and drop this in. Simple as that. Full functionality will kick in as soon as you launch.

Credit where it's due:
This uses a modified version of Thargoid's script used in GenericHUD.
=========================================================================================

Grab it here, give it a spin around Reidquat, and tell me what you think. :)
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Post by JazHaz »

Thanks for doing this, MilHUD has been my HUD of choice for a while now.
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: Release: Switching MilHUD

Post by JazHaz »

Cmdr Wyvern wrote:
TAF_Reset oxp isn't needed with this, it's functions are built-in. TAF reset function kicks in when docked, Witching to a new system, and when Condition Red. Unless you use time acceleration, you won't notice.)
Hmm! This means I can't cheat any more by stopping big pirate groups from locking onto me at high TAF! :evil:

EDIT: will have to use the Cloaking Device more, instead! :wink:
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: Release: Switching MilHUD

Post by Cmdr Wyvern »

JazHaz wrote:
Cmdr Wyvern wrote:
TAF_Reset oxp isn't needed with this, it's functions are built-in. TAF reset function kicks in when docked, Witching to a new system, and when Condition Red. Unless you use time acceleration, you won't notice.)
Hmm! This means I can't cheat any more by stopping big pirate groups from locking onto me at high TAF! :evil:

EDIT: will have to use the Cloaking Device more, instead! :wink:
Isn't that a PITA? :lol: :twisted: But that's what E-bombs, Q-bombs, and U-bombs are made for, don't you know. After all, you won't get to ***ELITE*** by running away.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I'd offer the same comment concerning the script usage here as with the generic HUD. To save repeating or quoting myself, see here.

Using the script as a player ship script rather than a worldScript is probably a better way of doing it, albeit one that's slightly more complex to install.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

There seems to be a demand for it, so...
bumpity-bump-bump. :wink:
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 320
Joined: Sun Jun 20, 2010 6:00 pm

Post by mcarans »

Please add details of your HUD here:
http://wiki.alioth.net/index.php/OXP_Enhancements

I too use MilHUD (and TAF reset). I'll try this out now. Thanks for writing it.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

mcarans wrote:
Please add details of your HUD here:
http://wiki.alioth.net/index.php/OXP_Enhancements

I too use MilHUD (and TAF reset). I'll try this out now. Thanks for writing it.
I added the download link to MilHUD's wiki page
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 320
Joined: Sun Jun 20, 2010 6:00 pm

Post by mcarans »

Ok cool. I have added your name as author to http://wiki.alioth.net/index.php/OXP_Enhancements

Just been playing with the HUD. It's great. I like the way you integrated TAF reset.
User avatar
Dustin542
Average
Average
Posts: 15
Joined: Tue Sep 14, 2010 7:44 pm

Post by Dustin542 »

Hey new here on the forum.

I was wondering if it would be possible to put an in script.js, if TAF<1.0 don't reset it or if >1.0 do reset when targeted in . Sometimes I like to slow things down to aim my shots better and dodge. When the TAF gets reset it suddenly goes quite fast in the meantime. If not in the next version perhaps a code example so I might change it myself.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Code: Select all

if(timeAccelerationFactor > 1) { timeAccelerationFactor = 1; }
If that line is run in js, it will cap the TAF at 1.0. Add at the appropriate position where you want it checked and triggered in the script.
User avatar
Dustin542
Average
Average
Posts: 15
Joined: Tue Sep 14, 2010 7:44 pm

Post by Dustin542 »

Does this look ok?

Code: Select all

 case 3: // we're at red alert
         {
         if(player.alertHostiles && player.ship.energy > 108) // and under attack and not using the damaged HUD
            {
            player.ship.hud = "milhudred.plist"; // set the combat HUD
    if(timeAccelerationFactor > 1) { timeAccelerationFactor = 1; // Insure TAF is off when player is attacked. 
    }
            }
         break;
         }
         }
Last edited by Dustin542 on Fri Sep 17, 2010 5:51 am, edited 2 times in total.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

That will only trigger the red milHUD if you're at TAF > 1 (and at red alert and with non-critical energy levels). If you're at TAF 1 or below then the if statement won't be fulfilled.

Remember that in the given case ALL factors in the if statement must be true for the code associated with it to trigger (&& is the logical AND statement in JS). I'm not sure that's quite what you want - sometimes it is better to use seperate (embedded or sequential as appropriate) if statements to do different functions. You risk merging the requirements for TAF with the setting of red milHUD, which you don't want I think.

For example if you remove the timeAccelerationFactor check from the if (restore it to how it was before) but add the whole line I quoted originally to where you have timeAccelerationFactor = 1.0; in your code it will check the TAF independently and reset it when the red milHUD is displayed.
User avatar
Dustin542
Average
Average
Posts: 15
Joined: Tue Sep 14, 2010 7:44 pm

Post by Dustin542 »

Ok, I changed it again. I hope I have the right amount of corresponding brackets. I put its current state in my previous post.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

For the code snippet you've got an extra } at the bottom (indenting is your friend here). There are 3x { and 4x } .

Aside from that it looks fine. It will trigger the red milHUD as before, but if the red milHUD is triggered (and only then) it will then separately check if TAF > 1 and cap that to TAF = 1 too.

It's not quite TAF is off, as if TAF < 1 (time is slowed) then that state will continue. But I don't think you would object to that, it's just accelerated time that you don't want in combat.
Post Reply