Page 1 of 3

[SCRIPT] Kha'ak Cluster Commands v1.50 - 29 Dec 2007

Posted: Sun, 10. Dec 06, 13:26
by Kortako
Kha'ak Cluster Commands
This script will add 2 new commands under the "Custom" menu:

1. Decouple/Recouple cluster: Allows a player-owned cluster to be broken up into its fighter+scouts. Or, if already decoupled, reforms the cluster from the ships, as long as they are all in formation with the fighter. Look in the readme for more information on how to use this properly.

2. Activate Cluster Software Scrambler: Developed by a rogue scientist working for the Pirates, this shady piece of software was developed in an attempt to aid the guild with their raids on the strange purple ships that appeared on the borders of their sectors. It disrupts a cluster's ship computer, thereby disabling its ability to break up for a small amount of time. It requires the Software Signature Scrambler to function.

Previous field tests of the CSS software revealed that clusters have an emergency manual decouple that activates when the structural integrity of the cluster's hull has weakened too much. Therefore, when the hull drops below a certain level, rather than blowing up, the cluster naturally breaks apart. Furthermore, if the Kha'ak are able to bring their jumpdrives back online, they may use it in an act of desperation to jump a safe distance away until control of the ship is regained. After about 2 to 3 minutes, the Kha'ak are usually able to regain control of their ship.

Why is the CSS useful? Currently, it is the only known way to surprise the Kha'ak and attempt to capture a cluster before it breaks up.* Using LV's HAT script, the player can, with a little skill, capture a cluster before it has time to react to the unusual breach of their ship controls. Just target the cluster and activate it. Unfortunately, it has very little use for destroying clusters.

*Capturing clusters themselves isn't the only way to obtain one. With my recouple command, if you can capture a Fighter and the right amount of scouts (5, 13, or 21), then you can use the Recouple command on the Fighter's command console and create your own clusters.


Change Log:

v1.50 (See latest post for details)
-Fixed crucial cargo transfer bug
-New recoupling system
-Ship names are transferred between cluster and ships

v1.41
-Added in some missing files that caused the entire cargo transfer to not function properly
-Reduced the command slots to only 2 instead of 3, following Gazz's suggestion.

v1.40
-Shield and Hull damage now transfer from cluster to ships, and vice versa. However, upon recoupling, a cluster will regain its shield power if the ships' shields were low.
-All "Attack" commands under the Combat menu now function using my decouple script with cargo transfer.
-When a cluster is attacked, it now reacts and attacks back, even if it's just sitting there. Any other clusters in the same sector will decouple and help.
-Fixed a bug with my capture algorithm. Still not sure how effective it is.
-Fixed the player autopilot activating upon using the Decouple/Recouple commands.

v1.30
-New cargo transfer - you no longer lose your onboard wares!
-No more free weapons/shields when a cluster is decoupled.
-[Beta] New attempt to be able to capture clusters. Just shoot! No HAT required. Please leave feedback on difficulty of this/if it works, as I haven't tested it yet.

v1.20
-Added Cluster Software Scrambler (Requires SSS)
-Slightly tweaked Decouple and Recouple commands

v1.10
-Added ability to reform a cluster.

v1.00
-Ability to break up a Kha'ak cluster.

Many thanks to B-O'F for his help and allowing me to implement his awesome Freight exchange scripts.

Please report any bugs to me immediately. As this is my first script, please leave me some feedback! Thanks!

Kortako

Re: [Script] Break Up Kha'ak Clusters v1.0

Posted: Sun, 10. Dec 06, 19:18
by Cycrow
Kortako wrote:Also, I realize that someone like Cycrow or any of those other wonderful scripters could have done this in 5 seconds flat, but it was a good learning experience for me. :D
everyone has to start somewhere ;)

Posted: Sun, 10. Dec 06, 19:25
by Matt Armada
Personaly, i think this is a HELL of a starting point. If i even manage to use like, HAT to get my hands on a cluster, this will be the best damn script in the world for me. Good job man

Posted: Mon, 11. Dec 06, 07:42
by Kortako
New version 1.10 adds ability to reform clusters.

Posted: Mon, 11. Dec 06, 15:16
by nirwin
Good job there, like you say a bit of an odd script to make given the limitations that you stated, but it just makes me more eager to see what weird and wonderful script you will come up with next.

Keep it up!

Posted: Mon, 18. Dec 06, 02:11
by Kortako
After a couple days of messing around, I tried to make this script a little more useful/practical. Refer to the first post for the update details. Special thanks to eladan, Cycrow, and Red Spot for their help!

Posted: Mon, 25. Dec 06, 03:36
by Kortako
I don't think anyone has actually tried my script, but if anyone is interested, I found a slight bug in my recouple script. It has been fixed, so download the 1.21 version if you downloaded it before.

Kortako

Posted: Mon, 25. Dec 06, 05:34
by Lochen
I have been using it quite a bit actualy, decide to have a bit of fun, script in 50 clusters in a random teladi sector, let them all loose and watch the teladi (and framerate) drop like flies. When all the teladi ships are gone, recouple clusters, blow clusters up. Quite fun.

