[REQUEST] Prevent AI attacking build storage
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 108
- Joined: Tue, 4. Dec 18, 01:43
[REQUEST] Prevent AI attacking build storage
Can someone make a mode to prevent the AI pilots from attacking build storage for stations? It is super annoying that they seem to prefer to attack the Xenon station build storage over almost any other target. They stay there shooting it forever instead of doing their partrols or default behaviours. It is even a challenge to draw them away from it.
I would appreciate it, thanks.
I would appreciate it, thanks.
-
- Posts: 108
- Joined: Tue, 4. Dec 18, 01:43
Re: [REQUEST] Prevent AI attacking build storage
I figured out how to make a mod to fix this. I found the fix in the Foundation of Conquest and War V. 1.25 mod and extracted just this change out to a separate mod. I put it on Nexus. Credit goes to authors of the FOCW mod.
Destroy Build Storage
https://www.nexusmods.com/x4foundations ... escription
Destroy Build Storage
https://www.nexusmods.com/x4foundations ... escription
-
- Posts: 23
- Joined: Mon, 20. May 13, 13:18
Re: [REQUEST] Prevent AI attacking build storage
But that then gives a modified tag right?cole2839 wrote: ↑Mon, 24. Dec 18, 21:43 I figured out how to make a mod to fix this. I found the fix in the Foundation of Conquest and War V. 1.25 mod and extracted just this change out to a separate mod. I put it on Nexus. Credit goes to authors of the FOCW mod.
Destroy Build Storage
https://www.nexusmods.com/x4foundations ... escription
-
- Posts: 108
- Joined: Tue, 4. Dec 18, 01:43
Re: [REQUEST] Prevent AI attacking build storage
Any mod does yes. I took that mod down because it causes other bugs. Not sure which bug is worse though, LOL. This indestructible build storage is pretty game breaking.
-
- Posts: 3206
- Joined: Thu, 16. Jul 09, 12:24
-
- Posts: 813
- Joined: Fri, 11. Nov 05, 23:18
Re: [REQUEST] Prevent AI attacking build storage
Note to self, add a invincibility check to Aggressive AI targeting routines so anything invincible is just ignored.
Will have to test it, but maybe tomorrow it will be released
Will have to test it, but maybe tomorrow it will be released

-
- Posts: 424
- Joined: Thu, 20. Aug 09, 08:17
Re: [REQUEST] Prevent AI attacking build storage
i was working on this yesterday, Apparently ships are already supposed to ignore the build storage objects and invulnerable objects like wrecks and certain stations. i'm still diagnosing the reasons why this is bypassed
My Mods:
Sector Administration: A Tax Mod
Sector Administration: A Tax Mod
-
- Posts: 813
- Joined: Fri, 11. Nov 05, 23:18
Re: [REQUEST] Prevent AI attacking build storage
Hmm, while I can easily use find_XXXX to locate invulnerable things, I am having no luck finding a simple property on something I already have to see if it is invulnerable (i.e. $target.isinvulnerable). Do you happen to know the right syntax to determine if an object is invulnerable...I'm probably just too tired and missing it

In any case, right now I can prevent adding invulnerable things to the attack targets unless they are attacking the ship, should take care of most all situations...unless build storage has guns on it

