IronHide OXP

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

Moderators: another_commander, winston

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

IronHide OXP

Post by Thargoid »

The Ships Systems Department of the Aquarian Shipbuilding Corporation introduce their latest development - IronHide armour. This is a simple but effective technology which applies a special treatment to the hull of the customer ship which helps to strengthen it against combat and physical damage in collaboration with the ships shielding.

In practice the armour helps to absorb damage that would affect the shields, although if a truly concentrated attack occurs then localised penetration and energy damage may still occur. This is especially true of missile attacks, which can still cause internal damage and equipment failure due to concussion effects. The current strength of the armour can be viewed on the ships manifest (F5-F5) screen, and any damage can be repaired at a suitably high-tech station.

The armour itself is available from all good tech 5 locations, for a recommended retail price of just 750 credits for each section (forward and aft sections are installed separately due to ships mass and shielding interaction requirements). These stations should also be able to quote for repairs to damaged shields. It should also be noted that insurers class armour as a combat consumable, and so its replacement is not included as part of the insurance for equipment such as escape pods and lifeboats.

A special enhanced upgrade for military uses has also been developed, and may be available to customers at tech 10 systems (the upgrade requires an undamaged civilian-grade installation). The upgrade doubles the effectiveness of the regular armour.

- - = = Download IronHide OXP Here = = - -

With thanks to ClymAngus for the original discussion and inspiration, and to Caracal and UK_Eliter for beta-testing.

And to save comments, yes ideally shields should go before armour, but code-wise that isn't possible to do without the armour supporting things like ECM and cloaking as well, which would just be odd ;)
Last edited by Thargoid on Thu Jul 21, 2011 7:31 pm, edited 7 times in total.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

Yay, more iron on me ass. :) Just what my mechanic ordered.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

All very nice, but does it repel trumbles? :twisted:
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

Smivs wrote:All very nice, but does it repel trumbles? :twisted:
I don't think that's likely, but it does a good job of repelling lasers.

So the old rule still applies: When Lord Murphy tosses trumbles your way, break out the grill and make trumbleburgers.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

Cmdr Wyvern wrote:
Smivs wrote:All very nice, but does it repel trumbles? :twisted:
I don't think that's likely, but it does a good job of repelling lasers.
Only kidding :) Looking forward to trying it at the next TL1 Anarchy I visit.
Will we come across any armored NPCs, by the way?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

NPCs don't have shields, so it's a bit difficult to armour them ;)

At the moment this is a player-only OXP, as for NPCs it would just involve giving them an energy boost, and would be non-locational (they have no forward/rear in this sense).

And it would also mean associating a script with the NPC ship, which could cause complications.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Just found a minor glitch in the script, where a variable was set up as a script variable that needed to be a mission variable (to be available across save games).

So OXP is updated to v1.01 to correct this. It should self-correct your save game without any modification needed other than the OXP update.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2212
Joined: Mon May 31, 2010 11:11 pm

Post by Switeck »

Will this make missile hits more survivable?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Not of themselves as they do so much damage that they tend to penetrate the armour and/or damage things by concussion (see the readme ;) ). But if the missile itself doesn't kill you, then you will be in a better position to survive subsequent attack whilst your energy recharges.

And code-wise it's not possible to differentiate energy loss from damage from that due to ECM usage or cloaking device operation (and other things), hence I didn't even try to counter missile strikes. The equipment is more proof against laser fire.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Post by Lone_Wolf »

I tried the ironhide hoping it would give better protection against missile hits, but found the ironhide gets damaged before the shields are depleted.

The oxp description states ironhide is intended as a hull stengthening technique, so i looked at the script.

I believe the reason for the wrong behaviour is in the damage applying parts of the script

Code: Select all

if(player.ship.forwardShield < player.ship.maxForwardShield)
		{ // if we have forward shield damage
		this.damage = player.ship.maxForwardShield - player.ship.forwardShield;
		this.shield = missionVariables.ironHide_ForwardStrength * (missionVariables.ironHide_forwardPercentage / 100);
		if(this.damage < this.shield)
			{
			player.ship.forwardShield = player.ship.maxForwardShield;
			missionVariables.ironHide_forwardPercentage -= Math.floor(100 * (this.damage / missionVariables.ironHide_ForwardStrength));
			}
		else	
			{
			player.ship.forwardShield += this.shield;
			missionVariables.ironHide_forwardPercentage = 0;
			}
		}
