Page 1 of 3

Release: Switching MilHUD

Posted: Thu Jul 08, 2010 2:17 pm
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. :)

Posted: Thu Jul 08, 2010 2:48 pm
by JazHaz
Thanks for doing this, MilHUD has been my HUD of choice for a while now.

Re: Release: Switching MilHUD

Posted: Thu Jul 08, 2010 2:58 pm
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:

Re: Release: Switching MilHUD

Posted: Thu Jul 08, 2010 3:08 pm
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.

Posted: Thu Jul 08, 2010 5:01 pm
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.

Posted: Mon Aug 09, 2010 4:54 pm
by Cmdr Wyvern
There seems to be a demand for it, so...
bumpity-bump-bump. :wink:

Posted: Mon Aug 09, 2010 6:55 pm
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.

Posted: Mon Aug 09, 2010 7:30 pm
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

Posted: Mon Aug 09, 2010 8:50 pm
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.

Posted: Fri Sep 17, 2010 4:34 am
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.

Posted: Fri Sep 17, 2010 5:18 am
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.

Posted: Fri Sep 17, 2010 5:27 am
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;
         }
         }

Posted: Fri Sep 17, 2010 5:33 am
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.

Posted: Fri Sep 17, 2010 5:51 am
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.

Posted: Fri Sep 17, 2010 5:55 am
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.