Page 1 of 1

[SCRIPT] Turrets Command Cycle for FCS MK2 - v1.00 2007-01-26

Posted: Sat, 27. Jan 07, 00:04
by Greg_G
Turrets Command Cycle for FCS MK2
http://x3.bitspring.com/tcc/

Developed for:
X3-Reunion 2.0.02 (REQUIRED)
Bonus Pack 3.1.05
Cycrow's Script Manager (REQUIRED)
Turret Missile Defence MK2 (required for full functionality)

Uses:
T File: 8761 (448761.xml)
Command: 359 (In Combat Menu)
Page ID: None
Ware: None

What it does:
TCC cycles all turrets on the player's current ship through four commands:

Alpha - Advanced Missile Defense from Turret Missile Defence MK2
Beta - Default Missile Defense
Gamma - Default Protect Ship
Delta - Default Attack Enemies

Each cycle will forward the command by one, and then cycling from Delta back to Alpha.
The command can be "spammed" over and over (e.g. press it three times in rapid
succession to get from Alpha to Delta) without slowing or missing commands. The Greek
letter for the command ultimately selected will be spoken by the computer voice.

Installation:
Use Cycrow's Script Manager to install the SPK file.

Where to buy:
You need only the default Fight Command Software MK2 installed to use this feature.

How to use it:
TCC can be activated in the Command Console in the Combat section. Additionally it
can be mapped to a key (e.g. Shift-F1) from here:
Options->Controls->Interface->Extensions->Turrets Command Cycle-Forward

Limitations:
1) If Turret Missile Defence MK2 is not installed, setting to Alpha will cause no
change to the turrets commands. (See Future Plans #2 for a possible resolution)
2) This command will only affect the player's ship and can not be used on any other
ship. I can and will change this so that the Command Menu version of the command can
be invoked on other player-owned ships in the future if there is a call for it from
users. (See Future Plans #1 regarding this)
3) Because it only operates on the player's ship, it uses global variables intead of
ship-specific local variables. Should I change (2), I'll obviously change (3).

Notes:
I actually wrote this as a quick script for myself and I bet many of you have done
the same. But when I was done I realized hardly any more work was necessary to make
it release-quality, so I went ahead and polished it up for release.

I got the inspiration for this script from a question by xalien in the
[SCRIPT] Weapons Changer v1.45 thread. I then got HOWTO ideas from the
Command_turret? thread. A special thank you to all the posters in that thread.

It seems likely other folks have written and even released scripts similar to this
in the past, since it seems pretty obvious. I hope I'm not stepping on any toes. If
I have, and this script doesn't do anything new, I'll remove it. But since a look
through of the forums and scripts stickies didn't bear any fruit, I think that this
is going to be useful for some people.

IMPORTANT NOTE:
THIS IS ONLY MY SECOND X SCRIPT. THERE MAY BE BUGS IN IT AND THIS SHOULD BE
CONSIDERED A PUBLIC BETA TEST. I chose all currently unused command slots, etc.,
however, I will not seek official "dibs" on them until such time as folks feel that
it is worthy. Obviously, I'd appreciate if other script authors would avoid these
for the time being. At least until we see if anyone other than me wants to use this
script.

This script uses recursion to implement the fast and non-skipping command entry.
Usually I would avoid recursion but it was the best way to implement this
rather sophisticated element. I believe I took all necessary measures, including a
mutex, to prevent an infinite loop of the primary function.

Known Bugs:
1) None yet

Future:
There are two major improvements that I will consider that are obvious to me:

1) As mentioned above, make the script runnable on player-owner ships other than the
player's current ship. This would primarily entail changing the global variables to
local and a few other minor changes. However, I feel this script is mainly going to
be used for the player's current ship so I didn't see a need to add this
functionality without getting requests. Cycling through multiple commands one-by-one
in the Command Menu would be tedious.

2) Adding the ability to turn off the turrets entirely. To do so, a do-nothing
script will need to be assigned to the turrets (since there is no way that I can
find to remove a turret command). If there is interest in this, I will ask Klyith
for permission to use the dummy script found in Turret On / Off Toggle Hotkey. This
would allow for two things, setting Alpha to Off when Turret Missile Defence MK2 is
not installed, and/or adding an Off option into the cycle.

Files in Package:
plugin.tcc.main.xml (main script)
plugin.tcc.launcher.xml (helper script)
setup.plugin.tcc.xml (setup script)
setup.plugin.tcc.uninstall.xml (uninstall script)
448761.xml (t file)
readme-TCC.txt

Uninstall:
Use the Script Manager to remove script files. This should install the uninstall
script automatically. After loading a save game, this script should run and remove
remove the command slot and hotkey registration.

If this doesn't happen, manually copy the uninstall script (available for download
below) to your X3 scripts directory. Be sure to remove the uninstall script before
re-installing TCC. You never want both setup.plugin.tcc.xml and
setup.plugin.tcc.uninstall.xml installed in your scripts directory at the same time.

Thanks:
Again to all the tutorial authors
Cycrow (for lots of things)
fud (for Turret Missile Defence MK2)
asynd, fud (again), moggy2, Cycrow (again) and Red Spot for their contributions in
the Command_turret? thread.

Download:
SPK Package v1.00:
http://x3.bitspring.com/files/TurretsCo ... 1.2007.spk
Uninstall Script v1.00: (Right-click->Save Target As...)
http://x3.bitspring.com/files/setup.plu ... nstall.xml

Posted: Sat, 27. Jan 07, 06:16
by asynd
very nice :)

i was never able to get my script to fully work on how i intended it too, glad to see someone else ended up having success. i will install this and see how well everything plays out with it.