-
- Posts: 3206
- Joined: Thu, 16. Jul 09, 12:24
Re: [REQUEST] Prevent AI attacking build storage
What if the ships only target the guns on the build storage and once destroyed they move on after the turrets are gone, would that be a good work-around... assuming of course if it can be done?7ate9tin11s wrote: ↑Fri, 28. Dec 18, 05:44Hmm, while I can easily use find_XXXX to locate invulnerable things, I am having no luck finding a simple property on something I already have to see if it is invulnerable (i.e. $target.isinvulnerable). Do you happen to know the right syntax to determine if an object is invulnerable...I'm probably just too tired and missing it![]()
In any case, right now I can prevent adding invulnerable things to the attack targets unless they are attacking the ship, should take care of most all situations...unless build storage has guns on it![]()
-
- Posts: 813
- Joined: Fri, 11. Nov 05, 23:18
Re: [REQUEST] Prevent AI attacking build storage
At a glance build storage does not have any guns or shields (which would be a bit unfair for an invulnerable object anyways). So I think I can work out a solution.Requiemfang wrote: ↑Fri, 28. Dec 18, 05:56 What if the ships only target the guns on the build storage and once destroyed they move on after the turrets are gone, would that be a good work-around... assuming of course if it can be done?
-
- Posts: 424
- Joined: Thu, 20. Aug 09, 08:17
Re: [REQUEST] Prevent AI attacking build storage
There is no property for it, i temporarily got around the issue by adding:7ate9tin11s wrote: ↑Fri, 28. Dec 18, 05:44Hmm, while I can easily use find_XXXX to locate invulnerable things, I am having no luck finding a simple property on something I already have to see if it is invulnerable (i.e. $target.isinvulnerable). Do you happen to know the right syntax to determine if an object is invulnerable...I'm probably just too tired and missing it![]()
In any case, right now I can prevent adding invulnerable things to the attack targets unless they are attacking the ship, should take care of most all situations...unless build storage has guns on it![]()
<do_if value="$primarytarget.isoperational and not ($primarytarget.isclass.[class.buildstorage])">
--------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
to the lib.target.selection, it was not a good fix but it did stop them from needlessly attacking it. Currently i'm looking for a good way to clean up build storages without stations or plots. so i need to find a good way to detect one that's part of a building station(so that doesn't get cleaned up). And then also figure out how to block new stations before they're built.
Something up the chain there is finding buildstorages to attack and it's taking me a while to find what it is, because everything after that will check for buildstorage and invulnerability
Invulnerability is a statement found by way of the <find/> tag. eg: <find_object_component name="$component" object="$object" indestructible="false" invulnerable="false"/>
My Mods:
Sector Administration: A Tax Mod
Sector Administration: A Tax Mod
-
- Posts: 813
- Joined: Fri, 11. Nov 05, 23:18
Re: [REQUEST] Prevent AI attacking build storage
Likely the find_gravidar_contact search for enemies also needs the flags or it would find a lone buildstorage and add it to the target list.Matterom wrote: ↑Fri, 28. Dec 18, 07:50 There is no property for it, i temporarily got around the issue by adding:
<do_if value="$primarytarget.isoperational and not ($primarytarget.isclass.[class.buildstorage])">
--------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
to the lib.target.selection, it was not a good fix but it did stop them from needlessly attacking it. Currently i'm looking for a good way to clean up build storages without stations or plots. so i need to find a good way to detect one that's part of a building station(so that doesn't get cleaned up). And then also figure out how to block new stations before they're built.
Something up the chain there is finding buildstorages to attack and it's taking me a while to find what it is, because everything after that will check for buildstorage and invulnerability
Invulnerability is a statement found by way of the <find/> tag. eg: <find_object_component name="$component" object="$object" indestructible="false" invulnerable="false"/>
-
- Posts: 813
- Joined: Fri, 11. Nov 05, 23:18
Re: [REQUEST] Prevent AI attacking build storage
I think I have it covered in AggressiveAI now. Please give it a shot.cole2839 wrote: ↑Mon, 24. Dec 18, 15:28 Can someone make a mode to prevent the AI pilots from attacking build storage for stations? It is super annoying that they seem to prefer to attack the Xenon station build storage over almost any other target. They stay there shooting it forever instead of doing their partrols or default behaviours. It is even a challenge to draw them away from it.
I would appreciate it, thanks.

7ate9tin11s wrote: ↑Fri, 28. Dec 18, 19:30 Aggressive AI Version 1.1 ReleasedDownload
- Combat AI should no longer target invulnerable objects unless specifically told to by the player
- Deployables now category in case someone decides to mod in new deployable wares
- Reduced chances of using deployables, but pilots will still panic at low hull and throw everything at you in an attempt to live
- Minor OOS damage calculation fixes now that drones are usable and killable OOS
- Tossed in an optional CAT/DAT version for users of legacy operating systems
https://www.nexusmods.com/x4foundations/mods/206/
-
- Posts: 108
- Joined: Tue, 4. Dec 18, 01:43
Re: [REQUEST] Prevent AI attacking build storage
7ate9tin11s wrote: ↑Fri, 28. Dec 18, 19:48I think I have it covered in AggressiveAI now. Please give it a shot.cole2839 wrote: ↑Mon, 24. Dec 18, 15:28 Can someone make a mode to prevent the AI pilots from attacking build storage for stations? It is super annoying that they seem to prefer to attack the Xenon station build storage over almost any other target. They stay there shooting it forever instead of doing their partrols or default behaviours. It is even a challenge to draw them away from it.
I would appreciate it, thanks.![]()
7ate9tin11s wrote: ↑Fri, 28. Dec 18, 19:30 Aggressive AI Version 1.1 ReleasedDownload
- Combat AI should no longer target invulnerable objects unless specifically told to by the player
- Deployables now category in case someone decides to mod in new deployable wares
- Reduced chances of using deployables, but pilots will still panic at low hull and throw everything at you in an attempt to live
- Minor OOS damage calculation fixes now that drones are usable and killable OOS
- Tossed in an optional CAT/DAT version for users of legacy operating systems
https://www.nexusmods.com/x4foundations/mods/206/
Nice dude. Thanks !!!