[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
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sun, 18. Mar 07, 01:21

Klyith wrote:Just a beep isn't very informative; I liked the speech because it was unambiguous about which state the turrets were in.
Well, the speech could be a little shorter. =)

13/6 for "Targeting"
and
13/1275 for "Removed"
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.

Hubasan
Posts: 49
Joined: Fri, 19. Dec 03, 04:45
x3tc

Post by Hubasan » Tue, 20. Mar 07, 23:05

Hi Klyith and everybody else,

Just wanted to report a bug in this script. I'm still not sure if this is because of incompatibility with other scripts I'm running but this is what happens:

If there are great number of Xenon ships present in the sector (like Xenon invasion missions have...) and the turret is already set to attack enemies, Fighter Defense, Missile Defense, or other attack/defense command, when I try to deactivate the turret with previously assigned hot key, game will CTD. This can easily be replicated on my PC. I have since stopped using Turret on/off hot key and continued switching them Off manually.
It works fine when Player ship is not in combat, and if fighting with pirates not in large numbers. I'm flying Xenon XL as my player ship

I have these scripts running:

1) Anarkis Carrier Command
2) Automated Defense System
3) Cargo Delivery Service
4) Dock TS
5) fix Attack Command
6) Remote Docked Freight Exchange
7) Turret on/off Hotkey
8 Xai Corporation Attack Target Off...
9) Xai Corporation Station Command Suite
10) XaiCorp. Combat Commands Plugin
11) XaiCorp. Station Upgrades Framework
12) XaiCorp. Turret Commands Plugin

Here is the link to see the image of installed scripts and their versions:
Installed Scirpts

All of these scripts were working flawlessly before I have installed Turret on/off Hotkey script.
I have made .SPK myself by downloading .ZIP file from here and importing it into the Qt: X - Plugin Manager, and packaging it....before .SPK was posted on this forum. Installation was good and I have assigned hotkey without problmes. It was usable for couple of days until I went on another Xenon invasion mission, were it started crashing the game to Desktop.

Hardware:

CPU: AMD 64 X2 4400+ @ 2.5Ghz
Mem: 2GB Corsair PC3200CL2
HD: 2xWD Raptor 74GB in Raid 0
Video: GeForce 8800 GTX from XFX
Sound: SB X-FI Fatality
Mobo: Asus A8N-Sli Premium
OS: Win XP SP2 + latest patches

Please let me know if I can provide any more information.

And thanks,

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Tue, 20. Mar 07, 23:36

Hubasan wrote:If there are great number of Xenon ships present in the sector (like Xenon invasion missions have...) and the turret is already set to attack enemies, Fighter Defense, Missile Defense, or other attack/defense command, when I try to deactivate the turret with previously assigned hot key, game will CTD. This can easily be replicated on my PC. I have since stopped using Turret on/off hot key and continued switching them Off manually.
Ooooh, sorry. :(
So it will crash with any of the standard turret commands or the Xai turret commands? Probably a problem with my code then, not some sort of incompatibility with other scripts.
It works fine when Player ship is not in combat, and if fighting with pirates not in large numbers.
Now that is really, really interesting. It almost suggests that there is some sort of bug that is only showing up at high load. Very strange...

I will check this out as thoroughly as I can this evening. If I can't repeat the crash myself, would you mind doing some texts for me? Can anyone else out there try to replicate this?


Edit: Oh, just to make sure...
CPU: AMD 64 X2 4400+ @ 2.5Ghz
You have the AMD dual core optimizer and drivers? X3 will crash in all sorts of funky ways if you don't get that.

Hubasan
Posts: 49
Joined: Fri, 19. Dec 03, 04:45
x3tc

Post by Hubasan » Wed, 21. Mar 07, 03:36

Hey Klyith,

Yes, I have Dual Core Optimizer and drivers for AMD CPU. They are a must. Many games wouldn't work properly without them. :P

Didn't get a chance to say it before but this script is really phenomenal. As other said it, simple yet extremely needed and overlooked by Egosoft.

You will probably laugh when I say this but I just figured out what the problem seems to be...

When I read your post I went back to replicate the problem in Menalaus' Paradise where I kept the save game of Xenon invasion. But strangely enough the CTD was not happening anymore. Then I started remembering exactly what was I doing before and I started engaging xenon one more time and still nothing. Then all of a sudden it occured to me. I couldn't see my FPS count in Upper Right corner from FRAPS utility that I run with any game I play for speed/lag refference. I exited X3, ran FRAPS so that I could see Frames Per Second in the game, and loaded Xenon invasion mission again, and as soon as I clicked a hotkey to turn the Turrets off game CTD'ed again. :? :?

heheheh...so there you have it. It looks like FRAPS is responsible for this problem. But what's interesting is that problem is triggered by clicking Hotkey for turning Turrets On/Off....Off in my case.

Sorry for making you think your script alone might be responsible for this. I'm going to try and investigate this issue further to see if I can narrow it down little more and give you some more feedback.

Once again thanks for a very quick reply.

Ha...I just realized you're from Albany....I'm in Queens, NYC. Small world.

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Sat, 24. Mar 07, 12:14

Hi Klyith,

Thanks for making one of my wishes come true with this script.

I have a query concerning which ships it applies to. I understand that it works on player ship and toggles back to default once the player leaves. But, can an AI controlled ship be commanded to cease fire?

I plan to use this with Bunnys' weapon changer, and can see that there might be times when I'd like to tell my ships to hold off.

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Sat, 24. Mar 07, 19:18

Hey Hubasan!
Hubasan wrote:Hey Klyith,
snip turret hotkey versus Fraps
:o
Wow. Just, wow. That's the strangest thing I've ever heard of in an X3 crash, and I hang around the tech support forum a bit. Damn, I can't even imagine how a script, any script, plus fraps makes a crash! Thanks for testing enough to find the real cause, I would have had to mark it as unknown since I would never have replicated that.
Ha...I just realized you're from Albany....I'm in Queens, NYC. Small world.
Well hey sorta internet neighbor. I don't get down to the city very much myself... My sister lives in Boston, so mostly I go out to visit her when I want that big city stuff. (Ah, the eternal Boston - NYC rivalry!)
Squelch wrote:I have a query concerning which ships it applies to. I understand that it works on player ship and toggles back to default once the player leaves. But, can an AI controlled ship be commanded to cease fire?
That's not the kind of thing I want to add to this script, but there are easy alternatives. One would just be to use the command console + "broadcast to all ships in sector" to tell your guys to hold off. Or if you want a hotkey for faster response, look into Xai's Group Management System plus Group Combat Hotkeys. It doesn't have turret control, but I don't know how well my turret script would scale to large fleets anyways. If you stick to combinations of attack my target and defend commands on your turrets, just stopping the general attack should work without forcing them off.

...
As for anyone else, are there any votes for Gazz's idea to make the turrets auto-resume if you leave that ship? I can see a good and not terribly difficult way to do it, so don't hesitate to say!

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Sat, 24. Mar 07, 19:45

Thanks Klyith,

I understand better now I've play tested it. I can't believe why nobody thought to do it before. Well done.

I thought you had already implemented the auto-resume. It seems like a very sensible thing to have. So, you have my vote fwiw.

Hubasan - That is very odd. Just a wild guess. but could you have a hotkey combo setting in Fraps that screen grabs or otherwise steals focus from X3? I sometimes forget to turn off a comms app I use, and this drops me to desktop accidently.

Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz » Wed, 23. May 07, 13:36

Tried this one last night.

Works great. Only once in a while I'd turn it off and on again, and maybe have to hit the hotkay a third time before it came on again. Then once changed the setting and it kept changing back to the old setting.

Would love to have the autoresume on leaving the ship. Frenzy of the the capture, you know how it is ;)

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 25. May 07, 22:03

