Greetings!
I've been looking through the game's files and playing around with numbers etc to get an idea of which does what, but I'm not 100% sure I'm on the right track for what I'm trying to achieve.
In essence, I want station turrets (both player controlled and NPC controlled) to have their turrets set to automatically attack all nearby enemies, and include all ship classes (xs -> xl) in their targetting.
Would anyone be able to point me towards the right files to edit in order to achieve this, if it is possible?
Cheers!
Station Turret AI?
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- EGOSOFT
- Posts: 2200
- Joined: Mon, 23. Nov 15, 18:02
Re: Station Turret AI?
fight.attack.object.station has the target acquisition and selection logic for station turrets.
-
- Posts: 4
- Joined: Mon, 17. Jun 19, 00:39
Re: Station Turret AI?
I'd found that much out myself, although I do thank you for confirming for me.

I don't quite know what to change though. I've had a fiddle here and there and made it in to an extension that the game picks up, but I am yet to notice anything working differently.

-
- EGOSOFT
- Posts: 2200
- Joined: Mon, 23. Nov 15, 18:02
Re: Station Turret AI?
<set_value name="$weapons_all" exact="this.ship.turrets.operational.list" />
<do_all exact="$weapons_all.count" counter="$i">
<set_weapon_mode weapon="$weapons_all.{$i}" weaponmode="weaponmode.attackenemies"/>
</do_all>
<remove_value name="$weapons_all" />
they are already mostly set to attackenemies. just missile turrets are set to defend to conserve ammo and mitigate stations shooting everything with overwhelming force.
look for:
<find_gravidar_contact groupname="$enemies"
there should be two instances.
remove
class="[class.ship_l,class.ship_xl]"
from
<match maybeattackedby="this.station" class="[class.ship_l,class.ship_xl]" comment="only select l/xl objects" />
in that node.
please be aware that including XS ships means that the station is very likely to hit itself when trying to shoot criminal mass traffic ships.
-
- Posts: 4
- Joined: Mon, 17. Jun 19, 00:39
Re: Station Turret AI?
See that's what I thought! I made similar changes, but it seemed like it didn't do anything. I'll make those exact changes and have a squiz. Thanks!
-
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03
Re: Station Turret AI?
Despite multiple patches and several re-starts, with mods and without my station turrets will NOT fire at enemies UNTILL fired at.