Anyway, very nice script, would be more useful if khaak clusters were easier to get, but I'm sure that anyone who wants one bad enough will either capture one or script one in.

Posted: Mon, 25. Dec 06, 12:44
by Red Spot
if you are interested ...

not that I'm requesting (I already have such functionality in my game) but it may be good practise ...

make Clusters act as formations, meaning making Clusters work as if they are regular ships ... if one breaks all (in sector) clusters break up ...
(the 1 first targeted by such wing of Kha'ak ships will likelly not forget about it ... :twisted: )

to implement it fully will most likelly introduce you to a few SE-features that may prove usefull when you intent going into the direction of combat/wingman-scripts ..



G

Posted: Thu, 28. Dec 06, 09:06
by Kortako
Hey Red Spot,

Your idea sounds like a good one, except, do you mean for player-clusters? To me, if a player cluster functioned like that, it wouldn't seem all that logical. I mean, it's still the player's ship, and isn't controlled by the Kha'ak anymore; therefore, the player should have to break them up unless that specific cluster is attacked.

I'll think about the idea, though. It seems intriguing. :D

Posted: Fri, 29. Dec 06, 00:12
by Red Spot
The way I did this is by objectclass, meaning it doesnt matter wich race a cluster is from (altho in my game only Kha'ak use them ...)

How I have it working (in basics)
If lets say I make 3 clusters jump in a sector than they all 3 will try and hook up with any other nearby Cluster (making sure that 1 takes the lead)
now only the lead-cluster can give the command to break up but the wingmen (and leader) will all break up together if you attack 1 of them ..

The lead-cluster keeps finding a nearest target with a regular interval wich means they generally track the nearest enemy ship, will follow it up to a distance well beyond the range of one of the largest weapons in X3 (GPPC) and break up as 1 when the leader gives the command.

Than when broken up the M3 that came from the lead-cluster will take lead (and attack) and all other M3 will follow it, the M5 will simply stay wingmen of the M3 they came with .. The effect is a somewhat more agressive behaviour by clusters and kha'ak M3/M5s that previously formed the cluster ..



G

Posted: Sun, 31. Dec 06, 15:17
by Jakesnake5
I see a slight exploit here. Let me explain.

I play Kha'ak Invader starts. I have my Fighter and the 5 Scouts (supprisingly), that could be used to form a cluster.

The exploit comes from your adding wares to the ships after decouple.

If the player is like me, and is playing Kha'ak Invader start, or has managed to capture any ships (not clusters with your script, but really cap them) and they reverse engineer them and build new Kha'ak ships, they'd be able to arm them even though they'd normally not be able to.

Or, if their a KI start, they could strip down the ships, cluster them up, and decouple with full equipment for free.

I think you need to do a check on the ships. First, find out if their hulls are 100% (this script could cheat repairs for free). Next, check they have the decoupled wares they'd be given on board already (Prevents getting freebies).

this would help quite abit to prevent exploiting.

Posted: Sun, 31. Dec 06, 16:41
by dostillevi
perhaps the Khaak are able to generate their own weapons in ship... who knows what they can do? Maybe have a timer instead of the regeneration being instant.. would give a little reward to those able to complete the difficult task of capturing a cluster, especially since you can't normally come across their weapons. Sort of a repair mode, even.... if a cluster forms up and one of the scouts is missing weaponry, the cluster could lock up and prevent de-coupling for an hour or so while it generates a new weapon for the ship. Make it an hour per weapon generated, or even longer to keep things fair.

Posted: Sun, 31. Dec 06, 19:15
by Freols
I really like the sound of this script.
It makes the Kha'ak start far more feasable. In other games you pretty much had to rely on buying other race's ships, now with the added functionality the clusters provide... it makes it easer parhaps.

Posted: Sun, 31. Dec 06, 20:46
by Kortako
Jakesnake5 wrote:I see a slight exploit here. Let me explain.

I play Kha'ak Invader starts. I have my Fighter and the 5 Scouts (supprisingly), that could be used to form a cluster.

The exploit comes from your adding wares to the ships after decouple.

If the player is like me, and is playing Kha'ak Invader start, or has managed to capture any ships (not clusters with your script, but really cap them) and they reverse engineer them and build new Kha'ak ships, they'd be able to arm them even though they'd normally not be able to.

Or, if their a KI start, they could strip down the ships, cluster them up, and decouple with full equipment for free.

I think you need to do a check on the ships. First, find out if their hulls are 100% (this script could cheat repairs for free). Next, check they have the decoupled wares they'd be given on board already (Prevents getting freebies).

this would help quite abit to prevent exploiting.
Jakesnake5, you have a very good point. The stock egosoft decouple script that I use to break up a Kha'ak ship creates ships with full hull, regardless of the hull of the cluster before. So if you attack a cluster to 1% hull, and it breaks up, they'll all come out with 100% hull. I could probably pass on the cluster's hull before it breaks up and set all the ships to that hull. Would that be better? Edit: But then what would happen when only say, a scout is damaged and it recouples? It'd be at full health again.

As for the weapons, as a quickfix you can go to the kortako.khaakSplit script and comment out the line that calls the Install script. That'll still install some weapons when they decouple (I think), but it won't be maxed out (Fighters only with 1 alpha Kyon and all with variable shields). I only did that because every time you recouple/decouple, you lose everything and start over. It's random, so you'd lose a shield here and there, or a Kyon emitter. Of course, I could just set it so they come completely stripped, and make it that much harder. Any ideas?

dostillevi, I really like your idea, but that sounds a bit complicated for me. :lol:

@Freols, if you were under the impression that you could pilot the cluster while recoupling/decoupling, I hate to tell you that this script won't do that. You have to do it remotely, because if you're in it while it decouples, the game doesn't know what to do with you when the cluster is destroyed to make the fighters and scouts. I tried it once, you suddenly just appear next to the fighter and everything starts flashing crazy-like and the game freaks out. Not pretty. That's why there is a check to make sure you don't put yourself in that situation. If only there was a way to access the transporter like it does in the 1st Bonus Scenario.

Any other feedback is much appreciated.

Posted: Sun, 31. Dec 06, 23:24
by Jakesnake5
Actually. dostillevi's idea isn't too complicated.

It requires checking the ships to couple for weapons. Identifying whats missing, Create the clushter, disable the decouple command for that cluster using the '[CmdConCheck.OneTime] | [CmdConCheck.Disabled]' flag, setting a timer for the weapons that would need 'regenerating' (30min for aK, 60 for bK) (this would be cumulative, so if several weapons are missing, the timer would be incremented by the appropriate amount).

Once the timer terminates, the decouple command is re-enabled ([CmdConCheck.OneTime] | [CmdConCheck.Available]). If you wan't, I can show you the code needed to do this enabling/disabling.

Posted: Sat, 13. Jan 07, 01:58
by Kortako
I was thinking of getting back to balancing this script sometime soon, but I want to know what people think would be the best way to fix the weapon install script.

I could use dostillevi's idea, but that's still auto-generating weapons from nothing, only with a wait time on it. I suppose that could be likened to station production times, but I don't know.

Is there a way to get an array of all the cargo items in a ship, and maybe ship extensions too? Then, maybe I could pass on a ship's current cargo hold and "distribute" it among the fighters and scouts.

Any ideas would be great.

Kortako

Posted: Sat, 13. Jan 07, 06:40
by Jakesnake5
A quick look into the MSCI shows the command:

Code: Select all

<RetVar/IF> <RefObj> get tradeable ware array from ship
for getting an array of tradable wares (non-upgrades).

I'm not sure if:

Code: Select all

<RetVar/IF> <RefObj> get amount of <Var/Ware> in cargo bay
can detect upgrades. If it can, it would mean you'd have to check for each one.

Posted: Sat, 13. Jan 07, 10:39
by B-O'F
Hi Kortako,

Jakesnake5 in the post above gives two commands that might help you, but I found that the command:-
<RetVar/IF> <RefObj> get tradeable ware array from ship
did not always give the correct information on installed shields and lasers (at 1.4.03 level - not yet checked at 2.02).

If you download my Remote Docked Freight package (zip file with all the xml scripts as well as the spk version), there are a couple of scripts in there (bof.xfer.ship.fittings and bof.ship.tradeware) that you can use as a basis for your own scripts to get the required information. If there are any other scripts in the package that you want to copy/use or whatever, you are welcome to do so - just remember to change the names so my package doesn't get broken, and don't bother with crediting me - I don't want the blame.

You, and anyone else, are perfectly welcome to use any of my scripts as you wish.

Have fun,
Boron - Ol Fh'art

Posted: Thu, 25. Jan 07, 07:20
by Kortako
Jakesnake5, I have considered your request and implemented a new feature in version 1.30. It'll transfer any cargo from a cluster to the decoupled ships, and vice versa. There's still a few things to workaround, such as a ridiculously small cargo hold for a 5+ linked together ship. A fighter filled to the brim with stuff would lose 55 units worth of items, which is quite a loss. I need some way to fix this. I don't want to resort to modding the Cluster's cargo bay, even though they should be bigger theoretically, or at least the same size as the sum of the ships' cargo bays. Grr.

A few other things I need to sort out: Can Signal_Attacked be used on player ships? I tried to use it with player clusters so that when they were attacked they decoupled, but they only just sat there, getting shot at. Darn.

I'll need to work on modifying my decouple script to use all of the Attack commands under the command console. Right now, it only uses Attack All Enemies, as that was easiest, no parameters to enter. I imagine this will be a lot of work.

Oh, hull and shield damage, too. I need to figure out the best way to pass that on from cluster to ships.

Please test this new version out and tell me if you find any problems.
Also, if anyone gets a chance, try and see if my very simplistic capture algorithm actually works, and if the rate is too high or low. I haven't actually tried it myself.