You don't need this OXP. CustomShields does this perfectly well, doesn't it?
Shockingly, CustomShields is not quite 100% fair. It only recharges NPCs' shields once their energy banks are full, which clearly isn't the usual player ship behaviour. N-shields aims to rectify this, as well as letting NPC shields protect subentities as player ones have done since 1.77.
Other improvements are as follows:
-Attempting to provide better compatibility for other OXPs with shipTakingDamage overrides
-Support for very non-standard shield configurations(sorry, feature mostly removed in 0.7) Thargoids get dorsal/ventral shields.
-More customisable colours. The default multicolour set goes from green down to red for standard shields, extending to blue/purple with upgrades.
-New visual effects based on explosions.plist for shields and unshielded hits.
Fireworks!!! I like... Just tried it out, I'm not sure about the "star effect" when hit, being too dominant, but maybe one has to get accustomed to it.
Anyways, nice one!
For the record, I wholeheartedly approve of your 'Equal Rights for NPCs' campaign!
I want the assassins' fuel injectors to get damaged when I hit them with shields down then.
I may get beaten here though. Sometimes they go down as if their injectors were damaged, or they perhaps eject because their injectors were damaged (core assassins never eject, but OXP ones sometimes do).
13:29:20.745 [oxp-standards.deprecated]: Script ../AddOns/Testing.oxp/N-Shields.oxp/Scripts/N-Shields.js does not "use strict";
...
13:29:35.349 [mesh.error]: ***** Failed to find TEXTURES data (will use placeholder material)
..... from NShields-flare-marker.dat (from file)
13:29:20.745 [oxp-standards.deprecated]: Script ../AddOns/Testing.oxp/N-Shields.oxp/Scripts/N-Shields.js does not "use strict";
...
13:29:35.349 [mesh.error]: ***** Failed to find TEXTURES data (will use placeholder material)
..... from NShields-flare-marker.dat (from file)
That's OK, I just couldn't be bothered to texture a tiny 1-poly marker nobody will ever actually see. Might get around to it one day if your log file desperately needs de-cluttering.
As for the star effects being too big, I'm actually inclined to agree and will tweak things a bit once the hemisphere glow effects work properly; for now you can unzip the OXZ and find the off-switch in the top of N-Shields.js if you like.
Anonymissimus, NPC Equipment Damage does happen to be in my WIP folder, although it's not exactly simple and has yet to reach the testing stage. Watch this space.
Anonymissimus, NPC Equipment Damage does happen to be in my WIP folder, although it's not exactly simple and has yet to reach the testing stage. Watch this space.
Aha, so it is really so that the equipment of NPC ships cannot be damaged by default as of now ?
Fuel injectors are obviously the most interesting piece, but others such as shield boosters also count ofc.
Sorry for offtopic (somewhat), I should have created a dedicated thread for asking this.
Thanks for pointing that out, phkb (although it seemed to work anyway). My problem is I think in Python too much.
Anyway, version 0.6.1 is now out with a Ship Configuration version check that actually works (sorry about the 0.5.3 attempt), some config options for users of Oolite-trunk and Library OXP, re-sized star explosions (maybe too small now?) and hemisphere glow effects working properly (although they are still disabled by default because they still look awful). Oh, and compatibility with NPC Equipment Damage OXP.
12:40:05.844 [plist.parse.failed]: Failed to parse ../AddOns/Testing.oxp/N-Shields.oxz/manifest.plist as a property list.
Parse failed at line 20 (char 700) - unexpected character (wanted '=')
Looks like there's a missing "};" at the end of the optional oxps.
Already found & fixed, but thanks for your vigilance. The fixed version is now available.
[Edit:]
Also, a question for any developers who happen to be around: Is the correct default value for shield_charge_energybank_threshold in global-settings.plist 0.0 (as that file says) or 0.25 (as the source code seems to say)? 0.0 is the value I've been using, in the absence of any ability to read the actual one directly.
Also, a question for any developers who happen to be around: Is the correct default value for shield_charge_energybank_threshold in global-settings.plist 0.0 (as that file says) or 0.25 (as the source code seems to say)? 0.0 is the value I've been using, in the absence of any ability to read the actual one directly.
It looks like it is set to 0.25. The value in the plist is commented out and is considered non-existent.
16:38:57.864 [NPC_Equipment_Damage]: damaging EQ_NSHIELDS_NPC_SHIELD_BOOSTER on Wolf Mark I: Cursed Trumble V
16:38:58.052 [script.javaScript.exception.notDefined]: ***** JavaScript exception (griff_spawn_wreckage 1.1): ReferenceError: labels is not defined
16:38:58.052 [script.javaScript.exception.notDefined]: ../AddOns/Testing.oxp/N-Shields.oxp/Scripts/N-Shields.js, line 911.
BTW, there's a bug in ShipConfig, in the code that damages energy equipment. I've got a "ship" reference rather than a "this.ship" on one of the lines.
if (equipment == "EQ_NSHIELDS_NPC_NAVAL_SHIELD_BOOSTER") //reverse the equipment upgrade changes
{
let eq = EquipmentInfo.infoForKey("EQ_NAVAL_SHIELD_BOOSTER");
let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
for (i in labels.maxShields)
{
ship[labels.maxShields[i]] -= shield_boost;
if (recharge_boost) ship[labels.rechargeRates[i]] /= recharge_boost;
}
}
if (equipment == "EQ_NSHIELDS_NPC_SHIELD_BOOSTER") //reverse the equipment upgrade changes
{
let eq = EquipmentInfo.infoForKey("EQ_SHIELD_BOOSTER");
let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
for (i in labels.maxShields)
{
ship[labels.maxShields[i]] -= shield_boost;
if (recharge_boost) ship[labels.rechargeRates[i]] /= recharge_boost;
}
}
if (equipment == "EQ_NSHIELDS_NPC_NAVAL_SHIELD_BOOSTER") //reverse the equipment upgrade changes
{
let eq = EquipmentInfo.infoForKey("EQ_NAVAL_SHIELD_BOOSTER");
let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
for (i in this.ship.script.NShields_labels.maxShields)
{
this.ship[this.ship.script.NShields_labels.maxShields[i]] -= shield_boost;
if (recharge_boost) this.ship[this.ship.script.NShields_labels.rechargeRates[i]] /= recharge_boost;
}
}
if (equipment == "EQ_NSHIELDS_NPC_SHIELD_BOOSTER") //reverse the equipment upgrade changes
{
let eq = EquipmentInfo.infoForKey("EQ_SHIELD_BOOSTER");
let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
for (i in this.ship.script.NShields_labels.maxShields)
{
this.ship[this.ship.script.NShields_labels.maxShields[i]] -= shield_boost;
if (recharge_boost) this.ship[this.ship.script.NShields_labels.rechargeRates[i]] /= recharge_boost;
}
}
Thanks phkb, I think I already found & fixed the shield damage bug (and found the shipconfig energy bug) for myself & will emergency-release N-Shields 0.6.3 today if time permits.
[Edit]
Done. The link above should now be the new version.
[/Edit]