My actual question is having to do with having the HUD indicate being_cloaked (in addition to the status indicator light).
-----
I haven't implemented an engine sound handling script yet, I just haven't gotten around to it. I WILL do it, though. Too busy with other things.
Also, I had the idea that INSTEAD OF "EngineUP" and "EngineDOWN", and also an "EngineRUNNING", why not just "slice up" my throttle extents into ranges (indirectly; actually the game directly checks the Player Ship Speed), and have different sounds (actually "variations on a theme") play depending on where the throttle is.
BTW I am using GoldWave 5.52 for audio processing/creation (registered; I've used GoldWave for years).
BTW I use a Saitek X52 Pro. There are "detents" on the throttle that you can feel at 25% and 75% (but I am not sure how accurate it is; testing would be required). There is a ring of little LEDs in parallel to the scale on the throttle; they are green at and below 75%, red above 75%. AS IT HAPPENS, "safe docking speed" is CLOSE to 25% (actually can go a TINY BIT faster).
(1) Fuel Injectors are covered; I am using the customsounds.plist with a custom afterburner1.ogg. This sound is "jet engine-y" (created from scratch within GoldWave with brown noise as a base), but with a "shaky rhythmic AM envelope", and a .WAV of "Fire Rumbling" mixed in (I downloaded FireRumbling from a public domain soundclip site). It's cool; "deep", "powerful", MODERATELY loud (not excessive) and you get the idea that when you are using Fuel Injectors, your ship is "shaking" a bit.
... then (just for example, I haven't created or implemented it yet):
(2) EngineIdling; player ship speed is less then (say) 2% (2% of player ship max speed).
(3) EngineLow; speed is between, say 3% and 25%.
(4) EngineMedium; 26% to 75%.
(5) EngineHigh; 76% to, say, 7x (Actually overlaps w/ afterburner1.ogg; maybe need to modify this).
((1)) ... above 100% up to 7x player ship max speed is covered by afterburner1.ogg
(7) From, say, 8x + player ship max speed = EngineTorus.
EngineIdling, EngineLow, EngineMedium and EngineHigh = "variations on a theme". There will be a "beat" mixed in with it. From Low to High the pitch increases and the "beat" increases. EngineTorus will be similar, but it will use a "different beat sound" to imply something different.
The exact "divisions" MAY be linked to where the 2 detents on my throttle are, or they MAY be linked to the color of the Oolite HUD Speed Bar (green/yellow/red)... I will have to play w/ it and see.
... just my thoughts. When I get it done I'll post the script. I will probably want advice; the script might WORK, but will it be EFFICIENT? "Elegant"?
--------
ANYWAY. Sorry. Wanted to post my thoughts on engine sounds in case anyone had advice, hints, "hidden gotchas" waiting to bite me.
My question for THIS POST.
The basic dynamic hud script that is being used by people; what would be the BEST way to detect being cloaked, and to display a cloak-specific hud?.
Shove "shipCloakActivated()" and "shipCloakDeactivated()" inside the "energyCheck" function? Can we do that (I assume so); nest functions inside other functions? This way, only one timer would be involved ("energyCheckTimer"). Don't know if that is "elegant"...
OR... use a seperate timer?
Here is the dynamic hud script I have, for reference (borrowed / modified from MilSpec HUD):
Code: Select all
this.name = "genericHUDswitch.js";
this.author = "Thargoid";
this.copyright = "Do what you want with it";
this.description = "Switches HUDs based on alert condition and ships energy";
this.version = "1.01, modified by Wyvern";
this.alertConditionChanged = function(newCondition, oldCondition)
{
switch(newCondition)
{
case 0: // we're docked
{
player.ship.hud = "jbhuddck.plist"; // set the docked HUD
timeAccelerationFactor = 1.0; // Insure TAF is off when docked.
break;
}
case 1: // we're at green alert
{
if(player.ship.energy > 108) // if we're not using the damaged HUD
{
player.ship.hud = "jbhudgrn.plist"; // set the standard HUD
}
break;
}
case 2: // we're at yellow alert
{
if(player.ship.energy > 108) // if we're not using the damaged HUD
{
player.ship.hud = "jbhudyel.plist"; // set the yellow alert HUD
}
break;
}
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 = "jbhudred.plist"; // set the combat HUD
timeAccelerationFactor = 1.0; // Insure TAF is off when player is attacked.
}
break;
}
}
}
this.shipLaunchedFromStation = function()
{
if(this.energyCheckTimer)
{
this.energyCheckTimer.start()
}
else
{
this.energyCheckTimer = new Timer(this, this.energyCheck,0,2) // use a timer to keep an eye on the HUD state
}
}
this.energyCheck = function()
{
if(player.ship.docked)
{
this.energyCheckTimer.stop();
}
else
{
if(player.ship.energy < 109 )
{
player.ship.hud = "jbhudcrt.plist"; // display the damaged HUD
return;
}
if(player.ship.energy > 108 && player.ship.hud == "jbhudcrt.plist")
{
this.alertConditionChanged(player.alertCondition,0); // if energy is >49 and we're still displaying the damaged HUD, use other code to repair
}
}
}
this.shipDied = function()
{
if(this.energyCheckTimer)
{
this.energyCheckTimer.stop()
}
}
this.shipExitedWitchspace = function()
{
timeAccelerationFactor = 1.0;
}
http://www.flickr.com/photos/34159828@N06/
... except less "intense", and ... "Blue".