Page 1 of 1

KicheEmergencyShields

Posted: Sat Nov 15, 2025 12:27 am
by Lone_Wolf
Latest version of the code for this oxp is at https://git.sr.ht/~lone_wolf/KicheEmergencyShields/tree


I don't really like Ironhide and the capacitors from Shield Equalizer & Capicators but do need something to reduce damage.

An equipment item that increases shield strength one time would suit me better.

Here's an untested rudimentary setup that I think may work .

equipment.plist

Code: Select all

(
	(
		0,
		10,
		"Emergency Forward Shield",
		"EQ_EFS",
		"Onetime fwd shield boost",
		{
			"available_to_all" = yes;
			"portable_between_ships" = no;
		}
	),
	(
		0,
		10,
		"Emergency Aft Shield",
		"EQ_EAS",
		"Onetime aft shield boost",
		{
			"available_to_all" = yes;
			"portable_between_ships" = no;
		}
	),
)
emergencyshields.js

Code: Select all

"use strict";
this.name        = "emergencyshield";

this.shipTakingDamage = function(amount, whom, type)
{
     if ( player.ship.equipmentStatus("EQ_EFS") === "EQUIPMENT_OK" )
		 {
				 if ( player.ship.fwdShield < player.ship.maxForwardShield/4 )
						{ 
						 player.ship.fwdShield+=64;
						 player.ship.removeEquipment("EQ_EFS");
						};
		 };
     if ( player.ship.equipmentStatus("EQ_EAS") === "EQUIPMENT_OK" )
		 {
				 if ( player.ship.aftShield < player.ship.maxAfShield/4 )
						{ 
						 player.ship.aftShield+=64;
						 ship.removeEquipment("EQ_EAS");
						};
		 };
}
Please comment on it.

Re: Emergency Shields

Posted: Sat Nov 15, 2025 12:53 am
by phkb
An interesting idea!

A correction:

Code: Select all

player.ship.fwdShield+=64;
should be

Code: Select all

player.ship.forwardShield+=64;
And a suggestion. In the (admittedly rare) case where a player ship has a maxForwardShield of 64, perhaps the following alteration might make it cope with all scenarios better:

Code: Select all

player.ship.forwardShield+=(player.ship.maxForwardShield / 2);
The logic being, you'd only apply the boost when the shield is at a quarter strength, so there should be no issue adding half of it back.

Re: Emergency Shields

Posted: Sat Nov 15, 2025 2:11 pm
by Lone_Wolf
Correction made and I like the idea of adding half max strength, also implemented.

I'll also look at adding sound effect to alert pilots to their use.

About price / availability :

I see this as something that will make fleeing from a tough fight/crash easier.
While it will benefit all pilots, the benefit for starting pilots is the biggest imo.

ECM is available at TL 3 and costs 600 cr.

TL 3 seems reasonable to make replacing the device easy .

Cost is trickier.
a price of 100 per device looks okish as you need to purchase this multiple times.
That would mean you can't get them at the default start in lave though.

Maybe rewarding them by default for new pilots is better, using startUpComplete with a check for lave would achieve that.

Re: Emergency Shields

Posted: Sat Nov 15, 2025 5:41 pm
by Lone_Wolf
Getting sounds to work is somewhat tricky and I haven't found one that is different enough from the regular combat sounds.
Maybe some kind of sirene or trumblesqueal.ogg .

The increase in shield strength does work and the jump in shield strength is clearly visible if you watch shields.

Code: Select all

"use strict";
this.name        = "emergencyshield";

this.shipTakingDamage = function(amount, whom, type)
{
		if ( player.ship.equipmentStatus("EQ_EFS") === "EQUIPMENT_OK" )
		 {
				 if ( player.ship.forwardShield < player.ship.maxForwardShield/4 )
						{ 
								player.ship.forwardShield+=(player.ship.maxForwardShield / 2);
								player.ship.removeEquipment("EQ_EFS");
								
						};
		 };
     if ( player.ship.equipmentStatus("EQ_EAS") === "EQUIPMENT_OK" )
		 {
				 if ( player.ship.aftShield < player.ship.maxAftShield/4 )
						{ 
								player.ship.aftShield+=(player.ship.maxAftShield / 2);
								player.ship.removeEquipment("EQ_EAS");
						};
		 };
}

Re: Emergency Shields

Posted: Sat Nov 15, 2025 10:50 pm
by cbr
add in stacking, level 1 - 8
non linear pricing level 1 100% cost level 2 200% level 3 300% cost etc

would like to add level 8, front and back on boas and b cruisers :)

Re: Emergency Shields

Posted: Sat Nov 15, 2025 10:53 pm
by Cholmondely
Will the NPC's get it too?

Re: KicheEmergencyShields

Posted: Sun Nov 16, 2025 11:34 am
by Lone_Wolf
As you may have noticed I've changed the topic title .
Kiche is the mother of White Fang and in the Jack London novel both appear in she attacks a lynx to protect her pups.
This matches well with protecting a ship.

I have decided I don't want to give this to all player ships by default, that decision should be made by individual pilots.

