[SCRIPT] x0ne Turret Control System (TCS) 1.02 [UPDATED 31/12/2010]

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

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

x0ne
Posts: 173
Joined: Sun, 9. Apr 06, 21:49
x3tc

Post by x0ne » Mon, 7. Jan 08, 21:39

MJALowe wrote:didn't know if this was suggested for version 2 or not...but could you add a command that can be run on the player ship that will turn this off/on for all other ships that dont have a leave me on flag set, that way i could install this on darn near every ship and if i call in backup i can turn it off for everyone but me and my designated "turret" leaders

if turning this off is as simple as removing the ware i suppose i could right the script myself - but i wanted to make sure the idea was out there
That's an interesting suggestion, but I can see a couple of problems with it. The biggest being that if you stop the TCS on a ship, how does it start back up again when you want it to? You'd have to maintain an array of all TCS enabled ships somehow, and because ships can be destroyed, this array would have to be global and maintained by a global process.

I'd really prefer to keep things simple and in line with how the game generally works, and that means adding an upgrade to a ship to add functionality, and with the player being in control of what commands run on each ship (i.e. you start the turret commands you want to run).

A better way to achieve this would therefore be to have a command that sets a 'remote control' flag on a ship, then have a couple of hotkeys for activating/deactivating all in-sector flaged ships. That is very do-able, and I will certainly consider this once 2.0 is out (at present I'm not adding any more functionality - I want to get the damn thing released at some point! :)).

MJALowe wrote:also would be nice to have a toggle for main weapon switching - so this plugin could also handle what the appolyon arms laser switcher does *grin*, if not ill have to get that script too - that one specifically doesnt work on turrets or with

Code: Select all

 Gamma and Beta PPC
- All PSG types
- Ion Disruptors
- Custom (new) weapons 
I've been thinking about this myself actually, if I do it'll be after 2.0 though, but thanks for the suggestion.

MJALowe wrote:a prioritize my target option (hotkey *grin*) would be good too, i just noticed a "certain" other script with a similar abreviation had that option *grin*
All TCS commands do this by default, there's a lot more detail on the targeting priorities in the readme that came with the plugin, I'd suggest having a read of that as it should answer all of your questions.

2.0 will have extra functionality in this area though and should cater for everyones needs.

MJALowe wrote:edit2: id also like to confirm that fcs mk3 and giaus dont interfer with this script - if some one knows id be happy to hear from them, i dont think it interfers but i haven't read all the script code on them or this
That I don't know, sorry. Depends if GIAUS messes with the turrets - I don't think it does, does it?

MJALowe wrote:edit3: np, i know how RL can get ya...its been almost a year since i released IFTSOS and i still haven't gotten around to releasing any updates for it - mainly cause it works as is and any updates would be mostly cosmetic
:) Yeah RL is a pain, I'm really depressed over it right now - not done any scripting since x-mas...

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Tue, 8. Jan 08, 02:18

each ship has a local variable turn me off/turn me on
two hotkey/command
1st toggles variables
2nd does

Code: Select all

setup
  command is run = false

if command run
  if command is run = false
    get array of all player owned ships in sector
    set array to global variable for auto turn back on if player leaves sector
    size of array
    while size > 0
     dec size
     if ship local variable true
       turn off tcs
     else
       do nothing
     end
    end
     command is run = true
  else if command is run = true
    *same as above but turns the TCS back on
  end
end

on player ship - possibly through an al pluggin
  on sector change
    get global array of ships
    size of array
    while size > 0
      dec size
      if player ship not in same sector
        ship turn tcs on
      end
    end
    clear array and set global
*grin* two commands or hotkeys one to set the variable on the ship
one to use the variable as a toggle

and one al plugin with the player ship as [this] to turn it back on when the player leaves sector


i know its not that simple...nothing ever is

but the array would only have to be the array of the last group of ships it was run on

an upgrade could take the place of the local variable instead of having the set local variable command (reduced to one command/hotkey)

anyways...just thought since im mentally in scripting mode already id see what i could come up with to help ease the burden

and by prioritization thingy, i meant override the allowed targets - like fire on my target if can no mater what class of ship it is....if not then go to secondary *grin*

x0ne
Posts: 173
Joined: Sun, 9. Apr 06, 21:49
x3tc

Post by x0ne » Tue, 8. Jan 08, 03:44

