KicheEmergencyShields

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

Moderators: another_commander, winston

Post Reply
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

KicheEmergencyShields

Post 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.
Last edited by Lone_Wolf on Sun Nov 16, 2025 8:15 pm, edited 2 times in total.
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5666
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Emergency Shields

Post 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.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Emergency Shields

Post 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.
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Emergency Shields

Post 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");
						};
		 };
}
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1602
Joined: Thu Aug 27, 2015 4:24 pm

Re: Emergency Shields

Post 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 :)
User avatar
Cholmondely
Archivist
Archivist
Posts: 6597
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Emergency Shields

Post by Cholmondely »

Will the NPC's get it too?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: KicheEmergencyShields

Post 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.
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1602
Joined: Thu Aug 27, 2015 4:24 pm

Re: KicheEmergencyShields

Post 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...
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: KicheEmergencyShields

Post 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
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: KicheEmergencyShields

Post 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.
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: KicheEmergencyShields

Post 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 .
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1602
Joined: Thu Aug 27, 2015 4:24 pm

Re: KicheEmergencyShields

Post by cbr »

Quick test with cobby...

Challenged some galcops, satisfying to see the shield(s) being 'bumped' up again, bought me a few seconds :)
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: KicheEmergencyShields

Post 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.
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
Cholmondely
Archivist
Archivist
Posts: 6597
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: KicheEmergencyShields

Post 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?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 815
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: KicheEmergencyShields

Post 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 .
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
Post Reply