@ Klyith

Since I use Red Spot's Turret Defence, I added it to the list of supported turret scripts.

Maybe you would like to include it. The file is here.
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.

Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz » Tue, 29. May 07, 13:25

Ok, I made a mistake. At one point I manually set my turrets to none, but now whenever I hit the hotkey it always sets the turrets to none, whether it says turret ready or not avaliable, it always changes it to none. Tried switching turret config in off and on modes to no avail. Even tried switching ships.

How do i fix it?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 29. May 07, 17:40

Erilaz wrote:Would love to have the autoresume on leaving the ship. Frenzy of the the capture, you know how it is ;)
Actually, my "Homebase Rememberance Aid" does that.
It calls Klyith's script if you left the ship and forgot to turn turrets back on. =)
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.

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

Post by reinhart_menken » Sun, 10. Jun 07, 08:01

Hi,

Could you perhaps add support for the Turret Command suite?

Fistantantilis
Posts: 58
Joined: Sat, 7. Feb 04, 19:01
x3tc

Post by Fistantantilis » Thu, 28. Jun 07, 08:41

Hi,

Could you perhaps add support for the Turret Command suite?
I second that.

Eagle
Posts: 1052
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Eagle » Sun, 14. Oct 07, 18:33

 
The link to this script is dead - can anyone help? :)
 

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Sun, 14. Oct 07, 19:06

...still dead :-(

Sparky

ZX9000
Posts: 113
Joined: Wed, 19. Sep 07, 22:15
x3

Post by ZX9000 » Sun, 14. Oct 07, 20:13

Klyith wrote:
Not getting any response from the Spk download link
nope me neither its dead
Yep, the whole damn home.earthlink.net domain seems to be down... I need to dump this earthlink hosting, they're not even my ISP anymore but I paid $5 so that I could keep all my junk there and not have to deal with moving it...

Google pages ahoy! Temp links: spk zip
On page 2 ;)

Eagle
Posts: 1052
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Eagle » Sun, 14. Oct 07, 22:43

Thanks. :) Now to work out how to install it!

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Sun, 14. Oct 07, 23:40

Thanks ZX9000,

I think I need a reboot...been a long week and I'm still at work in the UK so I guess I need more sleep!

Regards,
ZX 81 :-)

Eagle
Posts: 1052
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Eagle » Mon, 15. Oct 07, 02:03

Script works a treat - thanks. :)

balogt
Posts: 773
Joined: Thu, 18. Dec 03, 09:00
x3

Post by balogt » Tue, 16. Oct 07, 06:47

the link isnt working pour moi. sadness

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