[SCRIPT] Turret on/off Hotkey V1 (3.16.07)

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
Klyith
Posts: 575
Joined: Fri, 6. Jan 06, 02:38
x3

[SCRIPT] Turret on/off Hotkey V1 (3.16.07)

Post by Klyith » Tue, 16. Jan 07, 04:48

Turret On / Off Toggle Hotkey :: v1.0
Download: Zip file :: SPK package

The problem:
"Boron no fight! We give-- BOOM!"
The solution:
A hotkey to quickly turn off all turrets. It won't prevent every loss of bail-outs (there's only so much you can do when 20 hept bolts are already in flight vs an M5), but it may save some ships, and be useful in other cases as well.


This hotkey will toggle your turrets off and on. Each turret's active command is individually stored when it is turned off, so when turned on the exact scheme is restarted. I.E. if you have your ship set to front attack target, left & right protect ship, and rear missile defense, after hitting the hotkey twice the same scripts will be in place.

Your ship computer gives audio feedback for on and off switching:
"Targeting no aim" = Turrets turned off.
"Weapon system ready" = Turrets turned on.
and for possible errors (see readme).

The memory system uses local variables on each ship, so changing from one ship to another is not a problem.
I personally like using the caps lock key -- the light gives a nice on/off feel.

:: Version history ::
0.9 - initial release
1.0 - support for Xai turret commands & Fud adv missile defense, text file and uninstall script added


- - -
This script brought to you by Wild Turkey 101.
Last edited by Klyith on Sat, 17. Mar 07, 19:40, edited 2 times in total.

Cedrk
Posts: 79
Joined: Sat, 8. Jul 06, 01:59
x3tc

Post by Cedrk » Tue, 16. Jan 07, 09:14

This idea has been around on the forum for some time but no one had written a script to do it until now, great work!.... downloading now
I personally like using the caps lock key -- the light gives a nice on/off feel.
or you could use the Num lock key or scroll lock.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Fri, 16. Mar 07, 18:39

This has the nice side effect that your turrets are forced to recalculate the target and don't keep firing at some M5 at 2km. =)

Beautifully simple!

PS: do you have to turn the turrets back on before you leave the ship or is that done automatically?
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

John Buford
Posts: 163
Joined: Sat, 3. Jan 04, 21:11
x2

Post by John Buford » Fri, 16. Mar 07, 20:34

Is this compatible with the xaicorp turrent commands?

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 06:23

Post by reinhart_menken » Fri, 16. Mar 07, 23:50

Hello again ;)

Must say this is a great script. I have been having this same problem (more like annoyance) and always had to go through a couple steps to turn off my turret. In the end I just always kept my turrets off unless I get into a very tight situation (makes me think my turret is rather useless).

User avatar
Klyith
Posts: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Sat, 17. Mar 07, 01:33

John Buford wrote:Is this compatible with the xaicorp turrent commands?
It is... NOW. :D Version 1.0 released!
I've actually had added support for both Xai Turret Commands and Fud's Adv Missile Defense for a while, but I never bothered to do a public update. The topic sank like a rock the first time around so I figured nobody was using it. Nice to see I was wrong. 8)

So, the update: HotTurret interacts with Xai's turret scripts just like the standard ones, on & off. However, it ignores Fud's Advanced Missile Defense script (which shoots missiles only). So if you use that, you can turn off any offensive turrets and not have your defensive script interrupted.

Also added: an uninstall script, which you can run manually from the script editor to remove the hotkey.
Gazz wrote:PS: do you have to turn the turrets back on before you leave the ship or is that done automatically?
Yes, if you want the turrets on. It does store the turret settings locally to the ship though. So if you turn off the turrets on a ship, switch to another, and then swap back to the original ship, hitting the hotkey will turn them on again.


Public vote time: would people rather have the turrets auto-resume if you swap to another ship?

User avatar
jocan2003
Posts: 615
Joined: Tue, 6. Mar 07, 18:48
x4

Post by jocan2003 » Sat, 17. Mar 07, 07:15

great!! ive been looking for something like this!!!! mucchhooo thanks man :)

for the swap if leave ship would be good, as it would offer protection if we forget, and it would turn back on in case we want to stay in the other ship so we dont have to fly back on the other ship to turn it back on or redo all the turret setting from command window or perhaps just add a command in the ship addition command? so we can turn it off and on from distance

ORIOLE
Posts: 274
Joined: Wed, 20. Oct 04, 10:34
x2

Post by ORIOLE » Sat, 17. Mar 07, 11:27

Great script that adds to the enjoyment of X3, well done :!:

Could you please pack it into a .spk package :?:

:)

chilipalmer
Posts: 571
Joined: Wed, 28. Dec 05, 15:09
x3

Post by chilipalmer » Sat, 17. Mar 07, 11:39

nice
will try this out

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sat, 17. Mar 07, 12:28

Klyith wrote:Public vote time: would people rather have the turrets auto-resume if you swap to another ship?
I did this with another script. =)
My "Homebase Rememberance Aid" sets the homebase to what it was before I entered the ship and it also restores the turret setting now.
(and other stuff)

Alas, I had to change YOUR script or that, too, because you hardcoded it to [PLAYERSHIP] so it would not run on any other ship.
Changing that to a variable wasnt much of a feat, though.

Code: Select all

002   $Ship = [THIS]
003   skip if $Ship
004    $Ship = [PLAYERSHIP]
That way I can run the script on any ship. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

chilipalmer
Posts: 571
Joined: Wed, 28. Dec 05, 15:09
x3

Post by chilipalmer » Sat, 17. Mar 07, 15:09

is this universal set once and forget or do you have to set it up for every ship you get in ?

John Buford
Posts: 163
Joined: Sat, 3. Jan 04, 21:11
x2

Post by John Buford » Sat, 17. Mar 07, 15:12

Methinks I am going to test this, sounds like a very useful tool.

User avatar
Klyith
Posts: 575
Joined: Fri, 6. Jan 06, 02:38
x3

Post by Klyith » Sat, 17. Mar 07, 19:47

ORIOLE wrote:Could you please pack it into a .spk package :?:
Ask and ye shall receive ;)

chilipalmer wrote:is this universal set once and forget or do you have to set it up for every ship you get in ?
Not sure exactly how you mean that. The hotkey itself, you need to set a key in the control setup screen, but that's just once & universal when done. The action of using it is just "press the key = turrets off" and "press the key again = turrets on". It works in whatever ship you're piloting at the time.

chilipalmer
Posts: 571
Joined: Wed, 28. Dec 05, 15:09
x3

Post by chilipalmer » Sat, 17. Mar 07, 20:22

thanks for the reply i was not sure if it had to be setup for every ship individually

John Buford
Posts: 163
Joined: Sat, 3. Jan 04, 21:11
x2

Post by John Buford » Sat, 17. Mar 07, 21:44

Works like a charm. Maybe you could add a little beep before the "weapons system ready" voice of Betty else you get the impression of a full sentence "targetting no aim weapons systems ready", or just a beep/double beep/triple beep as in prolongued fights the continous chatter of Betty begins to tear down my sanity (just my preference maybe some other could post here about their experience)

Post Reply

Return to “X³: Reunion - Scripts and Modding”