Below is code that i think will have the effect that ironhide will only be damaged AFTER the normal shield has been depleted.

Code: Select all

if(player.ship.forwardShield < player.ship.maxForwardShield)
		{ // if we have forward shield damage
		this.shield = missionVariables.ironHide_ForwardStrength * (missionVariables.ironHide_forwardPercentage / 100);
		if(player.ship.forwardShield < this.shield)
			{
			missionVariables.ironHide_forwardPercentage -= Math.floor(100 * (player.ship.forwardShield / missionVariables.ironHide_ForwardStrength));
			}
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

The problem is that after shield strength is zero, damage comes straight from energy banks. But unfortunately so do other things such as ECM and cloaking device.

Hence if you are in combat, have your shields reduced to zero and then either cloak or hit ECM, the drain from those will come out of the Iron Hide. This is of course nonsensical, even more so than the current situation.

Basically having the IH drain before the shields do is currently the lesser of the two evil ways of doing it. I have put in a request for a new event to trigger when the ship takes damage, but as yet it has not been implemented (and there is no information that it will be).

If I read your code correctly, all that will now happen is that both the shields and Iron Hide will deplete at the same time, making IH effectively do nothing at all.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Post by Lone_Wolf »

Thargoid wrote:
Hence if you are in combat, have your shields reduced to zero and then either cloak or hit ECM, the drain from those will come out of the Iron Hide. nothing at all.
I have to agree with that, but feel it might not be applicable.

If i've read the ironhide code correctly, what it does is increase the shield strength with 200/400 (civilian , military).

suppose shield strength without ironhide is 1600 , and a player has the military ironhide, raising shield strength to 2000.

an example of how things do work imo :
Shield 2000
lasers and missiles hit for 1700 damge to shield = 300 left
this is below ironhide level, so ironhide gets damaged for 100 points.
total ironhide strength is now 300
Max shield strength is now 1900

shields are recharged to 1200, then damage for 1100 = 100 left
ironhide was 300 points, is now reduced by 200 points to 100.
max shield strength : 1700

shields are recharged to 900, damage for 1100
shield left : -200 , ironhide is gone completely now
the remaining 200 will be taken from energy banks.

In short : the shields are only reduced to zero AFTER ironhide is gone.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

You can't raise shieldStrength above maxShieldStrength, (or increase maxShieldStrength at all) from script. The former is clamped and the latter read-only.

What IronHide does is check if shieldStrength is below maxShieldStrength, and if it is it increases shieldStrength up to maxShieldStrength, and deducts the same amount from itself (think of it like a shield boost reservoir). When the IronHide reaches zero, it is destroyed and no more compensation occurs - shields and then energy drain as normal when further hits are taken.

Hence why IH goes before shields do. As mentioned before if the request for a function triggered by ship taking damage (with the level of damage being returned as a parameter) then it can be done properly as we can tell when energy is drained from damage rather than anything else.

As I said before, once shields are gone then further hits drain energy. But so do other things, and as the two cannot currently be told apart the IH would end up being drained by ECM and cloak (and other OXP things possibly) if they are used at times when the shields are at zero.

But by all means please try the code in your local copy, and if you can figure out a way to do it without the requested function that can differentiate energy drains from combat from those by other equipment then I'll gladly merge it into IH and give you co-author credit.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Post by Lone_Wolf »

Thanks for the explanation, it makes things a lot clearer.

I'm interested in the damage model oolite uses, and will search further.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Post by Lone_Wolf »

Thargoid wrote:
As mentioned before if the request for a function triggered by ship taking damage (with the level of damage being returned as a parameter) then it can be done properly as we can tell when energy is drained from damage rather than anything else.
After a search in forum and sourcecode i think the function you requested is already present, just not accessible for scripts .

In src/Core/Entities/PlayerEntity.m

the functions takeEnergyDamage and takeScrapeDamage are defined and appear to give the data needed.

They should be accessible through the log , if player.ship.damage logging is enabled.

Note :
Co-authorship is not needed, if ironhide can become a hull strengthening equipment (or function like it) that's enough reward.
(with my playing style i could really use that )
Post Reply