Protect Sector
This extension allows you to protect a sector from being harassed by hostile ships.
This is useful when you want to prevent hostile ships to attack your ships and stations. Or when you want to prevent from building in a sector.
Compatible with X4: Foundations 7.10 and upper. At least it written and tested with versions 7.10 and 7.50.
- Always the closest possible target will be selected to attack.
- Several ships/fleets with one order can work in one sector or crossed sectors.
- Not recommended to use single ship – the fleet is always better.
- Mimic order in a fleet is fully supported. But, again, not set single ship to mimic mode – use the fleet instead.
- The Lost Ship Replacement feature of version 7.50 is fully supported.
You can select the order as any other, like "Protect Station" or "Protect Ship", from the "Combat" section of orders.
Please be aware – this order requires the ship captain to have at least two stars in the "Pilot" skill.
There are a several configuration options available. You can see all of them on a screenshot.
This is a sector which will be protected. You can select it from the list of discovered sectors.
If you select not current sector, the ship will fly to the selected sector to some "safe" point before to start protecting it.
It can be any known sector, even if it is not yours.
Disabled by default.
If enabled, hostile stations in the protected sector will be attacked by ship and his squad.
It uses the specific logic to attack stations – equal to "Coordinate Attack" from the context menu.
With only one exception – the syncpoint will not be created. So, all squad ships will form the similar order but will not wait for each other.
You can select exact ship types:
- XL
- L
- M – enabled by default
- S – enabled by default
By default, the S and M ships are selected.
If it will find a hostile squad – it will not be attacked, if it contains at least one ship of the type higher than highest selected one.
There is a slider to define a minimal distance from the possible target to the hostile station. If the distance is less than the defined value, the ship will be selected as a target.
If value is 0 – the distance will not be checked.
Default value is 0.
Enabled by default.
Used to prevent the ship from attacking the target, which is not revealed yet or not visible for the player.
It has slightly different behavior for stations and ships:
- For stations – the station should be visible on a map. So – it has to be revealed, but it is not required to be in a live view, i.e. in radar range of your ships, stations, satellites, etc.
- For ships – the ship should be visible online. So – it has to be in a radar range of your ships, stations, satellites, etc.
Enabled by default.
If enabled, the ship will attack only hostile targets. It will use the appropriate command to filter the targets.
This is a slider to define the relation to the Player. Take in account – relation is shown as positive value, due to limitation of the game engine.
So, if you want to attack the ships with relation -10 and lower – you have to set the value to 10.
Default value is 25, i.e. attack the ships with relation -25 and lower.
Please take in account – when previous parameter is enabled, you can set this one in between 25 and 30 (-25 and -30 relation).
If the Attack only hostile targets is disabled – the value can be set in between 0 and 30 (0 and -30 relation).
Use it carefully.
Enabled by default.
If enabled, the ship will react on the event when the player’s ships or stations are attacked in the sector. It will try to protect them by attacking the hostile ships.
Enabled by default.
If enabled, the ship will not protect the military ships. It will not attack the hostile ships, which are attacking the military ships.
Disabled by default.
If enabled, the ship will pursue the target, which is trying to flee after is being attacked.
Enabled by default.
If you have more than one ship or squad with the same order, you can disable this option to prevent them from attacking the same target.
This setting allows you to define the ship behavior when the target is identified and selected.
The attack de facto contains two stages:
- The ship is trying to reach the target till some acceptable distance. This distance is defined as a percentage of the radar range.
- The ship is trying to attack the target when it is in the acceptable distance.
Disabled by default.
If enabled, the ship will not use the boosters to increase the speed. In game version prior 7.50 it will help to preserve the shield energy. For version 7.50 and higher, boosters are used always, despite the Avoid boosters usage option.
It is a percentage of hull of the target to make this order disabled. Useful when you want to achieve more abandoned ships.
By default, it is 0 percent – i.e. disabled this check.
If set to non-zero value, the ship will stop attacking when hull is less than desired percent.
Disabled by default.
If enabled, the ship will try to park at the sector core, when it is not targets to fight against.
It’s optional parameter, it means – it can be skipped to set.
Moreover, if Park at sector core is enabled – this parameter will not only be ignored, its value will be cleared. So, if you want to park exactly there – disable the Park at sector core option.
To set the value of this parameter – you have to select the exact position on the galaxy map inside the appropriate sector.
If the sector, selected in this parameter, is not the same as the Home Sector – the Home Sector will be changed to the selected one.
Default value is 4 seconds.
If you want – you can set it in between 1 and 90 seconds, with step 4 seconds. Bigger value will make less load on the CPU…
Enabled by default.
If enabled, the ship will record the events to the logbook. I.e. starts, travel to desired sector, flying to the target, attacking the target, destroying the target, etc.
If no Attack target is selected (i.e. no station and no any ship types are selected) – the ship’s captain will periodically call to the player to inform about absence of the order.
Special thanks to the pilot Assailer for his awesome script "Sector Patrol" which was used as a base for this one.
There is a thread on EgoSoft forum – [Mod/AIScript] Order "Protect Sector"[forum.egosoft.com]
Revisions:
Old revisions of this mod are available below. Click the link to download.