Sounds are out for now, as I failed to find a suitable one under a usable license. Even playing the (annoying) trumblesqueal twice doesn't stand out above bgs combat sounds .
Cholmondely wrote: Sat Nov 15, 2025 10:53 pm
Will the NPC's get it too?
I see no reason why they shouldn't have it and it could help weak trader ships like sidewinders.

<EDIT>
npc ships lack the aft / forward shield properties, so giving it to them will require depending on an oxp that provides shields to npcs.
Will look into using N-Shields .
<END-of-EDIT
cbr wrote: Sat Nov 15, 2025 10:50 pm
add in stacking, level 1 - 8
non linear pricing level 1 100% cost level 2 200% level 3 300% cost etc

would like to add level 8, front and back on boas and b cruisers :)
I have been thinking to add a counter to allow having more then one emergency shield .
Not sure about the pricing , do you mean quadratic or cumulative pricing ?
quadratic would mean L4 costs 16* L1 / L8 64*L1
Cumulative L4 would cost 10*L1 , L8 would be 36*L1

I didn't add a cargo space requirement as I want the L1 version to be easy to use, but multiple shields should have a cargo requirement.
Since having both aft & fwd L8 doubles the space needed, quadratic space would result in needing 128 TC.
Cumulative would still be 72 TC.
Both number feel to high.

How about increasing space by 50% for each additional level ?
L2 would require 2.25 , rounded down to 2 so 4 for both.
L4 would require 5 spaces
L8 would require 26 spaces, so 52 for both .

That means aft/fwd L8 would use 41.6 % of the cargo space of a boa. Still feels rather high.

Adding 40% seems a better idea.
L8 would then require 15 TC, so 30 for both = 24% of boa cargo space.
That seems a more reasonable number.

Re: KicheEmergencyShields

Posted: Sun Nov 16, 2025 6:06 pm
by cbr
ah, made an error, meant l1 100% l2 200% l3 400% l4 800% etc

the 'cargo requirements' sounds like a good idea

:)

look for K.E.S. shields in the near future...

Re: KicheEmergencyShields

Posted: Sun Nov 16, 2025 8:25 pm
by Lone_Wolf
I've uploaded the code for this oxp to my brandnew repo with sourcehut : https://git.sr.ht/~lone_wolf/KicheEmergencyShields/

Keep in mind this is a Work in Progress.
If someone wants to test the code :

- cd into the folder that holds your addons (~/.Oolite/AddOns on linux)
- execute git clone https://git.sr.ht/~lone_wolf/KicheEmergencyShields/
- rename the new folder so it becomes KicheEmergencyShields.oxp to ensure oolite will recognize it.

To update to the latest version :
cd into KicheEmergencyShields.oxp folder and execute git pull

Re: KicheEmergencyShields

Posted: Mon Nov 17, 2025 11:16 am
by Lone_Wolf
The price of equipment items can be determined at buy time using updateEquipmentPrice in a condition script/ , cargo space requirement is static .

I'll add an equipment "additional emergency shields" with cargospace requirement of 2 that can be bought max 7 times after buying the first emergency shield.
So having 8 forward emergency shields will take up 14 TC .

The amount of emergency shields left will be shown on F5 screen separately from equipment parts like repairbots & shield cycler do.

Re: KicheEmergencyShields

Posted: Sat Nov 22, 2025 11:05 pm
by Lone_Wolf
cbr wrote: Sun Nov 16, 2025 6:06 pm
look for K.E.S. shields in the near future...
Additional emergency shields added, please test .

Re: KicheEmergencyShields

Posted: Sun Nov 23, 2025 12:05 am
by cbr
Quick test with cobby...

Challenged some galcops, satisfying to see the shield(s) being 'bumped' up again, bought me a few seconds :)

Re: KicheEmergencyShields

Posted: Sun Nov 23, 2025 10:42 am
by Lone_Wolf
If you're going up against vipers to test (I also do that) make sure the cobby is an iron ass.
(Or atleast shield boosters & mil. shields )

I expect you'll notice a bigger difference then.

Re: KicheEmergencyShields

Posted: Tue Nov 25, 2025 5:28 pm
by Cholmondely
I've added this thread to your wiki user:page

Should I cobble together a wiki page for your new OXP? You can then hack it to death.

And are there any others missing from your user:page? eg.: Lave Custom Start?

Re: KicheEmergencyShields

Posted: Wed Nov 26, 2025 9:28 pm
by Lone_Wolf
Cholmondely wrote:
I've added this thread to your wiki user:page

Should I cobble together a wiki page for your new OXP? You can then hack it to death.
Thanks for adding it. Yes, a wiki page for KES would be great.

Its code is now stable for the player, going to write a readme next.
The 2nd item on the list is making the equipment usable by NPCs.
Cholmondely wrote:
And are there any others missing from your user:page? eg.: Lave Custom Start?
WhiteFangHUD is not ready for publishing yet.
LaveCustomStart requires tweaking to be really useful. Maybe it would fit better as an example how you can customize things ingame using js then as a separate oxp .