I think AL code is an added complication I don't need right now - 2.0 will probably be the most complex turret plugin for X3... in fact, the current version probably is atm! :)

I'm sure you're aware of this, but there are a lot of things to consider with what you're proposing, many existing scripts would be impacted by it, even turning the TCS off would tricky - i.e. what turret commands would you start on each ship to replace the TCS ones you've just turned off, and are those commands available to that ship? See, it's not easy ;)

As for the prioritisation, your wish is my command! In other words, it's already in 2.0 :)

MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe » Tue, 8. Jan 08, 04:50

um..the default equivalent, and the tcs options wouldn't be available but all others would *grin*

AL is easy....if you need a timer for something its alot better than using waits (its more accurate - in that sector changes don't reset it, less accurate in that its measured in seconds) and if all you use it for is a timer its pretty useful, check out my IFTSOS script....rather than have a globaly running script with waits i created it as an AL plugin that every 60 seconds calls the production check (which incidentally also auto installs/uninstalls the factories), the production check gets a list of all player owned pHQ (can be changed to all TL or even all Specific Ship) and checks the locals variables of those using that information to figure out what to do next, and saves any changes it makes back to those local variables (if the local isn't available it gets a default variable that i made global and is created in the setup script, and saves that to the local)

as a side note, im currently dramatically expanding IFTSOS
im adding in a management menu, which in its current state can generate several different reports and repackage the HQ (saveing all your tradeable wares that are on board, undocking all ships, and saving the IFTSOS variables) - and restore it later (after the TL its repackaged to has placed the HQ)
currently in the works is a blueprint installation menu option - with a side ability that it will add the HQs production capabilities to a ship thats running IFTSOS

think Mobile pHQ

im currently trying to figure out if its possible to create a ship that on creation is docked with another ship or station...or if im gona have to create it nearby and tell it to dock

im also intending to add a merchant fleet management system and a military fleet management system (that can interact with eachother)

eventually ill probably branch out to turret management, after i do a wingman management system, which will be after i do the military fleet management system

the currently available IFTSOS uses no commands/hotkeys at all, the update im working on currently uses only 1 command, and im gona try to keep it that way - the MD question lib is very useful for menu generation...no clutter in the logbook, so i can feel free to make a very complex menu

DaveyP
Posts: 986
Joined: Mon, 7. Nov 05, 19:06
x3tc

Post by DaveyP » Wed, 27. Feb 08, 12:25

Just started using it in my XTM game, and it's awesome :D

2 quick questions.

1) Does anyone know correct refire rate on HMG? I wanna ad this in.

2) Was using a version of X2 Gunnery Crew Commands with AEGIS, and I notice that FLAK/PPC fire seems to be about twice as fast with that plugin as XoneTCS, even when the turrets are firing straight on and the turrets don't have to track.. Since all the NPC ships are using this, I'm at a bit of a dissadvantage.

Ideas anyone?

Cheers.

x0ne
Posts: 173
Joined: Sun, 9. Apr 06, 21:49
x3tc

Post by x0ne » Sun, 2. Mar 08, 23:05

Sorry for the very late reply, RL has me a bit tied up right now... :oops:

Refire delay for the HMG is 7500ms, nice to hear of someone hacking the weapons data script themselves for XTM :)

I think the slow firing you're observing is due to the way the command scripts actually fire - it's different to some other scripts (stock scripts included). Instead of using a fixed wait time for all weapons within a firing loop (e.g the part of the script that goes fire, wait, fire, wait, etc.), the plugin waits for the exact refire delay of the mounted weapon type, this means that when the turret is fired, all guns fire at the same time.

If you use the fixed wait time, a projectile will leave a turret more often, but it will only be one or two at a time - not eight for instance. Both methods ultimately result in the same number of projectiles raining down on a target however.

Hope that helps explain it.

DaveyP
Posts: 986
Joined: Mon, 7. Nov 05, 19:06
x3tc

Post by DaveyP » Tue, 11. Mar 08, 13:20

Aah - Gotcha - that explains it. Cheers.

A little thought I had about the MD problem. As far as I can see, HMG projectiles are invisible. [EDIT] I don't believe I actually said "as far as I can see, they're invisible [/EDIT] but would it be possible to change the MD bullet type to the same as the HMG to avoid having to render everything?

[Another edit]
Whilest I'm here, the "out of range" problem (which I realise is an XTM problem) occurs on the Olympus, too.

