filepath of turret ai

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
ubuntufreakdragon
Posts: 5226
Joined: Thu, 23. Jun 11, 14:57
x4

filepath of turret ai

Post by ubuntufreakdragon »

does anyone knows where the turret ai is stored.
I e.g. want to add missile defence to the attack all enemies priority.
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: filepath of turret ai

Post by DeadAirRT »

I'm not sure but if you take a look in the old aggressive ai he made some changes to turrets that might lead you in the right direction. If i had to guess it's part of the targeting lib
j.harshaw
EGOSOFT
EGOSOFT
Posts: 2200
Joined: Mon, 23. Nov 15, 18:02

Re: filepath of turret ai

Post by j.harshaw »

Target acquisition logic for turrets with the various weapon modes are at:

fight.attack.object.capital for capital ships,
fight.attack.object.medium for M ships

Missile defence handling is done in a global interrupt handler in the two files. Work to expand that to include weaponmode.attackenemies would have to be done in the global interrupt handler, may require handling further down in the scripts as well, but looks like you would just need to add event.param2 (the missile that was fired) to $targets.

Return to “X4: Foundations - Scripts and Modding”