Based on Point 2 Point Patrol by ITFUncleDave
There is a certain lack of more advanced patrol scripts around. Most notably, I could not find a single one that would actually try to keep your ships alive and not go for the simple "spot enemy, attack enemy" approach.
With ITFUncleDave's script offering a perfect platform to build this on, I jumped at the challenge and got what I hope is a nice result.
Albion Prelude Only
NOTE: If updating from a 1.0.0 version, any ships that were running Advanced Patrol will stop after reaching their next waypoint. This is because I have updated the way local data is stored. You will need to re-issue the patrol commands for your lead ships.
NOTE: This version should be TC compatible but it contains a number of bugs and issues. I may add a fixed TC version in the future.
Unpack the archive in your x3terranconflict/addon folder.
Use the Plugin Manager to install the SPK file.
Selecting this allows you to choose a sector and a point to add as a waypoint.
Clear Points (Confirmation window)
Selecting this will clear all waypoints.
Range to engage enemies at (Between 10K - 100K)
This allows you to select the range that your patrolling ship will engage
enemies at, an enemy will not be engaged if it is not within sensor range
of player owned ships/stations/sats.
After Reaching Final Point
Allows you to specify what the patrolling ship does after reaching the final point.
What I always wanted in a patrol script ! Brains !
Enabling this will make your ships consider the strength of the enemy force they are about to engage, and compare it to the force of their own patrol formation and any other friendlies that may engage.
Zone of Engagement in KM
This is the area around detected enemy ships that your patrol ship will scan for enemy and ally forces in order to determine whether to engage.
If, after engaging or being engaged by the enemy, the zone of engagement becomes too dangerous (enemy force too great to handle by combined patrol and ally ships in zone ), the patrol ship and all accompanying ships will attempt to disengage and retreat to this location, before resuming patrol duties.
Same as the point, only it targets a ship instead. Useful for running off to a slow M2 when things get too hot for your small fighter patrols.
Begins the patrol.
The patrolling ship must have Patrol Command Software.
Safe Patrol Details
When a patrol ship running Advanced Patrol with Safe Patrol detects an enemy ship, it will scan for any ships present in a sphere with a set radius (Zone of Engagement range).
All ships (enemy + player owned + neutral that are enemy to the target) in the zone will have their shield dps, hull dps, current shield strength + approx. regenerated shield over 1m based on power generator and current hull strength calculated.
The patrolling ship and all ships flying in formation with it will also be considered.
Based on those numbers and this formula:
Code: Select all
$EnemyTTK = ($PatrolShieldValue + $NeutralShieldValue) / $EnemyLaserShieldValue + ($PatrolHullValue + $NeutralHullValue) / $EnemyLaserHullValue $FriendlyTTK = $EnemyShieldValue / ($PatrolLaserShieldValue + $NeutralLaserShieldValue) + $EnemyHullValue / ($PatrolLaserHullValue + $NeutralLaserHullValue)
If the friendly TTK is lower, the target will be engaged.
The scan is repeated throughout the engagement. If at any point the enemy TTK becomes lower, your patrol ships will retreat to their designated rally ship or rally point, or the next waypoint in their patrol.
If the formation leader ship (the one running the patrol script) is killed during the engagement, the slowest ship flying in formation with it will take its place and resume patrol once the engagement is over.
A log entry will inform you if this happens.
See this post for more details: http://forum.egosoft.com/viewtopic.php? ... 86#3945586
I am considering adding the following to this script in the future:
- Better functionality for fighters and carriers. (I don't think a carrier with docked fighters is properly scanned for firepower at the moment).
- Auto repair option for damaged ships. Ships that are damaged in an engagement will fly to the nearest friendly shipyard and conduct repairs (perhaps up to a set sum, otherwise sending a message to the player), then resume patrol.
- Khaak cluster values (currently clusters appear as weaponless ships I believe).
Text Pages Modified:
Currently the only supported language is English (44).If anyone wants to do a translation just send it over to me and I'll add it to the pack.
- Possible division by 0 in TTK formula can result in unpredictable patrol reactions when enemy group has no weapons (e.g. Valhalla running off from recon drone). Fixed in next release.
Suggestions/feature requests are welcome.
- ITFUncleDave for making Point 2 Point Patrol. I can't stress this enough really, if it wasn't for the excellent P2P Patrol script I would have never bothered to do this.
Alkeena for the excellent insight into OOS combat mechanics.