xyzzy
Posts: 221
Joined: Fri, 15. Jun 07, 02:27
x3

lightweight option?

Post by xyzzy » Thu, 20. Mar 08, 17:05

Hi x0ne,

I've been using your TCS with excellent results. I've got it installed on most of my cap ships: basically 2x Argon Titan, 1x Boron Hammerhead, 2x Pirate Reaver, 2x Otas Custodian, 1x Pirate Galleon. It works as advertised :). Mostly I like it because without it, if I set up my ships to fight other cap ships, a few fighters can destroy my M2! With TCS he can defend himself against a variety of threats. It simulates a "layered defense" that is otherwise hard to get in X3 without a lot more turrets per ship.

I'm worried about eventual scalability as I build a bigger fleet though, given your warning about "up to around 36 turrets is (just) ok". I'm wondering if it'd be possible to have a "TCS-light" option for version 2. It might work something like this: forgo most of the fancy features, but check every 5 seconds for which enemies are within a few Km of the ship. No fanciness about which turret can hit them and FFRCS and so on - only a count of "ships in range". If there are "big ships" within 6 Km switch to anti-big-ship weapons. If there are no big ships but there are little ships, switch to anti little-ship weapons. If there are both, half the turrets set to target cap ships with cap ship weapons and vice versa. Something simple like that might solve the basic problem of being defenseless against fighters if you have a capship loadout and vice versa, while being light enough to run on many turrets at once. It wouldn't be as good as full TCS, but you could run it x 150 turrets if you wanted, and you could still run the full TCS on a few selected important ships.

What do you think?

Phier
Posts: 254
Joined: Sat, 23. Feb 08, 22:23
x3tc

Post by Phier » Sun, 30. Mar 08, 01:51

I am using a pirate galleon with 32 b-flacks and 6 bpc, having tricked it out and upgrading my fighter fleet + every thing has me at only 7 million free credits currently.

I'm having the same issue as others where ONE bpc is loaded per turret, they don't seem to fire, and it never loads the flack cannons. For testing I had it fly into 3 pirate M3's and it never fired. I also tried some Xenon cap ships and the bpc's never fired either.

So until I have 44 flacks and 44 bpcs it won't do proper weapon switching?
That bit wasn't clear in the previous posts to me.

If so is it worth keeping the software for now for the rate of fire thing or should I just wait until I can afford a full load out?

Legionnaire
Posts: 1368
Joined: Sun, 8. Feb 04, 16:28
x4

Post by Legionnaire » Sun, 30. Mar 08, 04:45

Phier is that a bought or captured galleon?
because as far as i understand from other posts in different threads about the 1 weapon per turret sybdrome, setting the turret commands to none using the command for all turrets and then resetting them to what you want them to do should let you load the turrets up. however this complaint is apparent more active with captured ships.

Legionnaire

Phier
Posts: 254
Joined: Sat, 23. Feb 08, 22:23
x3tc

Post by Phier » Sun, 30. Mar 08, 05:30

Its a bought one, 67 million took a big hunk of my noob wallet :)

I have gotten it to work mostly correctly after experimenting a lot. It seemed to need to get switched to the 'normal' turret mode and then back to the script one. I'm not 100% sure its functioning 100% correctly but in my 'brief' experiments in X space it seemed the bpcs were switching to the right turrets.

Phier
Posts: 254
Joined: Sat, 23. Feb 08, 22:23
x3tc

Post by Phier » Mon, 7. Apr 08, 23:28

Now that I have a full weapon load out, this script is pretty impressive.

I was rather surprised to see it was using shockwave generators as well, but was a cute effect.

Its fun to watch it work, thanks for making it available.

x0ne
Posts: 173
Joined: Sun, 9. Apr 06, 21:49
x3tc

Post by x0ne » Sat, 26. Apr 08, 00:05

Hey all, sorry for the -massively- late reply but I'm moving house... many, many things not sorted yet and I've just not had the time for anything fun :(

About the captured ship weirdness, there's a bug in the game whereby captured ships can end up with 'ghost' weapons installed in turrets - i.e. weapons aboard the ship that the script editor can't detect. Plays all sorts of havoc with the TCS I'm afraid. The only way around it is more code from me in another version, or destroying the ship you capped and scripting in a replacement - it's not cheating ;)

I'm still working on the next version, progress is limited to my free time though - just about everything in RL has changed for me recently though... really sucks.

