X4: Foundations

X4: Foundations

Sector Patrol
Meme Turtle 13 Jul, 2022 @ 4:41pm
Temp fix for attacks on trade ships
Patrol scripts will issue attacks on enemy traders which can cause reputation loss in non-player sectors. Ideally, the script should respect reputation AND fire control authorization overrides. But as a quick fix you can add extra option to only attack enemy combat ships.

Assuming you've added this new option $fs_ignore_trade this is how you can use it to filter ships to combat only(in sectorpatrol.xml L:115):
<do_if value="$fs_ignore_trade"> <find_ship name="$ships" space="this.ship.sector" class="$classes" recursive="true" multiple="true" primarypurpose="purpose.fight"/> </do_if> <do_else> <find_ship name="$ships" space="this.ship.sector" class="$classes" recursive="true" multiple="true"/> </do_else>
< >
Showing 1-12 of 12 comments
aweagle 15 Aug, 2022 @ 1:09pm 
Could you just post your ext 01 dat? I added the parameter but it still doesn't load.
aweagle 15 Aug, 2022 @ 1:46pm 
Thanks. Loads and also seems to be working properly with ships still aiming for SCA but not starting any wars
kananesgi 14 Oct, 2022 @ 9:51am 
How do I use this? I tried downloading a tool from egosoft for X:R that was said to work in X4, but when I try to extract the .cat file, it throws an error, and the .dat file doesn't do anything in it. I'm far from a mod maker myself, no idea what I'm doing, but I really want this to work.
Meme Turtle 14 Oct, 2022 @ 10:00am 
cat/dat are just archives, you can use unpacked versions of a mod without issues. Download the archive with link I provided, place it into the extensions folder and remove the original sector patrol mod from extensions.
kananesgi 14 Oct, 2022 @ 10:04am 
ah, ok, I thought I needed to replace the sectorpatrol.xml file within the original mod, so I needed to extract it first. I finally figured out how to do that (bonehead mistake, needed both the cat and dat in the same directory :facepalm). Now I see what I need to do. Thanks.
anaris 6 Apr, 2023 @ 6:31am 
wait so delete original fs_pat folder and replace ti with this f_pat folder? doesn't seem to show up in orders if i do that, am I misunderstanding?
Meme Turtle 6 Apr, 2023 @ 10:13am 
Originally posted by anaris:
wait so delete original fs_pat folder and replace ti with this f_pat folder? doesn't seem to show up in orders if i do that, am I misunderstanding?

If you simply copy it over it's possible you have both cat/dat achives of the original mod and the updated version.

Unsubscribe from the original mod, remove fs_pat folder in extensions, copy fs_pat folder from the archive to extensions, check the mod is enabled in extensions. In the game the mod should have the same version and description as the original, the only difference is this new option to not attack trade ships.

Alternatively, you can ditch this mod as it's no longer maintained and use reaction force instead. Or try to make use of position defence from 6.0(when it's released).
Mortlock 23 Jan, 2024 @ 1:36am 
Is this fixed in the most up to date version on steam?
Nesh 1 Jun, 2024 @ 10:44am 
Originally posted by Meme Turtle:
No, but I can share the extracted archive:
https://drive.google.com/file/d/1oOAVBDn4Yca6e-9y52d55W5tC-tEWexr/view?usp=sharing

(sort of necro) Applied patch to the latest (1.11?) version I got from nexus will see if it still works.

If anyone is interested here's the patch:

diff --git a/aiscripts/sectorpatrol.xml b/aiscripts/sectorpatrol.xml index 4024502..b2c026a 100644 --- a/aiscripts/sectorpatrol.xml +++ b/aiscripts/sectorpatrol.xml @@ -8,6 +8,7 @@ <param name="fs_attack_l" type="bool" default="false" text="{314155, 11}"/> <param name="fs_attack_m" type="bool" default="true" text="{314155, 12}"/> <param name="fs_attack_s" type="bool" default="true" text="{314155, 13}"/> + <param name="fs_ignore_trade" type="bool" default="true" text="{314155, 17}" /> <param name="fs_pirates" type="bool" default="true" text="{314155, 8}"/> <param name="fs_pursue" type="bool" default="false" text="{314155, 9}"/> <param name="fs_noboost" type="bool" default="false" text="{314155, 7}"/> @@ -111,7 +112,13 @@ <debug_to_file directory="'fs_pat'" name="'debug'" text="'%s'.[$classes]" output="false" append="true"/> + <do_if value="$fs_ignore_trade"> + <find_ship name="$ships" space="this.ship.sector" class="$classes" recursive="true" multiple="true" primarypurpose="purpose.fight"/> + </do_if> + <do_else> <find_ship name="$ships" space="this.ship.sector" class="$classes" recursive="true" multiple="true"/> + </do_else> + <do_all exact="$ships.count" counter="$si"> <set_value name="$ship" exact="$ships.{$si}"/>
Nesh 1 Jun, 2024 @ 11:10am 
Just saw it, missed line in t\0001.xml:

<t id="18">Ignore trade ships</t>

Also needs updating in aiscripts\sectorpatrol.xml as id 17 is already taken in 1.11

<param name="fs_ignore_trade" type="bool" default="true" text="{314155, 18}" />
dubius 21 Jun, 2024 @ 11:53pm 
Much appreciated! Not sure why this fix hasn't been integrated into the mod yet by the author but this will save me a lot of frustration. I've been reloading my save every time this patrol scrip plunges me into war for attacking friendly traders
< >
Showing 1-12 of 12 comments
Per page: 1530 50