21/06/2020 - Version 3.03, updated by Milo; added indication on F5F5 screen showing whether current IronHide armour is civilian or military grade.
IronHide OXP
Moderators: winston, another_commander
Re: IronHide OXP
Good idea.
Re: IronHide OXP
Upgraded to 3.02, loaded a savefile from previous version, with the missionVariables:
IronHide is gone, nothing in F5F5, Ship Outfitting offers it for 1914.5 (docked in a Seedy Space Bar).
Bought it, after that looked for the Military Upgrade and it wasn't offered (ship has 320t, Seed Space Bar is TL10).
Savefile after the transation:
Code: Select all
<key>mission_ironHide_cost</key>
<string>00</string>
<key>mission_ironHide_milFlag</key>
<string>100</string>
<key>mission_ironHide_percentage</key>
<string>100</string>
<key>mission_ironHide_strength</key>
<string>400</string>
Bought it, after that looked for the Military Upgrade and it wasn't offered (ship has 320t, Seed Space Bar is TL10).
Savefile after the transation:
Code: Select all
<key>mission_ironHide_cost</key>
<string>00</string>
<key>mission_ironHide_milFlag</key>
<string>100</string>
<key>mission_ironHide_percentage</key>
<string>100</string>
<key>mission_ironHide_strength</key>
<string>400</string>
Re: IronHide OXP
That's very strange, milFlag should be either zero or one, not 100, and I don't see anything that could set it to 100. The military upgrade not being offered in that case is not surprising because it requires milFlag to be zero. Did that save not have EQ_IRONHIDE in the list of equipment under <key>extra_equipment</key><dict>?
Re: IronHide OXP
Forgot to look at that... the original save file didn't, the savefile after buying IH has it.Milo wrote: ↑Mon Jun 22, 2020 1:41 amThat's very strange, milFlag should be either zero or one, not 100, and I don't see anything that could set it to 100. The military upgrade not being offered in that case is not surprising because it requires milFlag to be zero. Did that save not have EQ_IRONHIDE in the list of equipment under <key>extra_equipment</key><dict>?
The original savefile player ship was restored from HyperSpaceHangar using Ship Storage Helper... my version of SSH is instrumented (I'm working on it), so I have verbose logs from when it restored that ship.
EQ_IRONHIDE was in the equipment list for the stored ship, but all tries to award it failed - and Ship Storage Helper tries several times, to deal with dependencies, then starts setting system tl/governement/economy levels all over the place before giving up.
Re: IronHide OXP
Ah, I will have to allow scripted awardEquipment for that.
Let me know if this works, I made the assumption that SSH first assigns the new ship as the player ship and then restores the equipment.21/06/2020 - Version 3.04, updated by Milo; improved handling of invalid ironHide_milFlag missionVariable (not zero or one) from old saved game; modified allowAwardEquipment handler to allow other OXPs to add IronHide to player ships (e.g., Ship Storage Helper).
Re: IronHide OXP
It does a replaceShip(), removes all "inherited" equips from the new ship, then tries to award what was in the stored ship, then re-instates the state (missionVariables) for several OXPs... but with EscortDeck, it's restoring NPCs too - that's what I'm working on, with EscortDeck and HyperSpaceHangar a ship can be a player ship, then be turned into a NPC (an escort), and vice-versa, and I want to preserve equipment/OXP state as much as possible as it moves from player->NPC->player.Milo wrote: ↑Mon Jun 22, 2020 1:57 amAh, I will have to allow scripted awardEquipment for that.Let me know if this works, I made the assumption that SSH first assigns the new ship as the player ship and then restores the equipment.21/06/2020 - Version 3.04, updated by Milo; improved handling of invalid ironHide_milFlag missionVariable (not zero or one) from old saved game; modified allowAwardEquipment handler to allow other OXPs to add IronHide to player ships (e.g., Ship Storage Helper).
Re: IronHide OXP
I realized another problem could happen if the replaced ship is assigned a different milFlag value than the ship you had at startUp. I was only loading the damage-to-armour multiplier at startUp, so the damage taken would not be correct for the armour grade in that case.
Thinking about it, there's no particular reason that I need the EQ_IRONHIDE equipment after the initial purchase, other than for other OXPs that look for it. I derive everything from the ironHide_percentage and ironHide_milFlag. Less edge cases with inconsistent variables/equipment states if other OXPs are modifying them. As of now, if mission_ironHide_percentage > 0, the player ship will be protected as if it has armour (and the percentage will drop with damage taken until zero, at which point it will display armour destroyed in the console), even if it does not have EQ_IRONHIDE equipment.
For the player->npc->player scenario with SSH, I am still blocking awardEquipment("EQ_IRONHIDE") on non-player ships. I expect you will keep the original player equipment list during the npc transition even if some equipment can't be awarded while it is an npc ship and restore it when it becomes a player ship again?21/06/2020 - Version 3.05, updated by Milo; re-assess damage-to-armour multiplier each time the ship launches, in case another OXP replaced the player ship, awarded IronHide, or changed the grade of the armour.
Thinking about it, there's no particular reason that I need the EQ_IRONHIDE equipment after the initial purchase, other than for other OXPs that look for it. I derive everything from the ironHide_percentage and ironHide_milFlag. Less edge cases with inconsistent variables/equipment states if other OXPs are modifying them. As of now, if mission_ironHide_percentage > 0, the player ship will be protected as if it has armour (and the percentage will drop with damage taken until zero, at which point it will display armour destroyed in the console), even if it does not have EQ_IRONHIDE equipment.
Re: IronHide OXP
Why do that?Milo wrote: ↑Mon Jun 22, 2020 2:48 amFor the player->npc->player scenario with SSH, I am still blocking awardEquipment("EQ_IRONHIDE") on non-player ships. I expect you will keep the original player equipment list during the npc transition even if some equipment can't be awarded while it is an npc ship and restore it when it becomes a player ship again?
Your event handlers are worldScripts, they are not being called for events in the NPCs, just the player ship - unless you have a shipSpawned event handler that "hooks" everything else into the spawned ship's script (I have done that in my version of HardWay to make the NPCs get the same mechanics for fuel consumption/fuel scooping as the player ship).
You can allow scripted equipment awards of IronHide to NPCs, they will not get anything from it until you create shipScript event handlers for them - and if you ever do it for IronHide (I planned to give it a go after I get shield-related equips "bomb-proofed"), you should look into N-Shields: it makes a list of shipTakingDamage event handlers in the ship's script and goes through it when the ship is hit. And allowing it would make Ship Storage Helper life much eaiser
Shield Cycler does something like that, it removes the "user-versioned" EQs (Basic, Standard, Advanced), puts in a EQ_SC_SHIELD_CYCLER_INTERNAL and controls everything from the worldScript vars. It would be much simpler if it got rid of the EQ_..._INTERNAL, right now you have to check for that AND two booleans AND the equip. version (which could be None) in the worldScript vars to see if it's enabled.Milo wrote: ↑Mon Jun 22, 2020 2:48 amThinking about it, there's no particular reason that I need the EQ_IRONHIDE equipment after the initial purchase, other than for other OXPs that look for it. I could derive everything from the ironHide_percentage and ironHide_milFlag. Less edge cases with inconsistent variables/equipment states if other OXPs are modifying them.
Last edited by dybal on Mon Jun 22, 2020 12:41 pm, edited 1 time in total.
Re: IronHide OXP
21/06/2020 - Version 3.06, updated by Milo; if armour percentage is above zero but EQ_IRONHIDE is missing at startUp or at launch, set percentage to zero (in case another OXP removed IronHide without changing percentage); allow other OXPs to awardEquipment("EQ_IRONHIDE") to NPC ships (e.g., Ship Storage Helper using it as a placeholder for player->npc->player transitions), but IronHide does nothing for NPC ships, so outside of scripted additions, do not allow NPC ships to spawn with IronHide armour, and do not allow awardEquipment("EQ_IRONHIDE_MIL" or "EQ_IRONHIDE_REPAIRS") on NPCs because those are used only as script triggers from the F3 purchase screen.
Re: IronHide OXP
Since I discovered HyperSpaceHangar and EscortDeck I started to collect non-player ships that I recovered as usable derelicts.... in that collection I have now a GalCop Viper (the code for NPC vs NPC must be different than NPC vs player, because all GalCop Vipers I turned into derelicts exploded - self-destruct? - around half a minute latter), a Navy Viper, an Armoured Transport Viper, a GalTech Escort Fighter, a Manta Ray. The Vipers I found as derelicts, the others I fought and turned into derelicts.Milo wrote: ↑Sun Jun 21, 2020 8:15 pm21/06/2020 - Version 3.02, updated by Milo; doubled price variance for larger ships and applied proportional adjustment to repair costs (they were still using the baseline price); improved compatibility with ShipVersion OXP by not offering IronHide for purchase on ships that ShipVersion does not allow to use it (when ShipVersion OXP is detected, civilian IronHide is only for ships with mass 30t or higher and military IronHide is only for ships with mass 130t or higher).
Having them in my HyperSpaceHangar available as escorts made it easy to see their core-game-calculated mass (calculated based on the volume of their models, I think).
The Vipers are clearly military vessels, the others might be used in military/police applications. The GalCop Viper masses 34t, the Navy Viper 47.3t, the Armoured Transport Viper 27.6t, the GalTech Escort Fighter 13.2t and the Manta Ray 4.7t (with 6t cargo space, go figure... ).
I don't think the rules embedded in ShipVersion are consistent with the in-universe story: there is a war going on, pushing ship/weapons/shields/armour development, the military ships would have some grade of armour if at all possible, but by the rules in ShipVersion, the only one of those military vessels that could have IronHide is the Navy Viper, and not the military version, just the civilian one.
Obviously I don't think the armour in a 10t ship would be able to absorb as much damage as the armour in a 100t ship, but they all should have something... and the military version should be able to absorb more damage per armour mass than the civilian version.
If the ship's surface area could be obtained we could give armour an arbitrary density (could be different in civilian and military versions), limit the total armour mass to a % of the ship's mass, get the maximum armour thickness (for an uniform armour "coating"), make the amount of damage it can absorb proportional to its thickness, with different constants for civilian and military versions (military more efficient for the same thickness) and offer armour for all ships - though for the small ones the amount of protection the civilian version would offer might not be worth it, but the military version might.
It shouldn't create a performance problem... those calculations would have to be done at installation time to get the maximum amount of damage that can be absorbed by that ship armour, then the shipTakingDamage event handler only have to accumulate the absorbed damage and check against the stored maximum.
Even if the ship's surface can't be obtained, the maximum amount of damage absorbed could be proportional to the ship's mass (perhaps with a non-linear function, so if you halve the mass you get less than half the maximum damage absorbed), with the military version absorbing more damage for the same mass.
Re: IronHide OXP
Priority AI for police (spawned as defense ships or otherwise) sets a flag oolite_flag_selfDestructAbandonedShip which causes the Priority AI to schedule a 10 second timer from shipLaunchedEscapePod to call explode() on the ship.the code for NPC vs NPC must be different than NPC vs player, because all GalCop Vipers I turned into derelicts exploded
I'm not sure how any of them survived to be salvaged. Maybe you have police ships that aren't using priority AI?
Re: IronHide OXP
The GalCop Viper datakey was viper-pursuit... that uses the police AI.Milo wrote: ↑Wed Jul 15, 2020 8:03 pmPriority AI for police (spawned as defense ships or otherwise) sets a flag oolite_flag_selfDestructAbandonedShip which causes the Priority AI to schedule a 10 second timer from shipLaunchedEscapePod to call explode() on the ship.the code for NPC vs NPC must be different than NPC vs player, because all GalCop Vipers I turned into derelicts exploded
I'm not sure how any of them survived to be salvaged. Maybe you have police ships that aren't using priority AI?
The Navy Viper datakey is behemoth-viper-fighter, that uses behemothFighterInterceptAI.plist from Behemoth OXP
The Armoured Transport Viper datakey is escortviper, that uses att1AI.plist, from ATT OXP
Re: IronHide OXP
Did you "capture" the viper-pursuit in the ten seconds before it exploded, or did something go wrong with the timer? I'm not familiar with the workings of EscortDeck.
Re: IronHide OXP
I didn't fight it till the pilot abandoned ship, I found it already as a derelict in one of the Devil's Triangle Anarchy systems (Raleen, G1) same as the Navy Viper.
Since that conf option should cause them to self-destruct even in a NPC vs NPC fight, it must have been spawned as a derelict.
Towbar has code to spawn derelicts for testing, but it spawns with role "pirate" near the main station, that one clearly was not a pirate (ship.displayName was GalCop Viper: RJO391-RA1) and I found it near the witchpoint (one of the "interesting" places to look for derelicts in busy Anarchies).
EscortDeck has code to spawn derelicts too, but I don't think any of the roles used could spawn a ship with that datakey and display name.
EDIT:
It should be possible to capture a GalCop Viper as derelict with EscortDeck if you get close to it (<1.5km) and slow down to less than 100m/s speed difference before it self-destructs - EscortDeck changes the AI before putting the derelict on deck, and that might stop the self-destruct.
Since I'm a fugitive right now (yesterday a GalCop Sheriff, leader of a ~20 strong patrol, out of the blue commed me that I would pay for my crimes and opened fire, followed by all his charges... I was clean, weapons off - more speed with power-to-engines - trying to get close enough to the fugitive they were shooting at to help them... stayed clean until I decided to fight back after they pursued when I fled) I will give it a try - I don't have a Viper Interceptor in the collection yet
EDIT: The Viper exploded in the deck... perhaps if it's an usable derelict, since EscortDeck spawns a new ship and copies the properties of the old one in that case.
Last edited by dybal on Thu Jul 16, 2020 1:19 am, edited 1 time in total.
Re: IronHide OXP
Are you sure you didn't have an out-of-system bounty applied by Bounty System OXP just before they attacked you?
And are you sure it was police that sent that specific message?
The "You'll pay for your crimes" message from Comms Pack A seems to be used only by ships that define themselves with the "hunter" comms role:
setCommunicationsRole("hunter");
That's used only in the bounty hunter AI and bounty hunter leader AI in the core scripts, and none of the OXPs I use sets it... maybe yours do?
The beginningFight message type is sent from behaviourCommenceAttackOnCurrentTarget which for police is used when they see ships whose bounty exceeds their serious offender threshold or are fugitives (offenders are attacked if their bounty is greater than 50 - 6 * system government level).
For bounty hunters, it's the same as police except the threshold is halved (so if police would attack an offender with 20 bounty, bounty hunters will attack an offender with 10 bounty).
None of this explains the scenario of being attacked with no bounty.
And are you sure it was police that sent that specific message?
Code: Select all
"commsPackA_vigilante_beginningFight" = ("Your crimes end here!","Death to pirates!","It's the [oolite_entityName]. Open fire!","You'll pay for your crimes, [oolite_entityCrew]!","It's time to clean up %H…","Confirmed on the [oolite_entityClass]; wanted dead or alive in [commsPackA_number] systems…","Pick your targets and break to attack!","Offender targets acquired…");
setCommunicationsRole("hunter");
That's used only in the bounty hunter AI and bounty hunter leader AI in the core scripts, and none of the OXPs I use sets it... maybe yours do?
The beginningFight message type is sent from behaviourCommenceAttackOnCurrentTarget which for police is used when they see ships whose bounty exceeds their serious offender threshold or are fugitives (offenders are attacked if their bounty is greater than 50 - 6 * system government level).
For bounty hunters, it's the same as police except the threshold is halved (so if police would attack an offender with 20 bounty, bounty hunters will attack an offender with 10 bounty).
None of this explains the scenario of being attacked with no bounty.