Should have a new version released in time for everything to be obsolete with the release of Terran Conflict :D

DaveyP
Posts: 986
Joined: Mon, 7. Nov 05, 19:06
x3tc

Post by DaveyP » Wed, 7. May 08, 11:34

Mmmmm - new version :D

Any chance of a features preview?

Also, while I'm here, re the "dodgy turret slot" problem. Could this be resolved by mounting the lone weapon in the last turret slot rather than the first one?

I know this would mean reversing all the loops, but it might work.

radarhazard
Posts: 108
Joined: Thu, 28. Jul 05, 16:13
x3tc

Post by radarhazard » Thu, 8. May 08, 13:13

only just found this...what a brilliant solution...and it seems to work, from the other posts, a lot better than A.E.G.I.S. ever did for me....one download to XTM, coming right up! :D
Here's to us!
Who's like us?
There's none like us,
And they're all dead.

NeonSamurai
Posts: 64
Joined: Fri, 2. Jun 06, 03:14
x3

Post by NeonSamurai » Sat, 24. May 08, 16:34

Yes I've started using this script again and I must say I am very impressed by the results. I do have a few comments/suggestions though.

First off I wish there was a toggle (key, command, or script edit) which would force the turrets to engage missiles even if they won't do 1% damage. I run this script on m6 ships and even though the missile will hardly dent the shields it will send the ship spinning and flames everywhere which gets annoying.

Second thing is I've noticed a bit of oddness with the script favoring certain weapons over others. For example when I've had BPBEs and BFLAKs loaded on my M2, I've noticed that the script tends to favor the BPBEs and will use them over the BFLAKs against fighters even though the BFLAKs are far more effective at obliterating fighters.

Now I will say that my game is heavily modded (my own mod) and the weapons stats are fairly different (FLAKs got a major boost in range and are very lethal against fighter swarms). I also did customize the script to match the changes to the weapons, even still though the script still favors PBE over FLAK.

Anyhow my other suggestion is that the script somehow take damage into consideration. Though if this would weigh the script down a lot then I wouldn't bother. Another idea would be if the script has hard coded favorites that those favorites be easily editable. My solution to the issue was to not carry PBEs and I flaged my FLAKs in the script as anti missile (they do that extremely well too even though they are slow firing).

User avatar
Algoran
Posts: 584
Joined: Wed, 5. Apr 06, 08:12
x3tc

Post by Algoran » Fri, 18. Jul 08, 07:37

Hello, a question: How does this excellent script behave with B-EMPs (XTM mod)? Should it have support for them? (and other XTM weapons i suppose, but its the B-EMPs im concerned about atm :p)

I ask because it didnt seem to be using them correctly when I took my shiny new Odin out for a spin. I had four BEMPs in the cargo, and it was equipping just one on each turret, and nothing else in those turrets. So I had a situation where the foward turret had a single BEMP equipped, and was firing happily away all by itself. Meanwhile there were three other turrets with a single BEMP each doing nothing, when those guns could have been swapped to the foward turret. So um... help? :p

Other than that minor point its a brilliant script, love it :D Fast becoming one of my favorites.

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

Post by Gazz » Fri, 18. Jul 08, 17:46

Most likely this script (like most turret scripts) equips the longest range laser to have this turret scan for enemies.

You simply have too few lasers in the cargo bay. Go buy more. =P
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.

User avatar
Algoran
Posts: 584
Joined: Wed, 5. Apr 06, 08:12
x3tc

Post by Algoran » Fri, 18. Jul 08, 22:35

Ohh maybe thats it. Problem is Ive got the only 4 BEMPs in the entire universe! Well excluding those already mounted on a couple terran capships.

And, the BEMP forge firstly takes 18 hours to produce one (oh god...) and requires so many resources I havnt yet managed to make one start doing so :(

User avatar
Rad Jeebus^
Posts: 603
Joined: Sat, 20. Mar 04, 21:41
x3

Post by Rad Jeebus^ » Fri, 8. Aug 08, 15:14

Hm, is there any alternative download link as the original one doesn't seem to be working at the moment!
It denos't mtater waht oredr the ltteers in a wrod are, it's olny iprmoatnt taht the frist and lsat ltteer be at the rghit pclae.The rset can be a total mses and you can sitll raed it wouthit porbelm.Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.

Post Reply

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