[SCRIPT] Weapon Switcher

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

[SCRIPT] Weapon Switcher

Post by moggy2 » Thu, 23. Oct 08, 01:25

Script: Weapon Switcher
Version: X3TC 1.0
Download: http://www.xai-corp.net/en/projects/xai ... onswitcher

The NPC's use advanced weapon switching in the turrets of their large ships (M6 and bigger). This script assigns the same scripts that the NPC shps use to the commands for player ships.

Turrets on M3 fighters and TS transports do not perform weapon switching, for NPC's or player ships.

homerdog
Posts: 89
Joined: Mon, 29. May 06, 23:06
x3tc

Post by homerdog » Thu, 23. Oct 08, 01:38

How is the switching handled? Like which guns attack what targets?

Thanks for the script. I'll need it when I get my M2 :) .

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Thu, 23. Oct 08, 02:03

homerdog wrote:How is the switching handled? ....
Quite honestly. I don't have a clue. Standard AI ships will switch to using weapons appropriate for the target, if they have any alternatives in the cargobay.

All this script does is link those scripts to the player's turret commands.

User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Fri, 24. Oct 08, 01:02

It uses this command: (In X3R)

033 ||[THIS] -> select and switch lasers for target null in turret $turretid: scan for friends $friendly

Although... that command doesn't actually exist sooo... none can really say. But I'd assume it switches between splash and non-splash weapons

aXeL_UK
Posts: 188
Joined: Thu, 23. Oct 08, 22:45
x3tc

Post by aXeL_UK » Sat, 25. Oct 08, 11:45

moggy2

There appear to be two versions of the file. Should I use both or does one supercede the other?

Scoob
Posts: 5878
Joined: Thu, 27. Feb 03, 23:28
x4

Post by Scoob » Sat, 25. Oct 08, 22:31

Hi moggy2,

I've tried this but it doesn't appear to be working for me.

I downloaded BOTH files (WeaponSwitcher-X3TC-1.0.zip and WeaponSwitcherFix-X3.0.1.zip) from that URL and overwrote the original version with the 'fix' version. I copy the script (setup.weapon.switcher.xml) to my scripts folder & load the game.

I stopped & started the turret commands on my Elephant just to make sure - it's loaded with loads of different weapons as it's my Storehouse.

I came across a Kh'aak Cluster & engaged to see how the Laser swapping worked. Nothing happened, my turrets kept the loadout I'd allocated them.

Observation: while the script it copied to my scripts folder I cannot see it in the script editor, nor is it reported as running. I thought I might have to run it manually once for it to start doing it's thing.

I've probabaly missed something simple here but any guidance would be appreciated.

Thanks,

Scoob.

User avatar
ezra-r
Posts: 3088
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Sun, 26. Oct 08, 15:58

the automatic turret switching never worked on TL's just M6 and beyond (excluding TL's like I said).

---

Thanks moggy! this is a must have script, will install it after next patch!

Scoob
Posts: 5878
Joined: Thu, 27. Feb 03, 23:28
x4

Post by Scoob » Sun, 26. Oct 08, 21:34

Hi ezra-r,

Thanks for the info re: TL.

I've also got an M6 (Skiron) and that too refuses to perform any sort of weapon switching. I have numerous lasers on board however it just stick with whatever I've installed manually.

Cheers,

Scoob.

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Mon, 27. Oct 08, 01:35

Scoob wrote:Hi ezra-r,

Thanks for the info re: TL.

I've also got an M6 (Skiron) and that too refuses to perform any sort of weapon switching. I have numerous lasers on board however it just stick with whatever I've installed manually.

Cheers,

Scoob.

The two versions of the script are for X3 and X3TC. I thought it might have been obvious from the filenames.
I think you've got the X3 script installed, judging by what you said in the previous post. Download and install the one with X3TC in the filename.

I've added comments to the download page to make things a bit clearer. Sorry for the confusion.

User avatar
ezra-r
Posts: 3088
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Tue, 28. Oct 08, 10:11

Working good so far! Tried it in a Heavy Nemesis.

Just so anyone know, it wont use area of effect weapons unless its the only weapon available, like npc's.. so it wont use those nifty flamethrowers.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”